Skip to content

Stage a case without a shell

When the server runs on another machine, submit_case(case_path=...) needs a path that machine can read. Staging puts the case there through tool calls, so a client with no shell on the host can still run it.

put_case_files takes a map of relative path to content:

put_case_files({
"case_name": "wing-a8",
"files": {
"system/controlDict": "FoamFile { ... }",
"system/fvSchemes": "...",
"system/fvSolution": "...",
"0/U": "...",
"case.json": "{\"alpha\": 8, \"beta\": 0}"
}
})

It creates the case directory on first use and overwrites files that exist.

STL files go through put_case_file as base64, up to 6 MB of decoded data per call. Send the first chunk plain and every later one with append: true:

put_case_file({"case_name": "wing-a8", "rel_path": "constant/triSurface/wing.stl",
"content": "<base64>", "encoding": "base64"})
put_case_file({"case_name": "wing-a8", "rel_path": "constant/triSurface/wing.stl",
"content": "<next base64 chunk>", "encoding": "base64", "append": true})

Each call returns the file’s size so far, so you can confirm the last chunk landed.

submit_case({"case_name": "wing-a8", "nproc": 20, "stop": "watcher"})

list_cases shows what is staged, get_case_file reads a dictionary back, and remove_case deletes a staged case. A job never depends on the staged copy: submit copies it into the job directory.

The staging tools return {"status": "failed", "reason": "cases_read_only"} instead of an error, and server_info reports cases_writable: false. On a compose host this means the cases volume is mounted read-only.