sbatch submission, container lifecycle management through Pyxis and enroot, and multi-node coordination.
This guide is for SUNK users who want a simpler workflow to submit and manage GPU workloads than to write sbatch scripts by hand. It covers how to install SkyPilot, run containerized GPU workloads, use SkyPilot for interactive development as an alternative to salloc, and manage jobs on your SUNK cluster.
Consider using SkyPilot on SUNK if any of the following apply:
-
You want a simpler interface to submit GPU workloads without writing
sbatchscripts directly. - You need to run containerized workloads across multiple nodes and want SkyPilot to handle the distributed setup.
-
You want an
salloc-like interactive development workflow with persistent sessions you can SSH into.
Prerequisites
Before you complete the steps in this guide, be sure you have the following:- A SUNK cluster running SUNK v7.x or later with enroot 4.0.1 or later and Pyxis v0.21.0 or later.
- SSH access to your Slurm login node.
- Familiarity with Slurm commands, such as
srun,sbatch, andsqueue. - Python 3.8 or later installed locally.
Install SkyPilot
Install SkyPilot locally so you can submit jobs to your SUNK cluster from your workstation. The Slurm plugin lets SkyPilot translate your YAML workload definitions intosbatch submissions.
Configure SkyPilot for your SUNK cluster
To point SkyPilot at your SUNK cluster, complete the following steps:-
Create the SkyPilot Slurm SSH configuration file:
-
Add your SUNK login node to
~/.slurm/config:Replace the placeholders with the following values:[CLUSTER-NAME]: A name for your cluster, for examplemy-sunk-cluster.[LOGIN-NODE-IP]: Your login node’s external IP address. To find it, runkubectl get svc slurm-login -n tenant-slurm.[USERNAME]: Your Slurm username.
-
Start the SkyPilot API server and verify your configuration:
You should see output similar to the following:
Containerized workloads
SkyPilot uses theimage_id field in your YAML to specify a container image. Internally, this translates to Pyxis --container-image and --container-name flags on the sbatch and srun commands. You don’t interact with Pyxis or enroot directly.
Run a single-node GPU task
Create a YAML file that specifies your resources and container image:[GPU-TYPE]: The GPU type available on your cluster, for exampleH100orB200.[GPU-COUNT]: The number of GPUs to request.
Launch the task:
sbatch job to your SUNK cluster, pulls and initializes the container image on the allocated node, runs the run commands inside the container, and streams logs back to your terminal.
The first launch with a given container image takes several minutes while SkyPilot pulls and caches the image. Subsequent launches reuse the cached image and start faster.
Use a setup block for dependencies
If your workload needs additional packages, use thesetup field. Setup runs once when the cluster is first provisioned, before run:
Interactive development
SkyPilot can work as an alternative tosalloc for interactive GPU development. Instead of holding a terminal session open, SkyPilot provisions a persistent Slurm allocation that you can connect to over SSH and submit commands to on demand.
Internally, SkyPilot submits an sbatch job with sleep infinity as the main process, which keeps the allocation alive indefinitely. SSH and sky exec then attach to that running job through srun --overlap. The allocation stays up until you explicitly tear it down with sky down.
Create a resource YAML
Create a YAML file that specifies resources but norun command:
The
image_id field is optional. Without it, you get a bare-metal session on the compute node. With it, you get an interactive container that has your chosen ML framework pre-installed.Launch the cluster and connect
To launch your interactive session and attach to it, complete the following steps:-
Launch the cluster:
Replace
[CLUSTER-NAME]with a name for your interactive session, for exampledev. -
Use SSH to log in to the running allocation:
This connects through the Slurm compute node and opens a shell in the container if you specified
image_id. You can then run commands interactively, as you would inside ansallocsession: -
Optional: Submit batch tasks to the running allocation with
sky exec, similar to runningsrunwithin an existingsalloc: -
When you’re done, release the Slurm allocation:
Manage jobs
After you have one or more SkyPilot clusters running on SUNK, use the following commands to inspect their state, stream logs, and release resources when you’re finished. In SkyPilot, a “cluster” refers to the named Slurm allocation that SkyPilot manages on your behalf. Use the cluster name you defined withsky launch -c [CLUSTER-NAME] in the following commands:
Known limitations
SkyPilot on SUNK has the following known limitations:-
Managed jobs require consolidation mode.
sky jobs launchdoesn’t work with the default local API server because it requires a separate long-running controller process to monitor managed jobs. To enable managed jobs, turn on consolidation mode, which runs the jobs controller within the API server. Consolidation mode is enabled by default on remote API servers deployed with--deploy. For a local API server, you must enable it manually in~/.sky/config.yaml:After you update the configuration, restart the API server for the change to take effect. -
Autostop isn’t supported. Clusters remain active until you explicitly tear them down with
sky down. Remember to release allocations when they’re no longer needed to avoid wasting resources. -
sky execrequires explicit GPU requests for GPU visibility. When you run tasks withsky execon container-based clusters, GPUs may not be visible unless you specify the--gpusflag. For example,sky exec -c [CLUSTER-NAME] --gpus [GPU-TYPE]:[GPU-COUNT] -- nvidia-smi -L. For interactive GPU work, you can also usessh [CLUSTER-NAME]to connect directly to the running allocation. - SSH requires SUNK v7.x or later. On SUNK v6.x, SSH to running jobs doesn’t work due to Dropbear and enroot compatibility issues.
- Container support requires SUNK v7.x or later. Earlier versions that use enroot 3.5.0 have a bug that prevents Pyxis from finding running containers. This is fixed in enroot 4.0.1 (shipped with SUNK v7.x).