From ba8add525b55d512fb0736195f616bfa614d266d Mon Sep 17 00:00:00 2001 From: pyranota <92104930+pyranota@users.noreply.github.com> Date: Sat, 25 Jan 2025 14:38:32 +0300 Subject: [PATCH] fix: Fix python refetching wheels from S3 (#5133) --- backend/windmill-worker/src/python_executor.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/backend/windmill-worker/src/python_executor.rs b/backend/windmill-worker/src/python_executor.rs index 4d3a946926..001f771eb7 100644 --- a/backend/windmill-worker/src/python_executor.rs +++ b/backend/windmill-worker/src/python_executor.rs @@ -2158,6 +2158,18 @@ pub async fn handle_python_reqs( db ).await; pids.lock().await.get_mut(i).and_then(|e| e.take()); + + // Create a file to indicate that installation was successfull + let valid_path = venv_p.clone() + "/.valid.windmill"; + // This is atomic operation, meaning, that it either completes and wheel is valid, + // or it does not and wheel is invalid and will be reinstalled next run + if let Err(e) = File::create(&valid_path).await{ + tracing::error!( + workspace_id = %w_id, + job_id = %job_id, + "Failed to create {}!\n{e}\n + This file needed for python jobs to function", valid_path) + }; return Ok(()); } }