mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-20 16:02:19 +00:00
fix autogen script names
This commit is contained in:
@@ -686,7 +686,7 @@ def main(error, port):
|
||||
result,
|
||||
json!({
|
||||
"recv": 42,
|
||||
"from failure module": {"error": {"name": "IndexError", "stack": " File \"/tmp/inner.py\", line 5, in main\n return sock.recv(1)[0]\n", "message": "index out of range"}},
|
||||
"from failure module": {"error": {"name": "IndexError", "stack": " File \"/tmp/windmill/3/retry::test_with_failure_module/0187299b-1ea5-d1a3-5197-f48a6a84fcff/tmp/main/step_0.py\", line 5, in main\n return sock.recv(1)[0]\n", "message": "index out of range"}},
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -2069,7 +2069,7 @@ async fn test_branchall_skip_failure(db: Pool<Postgres>) {
|
||||
|
||||
assert_eq!(
|
||||
result,
|
||||
serde_json::json!([{"error": {"name": "Error", "stack": "Error: failure\n at main (file:///tmp/inner.ts:1:31)\n at run (file:///tmp/main.ts:9:26)\n at file:///tmp/main.ts:14:1", "message": "failure"}}, [1,3]])
|
||||
serde_json::json!([{"error": {"name": "Error", "stack": "Error: failure\n at main (file:///tmp/main.ts:1:31)\n at run (file:///tmp/wrapper.ts:9:26)\n at file:///tmp/wrapper.ts:14:1", "message": "failure"}}, [1,3]])
|
||||
);
|
||||
|
||||
let flow: FlowValue = serde_json::from_value(json!({
|
||||
|
||||
@@ -61,8 +61,8 @@ mount {
|
||||
|
||||
|
||||
mount {
|
||||
src: "{JOB_DIR}/inner.ts"
|
||||
dst: "/tmp/inner.ts"
|
||||
src: "{JOB_DIR}/wrapper.ts"
|
||||
dst: "/tmp/wrapper.ts"
|
||||
is_bind: true
|
||||
}
|
||||
|
||||
|
||||
@@ -1556,14 +1556,14 @@ async fn handle_deno_job(
|
||||
// TODO: Separately cache dependencies here using `deno cache --reload --lock=lock.json src/deps.ts` (https://deno.land/manual@v1.27.0/linking_to_external_code/integrity_checking)
|
||||
// Then require caching below using --cached-only. This makes it so we require zero network interaction when running the process below
|
||||
|
||||
let _ = write_file(job_dir, "inner.ts", inner_content).await?;
|
||||
let _ = write_file(job_dir, "main.ts", inner_content).await?;
|
||||
let sig = trace_span!("parse_deno_signature")
|
||||
.in_scope(|| windmill_parser_ts::parse_deno_signature(inner_content))?;
|
||||
create_args_and_out_file(client, job, job_dir).await?;
|
||||
let spread = sig.args.into_iter().map(|x| x.name).join(",");
|
||||
let wrapper_content: String = format!(
|
||||
r#"
|
||||
import {{ main }} from "./inner.ts";
|
||||
import {{ main }} from "./main.ts";
|
||||
|
||||
const args = await Deno.readTextFile("args.json")
|
||||
.then(JSON.parse)
|
||||
@@ -1593,12 +1593,12 @@ run().catch(async (e) => {{
|
||||
if c == script_path_parts_len - 1 { "" } else { "/" },
|
||||
);
|
||||
}
|
||||
write_file(job_dir, "main.ts", &wrapper_content).await?;
|
||||
write_file(job_dir, "wrapper.ts", &wrapper_content).await?;
|
||||
let import_map = format!(
|
||||
r#"{{
|
||||
"imports": {{
|
||||
"/": "{base_internal_url}/api/w/{w_id}/scripts/raw/p/",
|
||||
"./inner.ts": "./inner.ts",
|
||||
"./wrapper.ts": "./wrapper.ts",
|
||||
"./main.ts": "./main.ts"{relative_mounts}
|
||||
}}
|
||||
}}"#,
|
||||
@@ -1642,7 +1642,7 @@ run().catch(async (e) => {{
|
||||
} else {
|
||||
args.push("-A");
|
||||
}
|
||||
args.push("/tmp/main.ts");
|
||||
args.push("/tmp/wrapper.ts");
|
||||
|
||||
Command::new(NSJAIL_PATH.as_str())
|
||||
.current_dir(job_dir)
|
||||
@@ -1655,7 +1655,7 @@ run().catch(async (e) => {{
|
||||
.spawn()?
|
||||
} else {
|
||||
let mut args = Vec::new();
|
||||
let script_path = format!("{job_dir}/main.ts");
|
||||
let script_path = format!("{job_dir}/wrapper.ts");
|
||||
let import_map_path = format!("{job_dir}/import_map.json");
|
||||
args.push("run");
|
||||
args.push("--import-map");
|
||||
|
||||
Reference in New Issue
Block a user