-
-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
495dc9b
commit 0cae4ec
Showing
9 changed files
with
249 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
|
||
function jobqueue_before_install { | ||
docker version | ||
docker-compose version | ||
|
||
# start slurm cluster | ||
cd ./ci/slurm | ||
./start-slurm.sh | ||
cd - | ||
|
||
docker ps -a | ||
docker images | ||
} | ||
|
||
function jobqueue_install { | ||
docker exec -it slurmctld /bin/bash -c "cd /dask-jobqueue; python setup.py install" | ||
} | ||
|
||
function jobqueue_script { | ||
docker exec -it slurmctld /bin/bash -c "cd /dask-jobqueue; py.test dask_jobqueue --verbose -E slurm" | ||
} | ||
|
||
function jobqueue_after_script { | ||
docker exec -it slurmctld bash -c 'sinfo' | ||
docker exec -it slurmctld bash -c 'squeue' | ||
docker exec -it slurmctld bash -c 'sacct -l' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM giovtorres/slurm-docker-cluster | ||
|
||
RUN curl -o miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ | ||
bash miniconda.sh -f -b -p /opt/anaconda && \ | ||
/opt/anaconda/bin/conda clean -tipy && \ | ||
rm -f miniconda.sh | ||
ENV PATH /opt/anaconda/bin:$PATH | ||
RUN conda install --yes -c conda-forge python=3.6 dask distributed flake8 pytest docrep | ||
|
||
ENV LC_ALL en_US.UTF-8 | ||
|
||
COPY slurm.conf /etc/slurm/slurm.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
version: "2.2" | ||
|
||
services: | ||
mysql: | ||
image: mysql:5.7 | ||
hostname: mysql | ||
container_name: mysql | ||
environment: | ||
MYSQL_RANDOM_ROOT_PASSWORD: "yes" | ||
MYSQL_DATABASE: slurm_acct_db | ||
MYSQL_USER: slurm | ||
MYSQL_PASSWORD: password | ||
volumes: | ||
- var_lib_mysql:/var/lib/mysql | ||
|
||
slurmdbd: | ||
build: . | ||
command: ["slurmdbd"] | ||
container_name: slurmdbd | ||
hostname: slurmdbd | ||
volumes: | ||
- etc_munge:/etc/munge | ||
- etc_slurm:/etc/slurm | ||
- var_log_slurm:/var/log/slurm | ||
expose: | ||
- "6819" | ||
depends_on: | ||
- mysql | ||
|
||
slurmctld: | ||
build: . | ||
command: ["slurmctld"] | ||
container_name: slurmctld | ||
hostname: slurmctld | ||
volumes: | ||
- etc_munge:/etc/munge | ||
- etc_slurm:/etc/slurm | ||
- slurm_jobdir:/data | ||
- var_log_slurm:/var/log/slurm | ||
- ../..:/dask-jobqueue | ||
expose: | ||
- "6817" | ||
depends_on: | ||
- "slurmdbd" | ||
|
||
c1: | ||
build: . | ||
command: ["slurmd"] | ||
hostname: c1 | ||
container_name: c1 | ||
volumes: | ||
- etc_munge:/etc/munge | ||
- etc_slurm:/etc/slurm | ||
- slurm_jobdir:/data | ||
- var_log_slurm:/var/log/slurm | ||
expose: | ||
- "6818" | ||
depends_on: | ||
- "slurmctld" | ||
|
||
c2: | ||
build: . | ||
command: ["slurmd"] | ||
hostname: c2 | ||
container_name: c2 | ||
volumes: | ||
- etc_munge:/etc/munge | ||
- etc_slurm:/etc/slurm | ||
- slurm_jobdir:/data | ||
- var_log_slurm:/var/log/slurm | ||
expose: | ||
- "6818" | ||
depends_on: | ||
- "slurmctld" | ||
|
||
volumes: | ||
etc_munge: | ||
etc_slurm: | ||
slurm_jobdir: | ||
var_lib_mysql: | ||
var_log_slurm: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
docker exec slurmctld bash -c "/usr/bin/sacctmgr --immediate add cluster name=linux" && \ | ||
docker-compose restart slurmdbd slurmctld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# slurm.conf | ||
# | ||
# See the slurm.conf man page for more information. | ||
# | ||
ClusterName=linux | ||
ControlMachine=slurmctld | ||
ControlAddr=slurmctld | ||
#BackupController= | ||
#BackupAddr= | ||
# | ||
SlurmUser=slurm | ||
#SlurmdUser=root | ||
SlurmctldPort=6817 | ||
SlurmdPort=6818 | ||
AuthType=auth/munge | ||
#JobCredentialPrivateKey= | ||
#JobCredentialPublicCertificate= | ||
StateSaveLocation=/var/lib/slurmd | ||
SlurmdSpoolDir=/var/spool/slurmd | ||
SwitchType=switch/none | ||
MpiDefault=none | ||
SlurmctldPidFile=/var/run/slurmd/slurmctld.pid | ||
SlurmdPidFile=/var/run/slurmd/slurmd.pid | ||
ProctrackType=proctrack/linuxproc | ||
#PluginDir= | ||
CacheGroups=0 | ||
#FirstJobId= | ||
ReturnToService=0 | ||
#MaxJobCount= | ||
#PlugStackConfig= | ||
#PropagatePrioProcess= | ||
#PropagateResourceLimits= | ||
#PropagateResourceLimitsExcept= | ||
#Prolog= | ||
#Epilog= | ||
#SrunProlog= | ||
#SrunEpilog= | ||
#TaskProlog= | ||
#TaskEpilog= | ||
#TaskPlugin= | ||
#TrackWCKey=no | ||
#TreeWidth=50 | ||
#TmpFS= | ||
#UsePAM= | ||
# | ||
# TIMERS | ||
SlurmctldTimeout=300 | ||
SlurmdTimeout=300 | ||
InactiveLimit=0 | ||
MinJobAge=300 | ||
KillWait=30 | ||
Waittime=0 | ||
# | ||
# SCHEDULING | ||
SchedulerType=sched/backfill | ||
#SchedulerAuth= | ||
#SchedulerPort= | ||
#SchedulerRootFilter= | ||
SelectType=select/cons_res | ||
SelectTypeParameters=CR_CPU_Memory | ||
FastSchedule=1 | ||
#PriorityType=priority/multifactor | ||
#PriorityDecayHalfLife=14-0 | ||
#PriorityUsageResetPeriod=14-0 | ||
#PriorityWeightFairshare=100000 | ||
#PriorityWeightAge=1000 | ||
#PriorityWeightPartition=10000 | ||
#PriorityWeightJobSize=1000 | ||
#PriorityMaxAge=1-0 | ||
# | ||
# LOGGING | ||
SlurmctldDebug=3 | ||
SlurmctldLogFile=/var/log/slurm/slurmctld.log | ||
SlurmdDebug=3 | ||
SlurmdLogFile=/var/log/slurm/slurmd.log | ||
JobCompType=jobcomp/filetxt | ||
JobCompLoc=/var/log/slurm/jobcomp.log | ||
# | ||
# ACCOUNTING | ||
JobAcctGatherType=jobacct_gather/linux | ||
JobAcctGatherFrequency=30 | ||
# | ||
AccountingStorageType=accounting_storage/slurmdbd | ||
AccountingStorageHost=slurmdbd | ||
AccountingStoragePort=6819 | ||
AccountingStorageLoc=slurm_acct_db | ||
#AccountingStoragePass= | ||
#AccountingStorageUser= | ||
# | ||
# COMPUTE NODES | ||
NodeName=c[1-2] RealMemory=4096 CPUs=2 State=UNKNOWN | ||
# | ||
# PARTITIONS | ||
PartitionName=normal Default=yes Nodes=c[1-2] Priority=50 DefMemPerCPU=2048 Shared=NO MaxNodes=2 MaxTime=5-00:00:00 DefaultTime=5-00:00:00 State=UP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
docker-compose up --build -d | ||
while [ `./register_cluster.sh | grep "sacctmgr: error" | wc -l` -ne 0 ] | ||
do | ||
echo "Waiting for SLURM cluster to become ready"; | ||
sleep 2 | ||
done | ||
echo "SLURM properly configured" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters