Skip to main content
Soperator clusters allow you to use Docker Engine to run jobs in containers.

Limitations

When using Docker Engine with Slurm, consider the following limitations:
  • Docker Engine doesn’t respect Slurm resource allocations. Docker may use all resources of a node, regardless of the settings that you specify in sbatch. We recommend using Enroot or other supported container runtimes to run Docker containers. If you want to use Docker Engine, use the -N and --exclusive settings to allocate entire nodes to Slurm jobs.
  • Docker containers aren’t managed as part of the Slurm job lifecycle. If a job is canceled, fails or times out, containers started with srun docker run continue running. Stop them manually or adjust your job script to stop the containers when the job receives the SIGTERM or SIGKILL signals.
  • Performance may be degraded without local disks. If no local disk is available, Docker uses the VFS storage driver, which leads to significantly lower performance.

How to run a Docker container in a Slurm job

  1. Connect to a login node of your Soperator cluster.
  2. Create a batch script that runs your workload in a container. For example, create the test_nccl.sh script with the following contents:
    This script pulls a Docker image with Ubuntu and CUDA® toolkit from NVIDIA®, then installs NVIDIA Collective Communications Library (NCCL) tests and their dependencies, and runs NCCL tests in a Docker container. The script uses the following parameters:
    • #SBATCH -N specifies how many nodes to allocate.
    • #SBATCH --exclusive specifies that no other jobs may be scheduled on these nodes until this job is completed.
    • --device=/dev/infiniband parameter for docker allows access to InfiniBand™ from inside Docker containers.
    If your workload needs access to the shared filesystem, you can add the -v parameter to make paths from the shared filesystem visible from inside the container:
  3. Start the job:
    The output contains the job ID:
  4. When the job is completed, review the contents of output.log. The output contains the logs of the container starting up and installing dependencies, followed by the results of NCCL tests. For example:

How to run a Docker container in an interactive mode

  1. Connect to a login node of your Soperator cluster.
  2. To run an interactive session on a node and prevent any other allocations on this node, use salloc:
    This command allocates a worker node to a new job and opens a terminal on this node. Output example:
  3. Start a Docker container on a worker node:
    The --rm parameter ensures that the container is automatically deleted when it exits. If your workload needs access to the shared filesystem, use the -v parameter to make paths from the shared filesystem visible from inside the container:
    For multi-node GPU workloads, use the --device=/dev/infiniband parameter for docker that allows access to InfiniBand from inside Docker containers.
  4. After you finish the interactive session and exit, you can see the confirmation that the node is no longer allocated:

How to get information about your Docker containers

To list all containers, including the ones that are already finished, connect to a worker node and run the following command:
For more details on Docker commands and parameters, see the Docker documentation.
InfiniBand and InfiniBand Trade Association are registered trademarks of the InfiniBand Trade Association.