A tool to securely run jobs on Slurm clusters.
Project description
SecBatch
A CLI tool to simplify running jobs with encrypted data on a Slurm cluster. This tool automates key generation, data encryption, uploading, Slurm job submission, monitoring, and result retrieval.
Installation
Prerequisites
Before installing, you must have the following command-line tool available in your system's PATH:
- GnuPG (gpg): For encryption and decryption.
You can typically install this using your system's package manager (e.g., apt-get, brew, yum).
Note: Installation under Windows requires different steps described below.
Installing with uv
Once the prerequisites are met, you can install the tool from PyPI using uv:
uv pip install secbatch
This will install the tool and make the secbatch command available in your environment.
Installing with pip
Once the prerequisites are met, you can install secbatch from PyPI using pip in Command Prompt or PowerShell:
pip install secbatch
This will install the tool and its dependencies, making the secbatch command available in your environment.
Usage
After installation, you can use the secbatch command directly, or run it as a module: python -m secbatch.
Full Command Reference
secbatch --host <your-host> <command> [options]
Global Arguments:
--host: The SSH hostname or an alias from your~/.ssh/config.-u, --user: (Optional) Your SSH username. Overrides the user in~/.ssh/config.--ssh-key-file: (Optional) Path to your SSH private key. Overrides theIdentityFilein~/.ssh/config.
Commands:
-
run: Execute the full secure workflow.-i, --input-dir: The local directory containing your input data.-e, --exec: The command to execute on the compute node.-s, --script-file: Path to a local script file to execute.-o, --output-dir: The local directory for results.-n, --job-name: (Optional) A name for the Slurm job.--keep-local-temp: Do not delete the local temporary directory after the workflow completes.-p, --param: (Optional) Additional parameters to pass to sbatch. Can be used multiple times.- ... (and other Slurm parameters like
--nodes,--time, etc.)
-
test-connection: Test the SSH connection to the host. -
test-job: Submit a predefined example job to test the full workflow.
Example: Running a Job
secbatch --host my-cluster run \
-i ./my-data \
-e 'grep "sensitive" input/patient.txt > processed.txt' \
-o ./results
::include{file=TUTORIAL_WINDOWS.md}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file secbatch-1.2.0.tar.gz.
File metadata
- Download URL: secbatch-1.2.0.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4369a36de6bfcaf7ef1b041cf79c28024abe6cc38fd6f511335aa126d27a2e4c
|
|
| MD5 |
99bac03dd6530903c480cf45deea14d4
|
|
| BLAKE2b-256 |
9791d6e9e5b389ac12b89408a0db9555a7cad8d0df7c45fd48cc8a6bc1bc2790
|
File details
Details for the file secbatch-1.2.0-py3-none-any.whl.
File metadata
- Download URL: secbatch-1.2.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a299d0a8e3dc8098ce36f2c4276b6dddb6d1269240d40a0f88c3614d03b1941
|
|
| MD5 |
f44485e7db68788f061366f501f7c34d
|
|
| BLAKE2b-256 |
94e7c92d19329c0ada09b491c915b767d2eb8bf6e120ad76b5f0762fa2bbb27e
|