From af70339d0752237f8f85f72ec52c536b27bdb32e Mon Sep 17 00:00:00 2001 From: pyranota Date: Tue, 29 Oct 2024 17:34:52 +0000 Subject: [PATCH] Fix NSJAIL INDEX_URL --- .../windmill-worker/src/python_executor.rs | 82 ++++++------------- 1 file changed, 25 insertions(+), 57 deletions(-) diff --git a/backend/windmill-worker/src/python_executor.rs b/backend/windmill-worker/src/python_executor.rs index e0f8912807..4375adbaea 100644 --- a/backend/windmill-worker/src/python_executor.rs +++ b/backend/windmill-worker/src/python_executor.rs @@ -995,71 +995,39 @@ pub async fn handle_python_reqs( } if !*DISABLE_NSJAIL { - append_logs(&job_id, w_id, "\n Prepare NSJAIL", db).await; pip_extra_index_url = PIP_EXTRA_INDEX_URL .read() .await .clone() .map(handle_ephemeral_token); - if no_uv_install { - if let Some(url) = pip_extra_index_url.as_ref() { - vars.push(("EXTRA_INDEX_URL", url)); - } + if let Some(url) = pip_extra_index_url.as_ref() { + vars.push(("EXTRA_INDEX_URL", url)); + } - pip_index_url = PIP_INDEX_URL - .read() - .await - .clone() - .map(handle_ephemeral_token); + pip_index_url = PIP_INDEX_URL + .read() + .await + .clone() + .map(handle_ephemeral_token); - if let Some(url) = pip_index_url.as_ref() { - vars.push(("INDEX_URL", url)); - } - if let Some(cert_path) = PIP_INDEX_CERT.as_ref() { - vars.push(("PIP_INDEX_CERT", cert_path)); - } - if let Some(host) = PIP_TRUSTED_HOST.as_ref() { - vars.push(("TRUSTED_HOST", host)); - } - if let Some(http_proxy) = HTTP_PROXY.as_ref() { - vars.push(("HTTP_PROXY", http_proxy)); - } - if let Some(https_proxy) = HTTPS_PROXY.as_ref() { - vars.push(("HTTPS_PROXY", https_proxy)); - } - if let Some(no_proxy) = NO_PROXY.as_ref() { - vars.push(("NO_PROXY", no_proxy)); - } - } else { - if let Some(url) = pip_extra_index_url.as_ref() { - vars.push(("UV_EXTRA_INDEX_URL", url)); - } - - pip_index_url = PIP_INDEX_URL - .read() - .await - .clone() - .map(handle_ephemeral_token); - - if let Some(url) = pip_index_url.as_ref() { - vars.push(("UV_INDEX_URL", url)); - } - if let Some(cert_path) = PIP_INDEX_CERT.as_ref() { - vars.push(("PIP_INDEX_CERT", cert_path)); - } - if let Some(host) = PIP_TRUSTED_HOST.as_ref() { - vars.push(("TRUSTED_HOST", host)); - } - if let Some(http_proxy) = HTTP_PROXY.as_ref() { - vars.push(("HTTP_PROXY", http_proxy)); - } - if let Some(https_proxy) = HTTPS_PROXY.as_ref() { - vars.push(("HTTPS_PROXY", https_proxy)); - } - if let Some(no_proxy) = NO_PROXY.as_ref() { - vars.push(("NO_PROXY", no_proxy)); - } + if let Some(url) = pip_index_url.as_ref() { + vars.push(("INDEX_URL", url)); + } + if let Some(cert_path) = PIP_INDEX_CERT.as_ref() { + vars.push(("PIP_INDEX_CERT", cert_path)); + } + if let Some(host) = PIP_TRUSTED_HOST.as_ref() { + vars.push(("TRUSTED_HOST", host)); + } + if let Some(http_proxy) = HTTP_PROXY.as_ref() { + vars.push(("HTTP_PROXY", http_proxy)); + } + if let Some(https_proxy) = HTTPS_PROXY.as_ref() { + vars.push(("HTTPS_PROXY", https_proxy)); + } + if let Some(no_proxy) = NO_PROXY.as_ref() { + vars.push(("NO_PROXY", no_proxy)); } let _ = write_file(