From 7985a7bafa1ce5f67fb4331d95333711672483af Mon Sep 17 00:00:00 2001 From: pyranota Date: Mon, 21 Oct 2024 18:16:10 +0000 Subject: [PATCH] Refactor fallback no_uv disable compile and install where no_uv_install and no_uv_compile are a bit more specific --- backend/windmill-worker/src/python_executor.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/windmill-worker/src/python_executor.rs b/backend/windmill-worker/src/python_executor.rs index 9e67a79638..886d50226a 100644 --- a/backend/windmill-worker/src/python_executor.rs +++ b/backend/windmill-worker/src/python_executor.rs @@ -43,7 +43,7 @@ lazy_static::lazy_static! { .ok().map(|flag| flag == "true").unwrap_or(false); /// Use pip install - static ref USE_PIP: bool = std::env::var("USE_PIP") + static ref USE_PIP_INSTALL: bool = std::env::var("USE_PIP_INSTALL") .ok().map(|flag| flag == "true").unwrap_or(false); @@ -929,7 +929,7 @@ async fn handle_python_deps( worker_name, w_id, occupancy_metrics, - annotations.no_uv, + annotations.no_uv || annotations.no_uv_compile, annotations.no_cache, ) .await @@ -955,7 +955,7 @@ async fn handle_python_deps( job_dir, worker_dir, occupancy_metrics, - annotations.no_uv_install, + annotations.no_uv || annotations.no_uv_install, ) .await?; additional_python_paths.append(&mut venv_path); @@ -987,12 +987,15 @@ pub async fn handle_python_reqs( let pip_extra_index_url; let pip_index_url; - no_uv_install |= *USE_PIP; + no_uv_install |= *USE_PIP_INSTALL; + if no_uv_install { append_logs(&job_id, w_id, "\nFallback to pip (Deprecated!)\n", db).await; tracing::warn!("Fallback to pip"); } + if !*DISABLE_NSJAIL { + append_logs(&job_id, w_id, "\n Prepare NSJAIL", db).await; pip_extra_index_url = PIP_EXTRA_INDEX_URL .read() .await