hskue is a small shell wrapper around hs submit that snapshots a job script before queueing it.
This helps preserve the exact script that was submitted, even if the original file changes later.
From this checkout:
uv tool install .While iterating on the script locally, use editable mode instead:
uv tool install --editable --reinstall .Because hskue is installed as a shell script, changes to hskue are not picked up until you reinstall the tool.
That installs the hskue command onto your PATH, so you can run:
hskue -- ./train.shWhen you submit a job with hskue, it:
- Resolves the job script to an absolute path.
- Copies the script's containing directory into a history directory with a timestamped snapshot folder.
- Builds a lightweight runtime mirror rooted at the original submit-time working directory, overlaying the copied script directory onto symlinks to the live project tree.
- Writes a small launcher script that runs the mirrored entry script from the original submit-time working directory.
- Stores basic submission metadata.
- Calls
hs submitwith your original submit arguments and job arguments.
bashhs(HyperShell) available onPATH, or passed via--hs-bin/HS_BINsha256sum- Either
realpathorreadlink -f
hskue [wrapper args...] [hs submit args...] -- path/to/job.sh [job args...]Examples:
hskue -- ./train.sh
hskue --history-dir ~/.local/state/hskue/history -- ./train.sh
hskue -t model:vit -t gpu:a100 -- ./train.sh --epochs 50
HS_SUBMITTED_HISTORY_DIR=~/.local/state/hskue/history hskue -- ./train.sh--history-dir DIRoverrides the snapshot directory.--hs-bin PATHoverrides thehsexecutable.-h,--helpprints help text.
Everything before -- that is not a wrapper argument is passed through to hs submit.
Everything after -- is treated as:
- the job script path
- followed by any job arguments passed to that script
By default, snapshots are stored in a fixed per-user directory:
~/.local/state/hskue/history
You can override that with:
--history-dirHS_SUBMITTED_HISTORY_DIR
Each submission creates a folder like:
~/.local/state/hskue/history/20260319T153000_train_ab12cd34ef56/
That folder contains:
payload/, containing the copied job script and its sibling filesruntime/, a lightweight mirrored tree used to preserve project-relative pathslaunch.sh, which runs the mirrored snapshot from the original working directorymetadata.txt, which records submission details- old snapshot folders are pruned automatically so only the newest 100 remain
- The queued job runs from the working directory where
hskuewas invoked. - Copying the script directory helps scripts that source sibling files via
dirname "$0"or${BASH_SOURCE[0]}keep working from the snapshot. - When the submitted script lives under the original submit directory,
hskuemirrors that directory layout underruntime/so project-relative paths like../configsor../logsstill resolve. - If the original script has a shebang, that interpreter is used for the snapshot.
- If the script does not have a shebang, the launcher falls back to
bash. - The snapshot preserves mode, timestamps, and symlinks for files copied from the script directory.
- If
HOMEis unavailable,hskuefalls back to./hs_submitted_history. hskueprints a warning if it cannot detect a localhs cluster,hs server, orhs clientprocess before submission.