fix(backend): support PIP_INDEX_URL

This commit is contained in:
Ruben Fiszel
2022-11-28 23:48:42 +01:00
parent 6d037f92d1
commit cecc5a9d73
2 changed files with 12 additions and 2 deletions
@@ -19,5 +19,6 @@ then
echo "\$TRUSTED_HOST is set to $TRUSTED_HOST"
fi
CMD="/usr/local/bin/python3 -m pip install $REQ -I -t $TARGET --no-cache --no-color --no-deps --isolated --no-warn-conflicts --disable-pip-version-check $INDEX_URL_ARG $EXTRA_INDEX_URL_ARG $TRUSTED_HOST_ARG"
CMD="/usr/local/bin/python3 -m pip install -v $REQ -I -t $TARGET --no-cache --no-color --no-deps --isolated --no-warn-conflicts --disable-pip-version-check $INDEX_URL_ARG $EXTRA_INDEX_URL_ARG $TRUSTED_HOST_ARG"
echo $CMD
eval $CMD
+10 -1
View File
@@ -1611,7 +1611,10 @@ async fn handle_python_job(
additional_python_paths = handle_python_reqs(
python_path,
requirements.split("\n").collect(),
requirements
.split("\n")
.filter(|x| !x.starts_with("--"))
.collect(),
vars.clone(),
job,
logs,
@@ -2618,6 +2621,12 @@ async fn handle_python_reqs(
);
let child = if !disable_nsjail {
tracing::info!(
worker_name = %worker_name,
job_id = %job.id,
workspace_id = %job.workspace_id,
"starting nsjail"
);
let mut vars = vars.clone();
let req = req.to_string();
vars.push(("REQ", &req));