feat: support pinned versions for bun in deployed scripts

This commit is contained in:
Ruben Fiszel
2023-09-19 18:15:01 +02:00
parent ab45917b78
commit e3d28b9507
2 changed files with 6 additions and 10 deletions
@@ -71,14 +71,6 @@ mount {
}
mount {
src: "{JOB_DIR}/node_modules"
dst: "/tmp/bun/node_modules"
is_bind: true
mandatory: false
}
mount {
src: "{JOB_DIR}/wrapper.ts"
dst: "/tmp/bun/wrapper.ts"
@@ -139,7 +131,6 @@ mount {
src: "{CACHE_DIR}"
dst: "/tmp/windmill/cache/bun"
is_bind: true
rw: true
mandatory: false
}
+6 -1
View File
@@ -25,7 +25,10 @@ use crate::{
#[cfg(feature = "enterprise")]
use crate::MAX_BUFFERED_DEDICATED_JOBS;
use tokio::{fs::File, process::Command};
use tokio::{
fs::{remove_dir_all, File},
process::Command,
};
#[cfg(feature = "enterprise")]
use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader};
@@ -227,6 +230,7 @@ pub async fn handle_bun_job(
common_bun_proc_envs.clone(),
)
.await?;
remove_dir_all(format!("{}/node_modules", job_dir)).await?;
} else if !*DISABLE_NSJAIL {
logs.push_str("\n\n--- BUN INSTALL ---\n");
set_logs(&logs, &job.id, &db).await;
@@ -243,6 +247,7 @@ pub async fn handle_bun_job(
false,
)
.await?;
remove_dir_all(format!("{}/node_modules", job_dir)).await?;
}
logs.push_str("\n\n--- BUN CODE EXECUTION ---\n");