Compare commits

...

5 Commits

Author SHA1 Message Date
pyranota
fd838fd982 Merge branch 'main' into fix-no-uv-fallback 2024-12-09 19:01:42 +01:00
pyranota
1106f72daa Merge branch 'main' into fix-no-uv-fallback 2024-12-09 18:32:14 +01:00
Alexander Petric
484a612017 Merge branch 'main' into fix-no-uv-fallback 2024-12-04 10:44:50 -05:00
pyranota
dac4dcee75 Make it build 2024-12-04 16:38:23 +01:00
pyranota
5c266fb102 fix no_uv not affecting deploy
Before this fix no_uv, no_uv_compile and no_uv_install were not affecting Dependency jobs

These jobs are only affected if used USE_PIP_COMPILE or USE_PIP_INSTALL env variables

To make it more consistant, no_uv should also affect dep jobs.

Also make ansible use uv by default
2024-12-04 15:50:52 +01:00
2 changed files with 13 additions and 5 deletions

View File

@@ -116,8 +116,8 @@ async fn handle_ansible_python_deps(
job_dir, job_dir,
worker_dir, worker_dir,
&mut Some(occupancy_metrics), &mut Some(occupancy_metrics),
true, false,
true, false,
) )
.await?; .await?;
additional_python_paths.append(&mut venv_path); additional_python_paths.append(&mut venv_path);

View File

@@ -13,7 +13,7 @@ use windmill_common::flows::{FlowModule, FlowModuleValue, FlowNodeId};
use windmill_common::get_latest_deployed_hash_for_path; use windmill_common::get_latest_deployed_hash_for_path;
use windmill_common::jobs::JobPayload; use windmill_common::jobs::JobPayload;
use windmill_common::scripts::ScriptHash; use windmill_common::scripts::ScriptHash;
use windmill_common::worker::{to_raw_value, to_raw_value_owned, write_file}; use windmill_common::worker::{to_raw_value, to_raw_value_owned, write_file, PythonAnnotations};
use windmill_common::{ use windmill_common::{
apps::AppScriptId, apps::AppScriptId,
error::{self, to_anyhow}, error::{self, to_anyhow},
@@ -1567,6 +1567,8 @@ async fn python_dep(
w_id: &str, w_id: &str,
worker_dir: &str, worker_dir: &str,
occupancy_metrics: &mut Option<&mut OccupancyMetrics>, occupancy_metrics: &mut Option<&mut OccupancyMetrics>,
no_uv_compile: bool,
no_uv_install: bool,
) -> std::result::Result<String, Error> { ) -> std::result::Result<String, Error> {
create_dependencies_dir(job_dir).await; create_dependencies_dir(job_dir).await;
let req: std::result::Result<String, Error> = uv_pip_compile( let req: std::result::Result<String, Error> = uv_pip_compile(
@@ -1579,7 +1581,7 @@ async fn python_dep(
worker_name, worker_name,
w_id, w_id,
occupancy_metrics, occupancy_metrics,
false, no_uv_compile,
false, false,
) )
.await; .await;
@@ -1596,7 +1598,7 @@ async fn python_dep(
job_dir, job_dir,
worker_dir, worker_dir,
occupancy_metrics, occupancy_metrics,
false, no_uv_install,
false, false,
) )
.await; .await;
@@ -1647,6 +1649,8 @@ async fn capture_dependency_job(
.join("\n") .join("\n")
}; };
let PythonAnnotations { no_uv, no_uv_install, no_uv_compile, .. } =
PythonAnnotations::parse(job_raw_code);
python_dep( python_dep(
reqs, reqs,
job_id, job_id,
@@ -1658,6 +1662,8 @@ async fn capture_dependency_job(
w_id, w_id,
worker_dir, worker_dir,
&mut Some(occupancy_metrics), &mut Some(occupancy_metrics),
no_uv_compile | no_uv,
no_uv_install | no_uv,
) )
.await .await
} }
@@ -1681,6 +1687,8 @@ async fn capture_dependency_job(
w_id, w_id,
worker_dir, worker_dir,
&mut Some(occupancy_metrics), &mut Some(occupancy_metrics),
false,
false,
) )
.await .await
} }