Skip to main content

CLI For Launching Experiments Using Singularity On Slurm

Project description

Spork: Helping You Run Slurm Jobs

Spork is a quality of life package that enables rapid deployment of code on a slurm cluster with singularity installed and password enabled login. Running experiments on your cluster is as simple as a single command in the terminal using spork. See below for an example and install instructions.

Installation

Spork can be installed using the pip package.

pip install spork-cli

Usage

You may configure spork to remember the ssh credentials to your cluster using the following example.

spork set --ssh-username username --ssh-password password --ssh-host compute.example.com

Running your first command on your cluster is then as simple as one line in the terminal.

spork remote echo "my first command"

Certain workloads require uploading certain data files into the singularity image on the remote machine before running experiments. This can be done with the following command.

spork upload --recursive --exclude "*.pkl" ./local_dir remote_dir/in/image

Additionally, you can download files from the remote machine with a single command. The following command will download the results folder inside the remote singularity image to a location in the current local working directory. The remote path is always taken with respect to the singularity image path.

spork download --recursive --exclude "*.pkl" results ./

Experimentation

A typical experiment creation pipeline involved working on code locally, testing the code locally, then running in on a server. This can be done easily using spork.

python do_my_experiment.py

Once your code is ready for deployment, tell spork how to install your code from github.

spork set --post-env-commands "git clone https://github.com/username/repo /code/repo" \
          --post-env-commands "pip install -e /code/repo"

Then, point spork to where your code working directory is stored locally.

spork set --sync-with ./ --sync-target /code/repo --exclude-from-sync "*.sif"

Then test your code in a local copy of the singularity to make sure it works as expected.

spork local python /code/repo/do_my_experiment.py

Then run it on the cluster.

spork remote python /code/repo/do_my_experiment.py

In this example, spork will automatically copy code from your repository on the local disk to code folder in your remote singularity image. This is especially helpful when changes aren't committed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spork-cli-1.0.17.tar.gz (16.8 kB view details)

Uploaded Source

File details

Details for the file spork-cli-1.0.17.tar.gz.

File metadata

  • Download URL: spork-cli-1.0.17.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.11

File hashes

Hashes for spork-cli-1.0.17.tar.gz
Algorithm Hash digest
SHA256 f290ba98481073f834b6f8d6250aa9e404617465258d96445cd32f65c6838a8d
MD5 e7aeeb848689a693d123f71a26c6672b
BLAKE2b-256 bbe14be97441c4cb0a51ccfc111d3277b8ff9fa16f8a9d11c447b849c424af2c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page