{"id":19847542,"url":"https://github.com/giovtorres/docker-centos7-slurm","last_synced_at":"2025-05-01T21:32:41.333Z","repository":{"id":14235723,"uuid":"76145083","full_name":"giovtorres/docker-centos7-slurm","owner":"giovtorres","description":"Slurm Docker Container on CentOS 7","archived":false,"fork":false,"pushed_at":"2024-04-08T01:34:12.000Z","size":107,"stargazers_count":84,"open_issues_count":7,"forks_count":57,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-04-08T02:43:57.520Z","etag":null,"topics":["centos","centos7","docker","hpc","slurm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/giovtorres.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-12-11T00:15:55.000Z","updated_at":"2024-04-05T18:27:06.000Z","dependencies_parsed_at":"2022-09-22T13:03:28.819Z","dependency_job_id":"53fe6f14-0edd-4b6e-b3db-27552c2ba2ee","html_url":"https://github.com/giovtorres/docker-centos7-slurm","commit_stats":null,"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giovtorres%2Fdocker-centos7-slurm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giovtorres%2Fdocker-centos7-slurm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giovtorres%2Fdocker-centos7-slurm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giovtorres%2Fdocker-centos7-slurm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giovtorres","download_url":"https://codeload.github.com/giovtorres/docker-centos7-slurm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224278361,"owners_count":17285080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["centos","centos7","docker","hpc","slurm"],"created_at":"2024-11-12T13:14:31.255Z","updated_at":"2024-11-12T13:14:33.283Z","avatar_url":"https://github.com/giovtorres.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slurm on CentOS 7 Docker Image\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/giovtorres/docker-centos7-slurm.svg)](https://hub.docker.com/r/giovtorres/docker-centos7-slurm/)\n\nThis is an all-in-one [Slurm](https://slurm.schedmd.com/) installation.  This\ncontainer runs the following processes:\n\n* slurmd (The compute node daemon for Slurm)\n* slurmctld (The central management daemon of Slurm)\n* slurmdbd (Slurm database daemon)\n* slurmrestd (Slurm REST API daemon)\n* munged (Authentication service for creating and validating credentials)\n* mariadb (MySQL compatible database)\n* supervisord (A process control system)\n\nIt also has the following Python versions installed using\n[pyenv](https://github.com/pyenv/pyenv):\n\n* 3.6.15\n* 3.7.12\n* 3.8.12\n* 3.9.9\n* 3.10.0\n\n## Usage\n\nThere are multiple\n[tags](https://hub.docker.com/r/giovtorres/docker-centos7-slurm/tags/)\navailable.  To use the latest available image, run:\n\n```shell\ndocker pull giovtorres/docker-centos7-slurm:latest\ndocker run -it -h slurmctl --cap-add sys_admin giovtorres/docker-centos7-slurm:latest\n```\n\nThe above command will drop you into a bash shell inside the container. Tini\nis responsible for `init` and supervisord is the process control system . To\nview the status of all the processes, run:\n\n```shell\n[root@slurmctl /]# supervisorctl status\nmunged                           RUNNING   pid 23, uptime 0:02:35\nmysqld                           RUNNING   pid 24, uptime 0:02:35\nslurmctld                        RUNNING   pid 25, uptime 0:02:35\nslurmd                           RUNNING   pid 22, uptime 0:02:35\nslurmdbd                         RUNNING   pid 26, uptime 0:02:35\nslurmrestd                       RUNNING   pid 456, uptime 0:02:00\n```\n\nIn `slurm.conf`, the **ControlMachine** hostname is set to **slurmctl**. Since\nthis is an all-in-one installation, the hostname must match **ControlMachine**.\nTherefore, you must pass the `-h slurmctl` to docker at run time so that the\nhostnames match.\n\nYou can run the usual Slurm commands:\n\n```shell\n[root@slurmctl /]# sinfo\nPARTITION AVAIL  TIMELIMIT  NODES  STATE NODELIST\nnormal*      up 5-00:00:00      5   idle c[1-5]\ndebug        up 5-00:00:00      5   idle c[6-10]\n```\n\n```shell\n[root@slurmctl /]# scontrol show partition normal\nPartitionName=normal\n   AllowGroups=ALL AllowAccounts=ALL AllowQos=ALL\n   AllocNodes=ALL Default=YES QoS=N/A\n   DefaultTime=5-00:00:00 DisableRootJobs=NO ExclusiveUser=NO GraceTime=0 Hidden=NO\n   MaxNodes=1 MaxTime=5-00:00:00 MinNodes=1 LLN=NO MaxCPUsPerNode=UNLIMITED\n   Nodes=c[1-5]\n   PriorityJobFactor=50 PriorityTier=50 RootOnly=NO ReqResv=NO OverSubscribe=NO PreemptMode=OFF\n   State=UP TotalCPUs=5 TotalNodes=5 SelectTypeParameters=NONE\n   DefMemPerCPU=500 MaxMemPerNode=UNLIMITED\n```\n\n## Building\n\n### Using Existing Tags\n\nThere are multiple versions of Slurm available, each with its own tag.  To build\na specific version of Slurm, checkout the tag that matches that version and\nbuild the Dockerfile:\n\n```shell\ngit clone https://github.com/giovtorres/docker-centos7-slurm\ngit checkout \u003ctag\u003e\ndocker build -t docker-centos7-slurm .\n```\n\n### Using Build Args\n\nYou can use docker's `--build-arg` option to customize the version of Slurm\nand the version(s) of Python at build time.\n\nTo specify the version of Slurm, assign a valid Slurm tag to the `SLURM_TAG`\nbuild argument:\n\n```shell\ndocker build --build-arg SLURM_TAG=\"slurm-19-05-1-2\" -t docker-centos7-slurm:19.05.1-2\n```\n\nTo specify the version(s) of Python to include in the container, specify a\nspace-delimited string of Python versions using the `PYTHON_VERSIONS` build\nargument:\n\n```shell\ndocker build --build-arg PYTHON_VERSIONS=\"3.6 3.7\" -t docker-centos7-slurm:py3\n```\n\n## Using docker-compose\n\nThe included docker-compose file will run the cluster container in the\nbackground.  The docker-compose file uses data volumes to store the slurm state\nbetween container runs.  To start the cluster container, run:\n\n```shell\ndocker-compose up -d\n```\n\nTo execute commands in the container, use `docker exec`:\n\n```shell\ndocker exec dockercentos7slurm_slurm_1 sinfo\nPARTITION AVAIL  TIMELIMIT  NODES  STATE NODELIST\nnormal*      up 5-00:00:00      5   idle c[1-5]\ndebug        up 5-00:00:00      5   idle c[6-10]\n\ndocker exec dockercentos7slurm_slurm_1 sbatch --wrap=\"sleep 10\"\nSubmitted batch job 27\n\ndocker exec dockercentos7slurm_slurm_1 squeue\n            JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)\n            27    normal     wrap     root  R       0:07      1 c1\n```\n\nTo attach to the bash shell inside the running container, run:\n\n```shell\ndocker attach dockercentos7slurm_slurm_1\n```\n\nPress `Ctrl-p,Ctrl-q` to detach from the container without killing the bash\nprocess and stopping the container.\n\nTo stop the cluster container, run:\n\n```shell\ndocker-compose down\n```\n\n## Testing Locally\n\n[Testinfra](https://testinfra.readthedocs.io/en/latest/index.html) is used to\nbuild and run a Docker container test fixture. Run the tests with\n[pytest](https://docs.pytest.org/en/latest/):\n\n```shell\npytest -v\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiovtorres%2Fdocker-centos7-slurm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiovtorres%2Fdocker-centos7-slurm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiovtorres%2Fdocker-centos7-slurm/lists"}