Skip to content

Commit a89872e

Browse files
committed
start of work to add demo containers
Signed-off-by: vsoch <[email protected]>
1 parent 8b66554 commit a89872e

File tree

5 files changed

+322
-0
lines changed

5 files changed

+322
-0
lines changed

docker/Dockerfile

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
FROM centos:7
2+
3+
# docker build -t vanessa/slurm:18.08.6 .
4+
5+
LABEL org.label-schema.vcs-url="https://github.com/vsoch/ood-compose" \
6+
org.label-schema.docker.cmd="docker-compose up -d" \
7+
org.label-schema.name="ood-composer" \
8+
org.label-schema.description="Open On Demand with SLURM on Centos 7" \
9+
maintainer="Vanessa Sochat"
10+
11+
ARG SLURM_TAG=slurm-18-08-6-2
12+
ARG GOSU_VERSION=1.11
13+
14+
RUN set -ex \
15+
&& yum makecache fast \
16+
&& yum -y update \
17+
&& yum -y install epel-release \
18+
&& yum -y install \
19+
wget \
20+
bzip2 \
21+
perl \
22+
gcc \
23+
gcc-c++\
24+
git \
25+
gnupg \
26+
make \
27+
munge \
28+
munge-devel \
29+
python-devel \
30+
python-pip \
31+
python34 \
32+
python34-devel \
33+
python34-pip \
34+
mariadb-server \
35+
mariadb-devel \
36+
psmisc \
37+
bash-completion \
38+
vim-enhanced \
39+
&& yum clean all \
40+
&& rm -rf /var/cache/yum
41+
42+
RUN pip install Cython nose && pip3.4 install Cython nose
43+
44+
RUN set -ex \
45+
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-amd64" \
46+
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-amd64.asc" \
47+
&& export GNUPGHOME="$(mktemp -d)" \
48+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
49+
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
50+
&& rm -rf "${GNUPGHOME}" /usr/local/bin/gosu.asc \
51+
&& chmod +x /usr/local/bin/gosu \
52+
&& gosu nobody true
53+
54+
RUN set -x \
55+
&& git clone https://github.com/SchedMD/slurm.git \
56+
&& pushd slurm \
57+
&& git checkout tags/$SLURM_TAG \
58+
&& ./configure --enable-debug --prefix=/usr --sysconfdir=/etc/slurm \
59+
--with-mysql_config=/usr/bin --libdir=/usr/lib64 \
60+
&& make install \
61+
&& install -D -m644 etc/cgroup.conf.example /etc/slurm/cgroup.conf.example \
62+
&& install -D -m644 etc/slurm.conf.example /etc/slurm/slurm.conf.example \
63+
&& install -D -m644 etc/slurmdbd.conf.example /etc/slurm/slurmdbd.conf.example \
64+
&& install -D -m644 contribs/slurm_completion_help/slurm_completion.sh /etc/profile.d/slurm_completion.sh \
65+
&& popd \
66+
&& rm -rf slurm \
67+
&& groupadd -r --gid=995 slurm \
68+
&& useradd -r -g slurm --uid=995 slurm \
69+
&& mkdir /etc/sysconfig/slurm \
70+
/var/spool/slurmd \
71+
/var/run/slurmd \
72+
/var/run/slurmdbd \
73+
/var/lib/slurmd \
74+
/var/log/slurm \
75+
/data \
76+
&& touch /var/lib/slurmd/node_state \
77+
/var/lib/slurmd/front_end_state \
78+
/var/lib/slurmd/job_state \
79+
/var/lib/slurmd/resv_state \
80+
/var/lib/slurmd/trigger_state \
81+
/var/lib/slurmd/assoc_mgr_state \
82+
/var/lib/slurmd/assoc_usage \
83+
/var/lib/slurmd/qos_usage \
84+
/var/lib/slurmd/fed_mgr_state \
85+
&& chown -R slurm:slurm /var/*/slurm* \
86+
&& /sbin/create-munge-key
87+
88+
COPY slurm.conf /etc/slurm/slurm.conf
89+
COPY slurmdbd.conf /etc/slurm/slurmdbd.conf
90+
91+
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
92+
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
93+
94+
# Install Open On Demand, Singularity
95+
RUN yum install -y net-tools openssh-server openssh-clients singularity && \
96+
yum install -y epel-release centos-release-scl lsof sudo httpd24-mod_ssl httpd24-mod_ldap && \
97+
yum install -y https://yum.osc.edu/ondemand/latest/ondemand-release-web-latest-1-2.el7.noarch.rpm && \
98+
yum install --nogpgcheck -y ondemand && \
99+
mkdir -p /etc/ood/config/clusters.d && \
100+
mkdir -p /etc/ood/config/apps/shell
101+
102+
COPY ./ood_portal.yml /etc/ood/config/ood_portal.yml
103+
RUN /opt/ood/ood-portal-generator/sbin/update_ood_portal && \
104+
systemctl enable httpd24-httpd && \
105+
groupadd ood && \
106+
useradd --create-home --gid ood ood && \
107+
echo -n "ood" | passwd --stdin ood && \
108+
scl enable httpd24 -- htdbm -bc /opt/rh/httpd24/root/etc/httpd/.htpasswd.dbm ood ood
109+
110+
COPY launch-httpd /usr/local/bin/
111+
CMD ["/usr/local/bin/launch-httpd"]

docker/Dockerfile.node

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM vanessa/slurm:18.08.6
2+
3+
# This container will be built on docker-compose up -d

docker/docker-compose.yml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
version: "2.2"
2+
3+
services:
4+
mysql:
5+
image: mysql:5.7
6+
hostname: mysql
7+
container_name: mysql
8+
environment:
9+
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
10+
MYSQL_DATABASE: slurm_acct_db
11+
MYSQL_USER: slurm
12+
MYSQL_PASSWORD: password
13+
volumes:
14+
- var_lib_mysql:/var/lib/mysql
15+
16+
slurmdbd:
17+
image: vanessa/slurm:18.08.6
18+
command: "slurmdbd"
19+
container_name: slurmdbd
20+
hostname: slurmdbd
21+
volumes:
22+
- etc_munge:/etc/munge
23+
- etc_slurm:/etc/slurm
24+
- var_log_slurm:/var/log/slurm
25+
expose:
26+
- "6819"
27+
depends_on:
28+
- mysql
29+
30+
slurmctld:
31+
image: vanessa/slurm:18.08.6
32+
command: "slurmctld"
33+
container_name: slurmctld
34+
hostname: slurmctld
35+
volumes_from:
36+
- slurmdbd
37+
expose:
38+
- "6817"
39+
depends_on:
40+
- "slurmdbd"
41+
42+
c1:
43+
build:
44+
context: .
45+
dockerfile: Dockerfile.node
46+
command: "slurmd"
47+
privileged: true
48+
hostname: c1
49+
container_name: c1
50+
volumes_from:
51+
- slurmctld
52+
expose:
53+
- "6818"
54+
depends_on:
55+
- "slurmctld"
56+
57+
c2:
58+
build:
59+
context: .
60+
dockerfile: Dockerfile.node
61+
command: "slurmd"
62+
privileged: true
63+
hostname: c2
64+
container_name: c2
65+
volumes_from:
66+
- slurmctld
67+
expose:
68+
- "6818"
69+
depends_on:
70+
- "slurmctld"
71+
72+
volumes:
73+
etc_munge:
74+
etc_slurm:
75+
slurm_jobdir:
76+
var_lib_mysql:
77+
var_log_slurm:

docker/slurm.conf

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# slurm.conf
2+
#
3+
# See the slurm.conf man page for more information.
4+
#
5+
ClusterName=linux
6+
ControlMachine=slurmctld
7+
ControlAddr=slurmctld
8+
#BackupController=
9+
#BackupAddr=
10+
#
11+
SlurmUser=slurm
12+
#SlurmdUser=root
13+
SlurmctldPort=6817
14+
SlurmdPort=6818
15+
AuthType=auth/munge
16+
#JobCredentialPrivateKey=
17+
#JobCredentialPublicCertificate=
18+
StateSaveLocation=/var/lib/slurmd
19+
SlurmdSpoolDir=/var/spool/slurmd
20+
SwitchType=switch/none
21+
MpiDefault=none
22+
SlurmctldPidFile=/var/run/slurmd/slurmctld.pid
23+
SlurmdPidFile=/var/run/slurmd/slurmd.pid
24+
ProctrackType=proctrack/linuxproc
25+
#PluginDir=
26+
CacheGroups=0
27+
#FirstJobId=
28+
ReturnToService=0
29+
#MaxJobCount=
30+
#PlugStackConfig=
31+
#PropagatePrioProcess=
32+
#PropagateResourceLimits=
33+
#PropagateResourceLimitsExcept=
34+
#Prolog=
35+
#Epilog=
36+
#SrunProlog=
37+
#SrunEpilog=
38+
#TaskProlog=
39+
#TaskEpilog=
40+
#TaskPlugin=
41+
#TrackWCKey=no
42+
#TreeWidth=50
43+
#TmpFS=
44+
#UsePAM=
45+
#
46+
# TIMERS
47+
SlurmctldTimeout=300
48+
SlurmdTimeout=300
49+
InactiveLimit=0
50+
MinJobAge=300
51+
KillWait=30
52+
Waittime=0
53+
#
54+
# SCHEDULING
55+
SchedulerType=sched/backfill
56+
#SchedulerAuth=
57+
#SchedulerPort=
58+
#SchedulerRootFilter=
59+
SelectType=select/cons_res
60+
SelectTypeParameters=CR_CPU_Memory
61+
FastSchedule=1
62+
#PriorityType=priority/multifactor
63+
#PriorityDecayHalfLife=14-0
64+
#PriorityUsageResetPeriod=14-0
65+
#PriorityWeightFairshare=100000
66+
#PriorityWeightAge=1000
67+
#PriorityWeightPartition=10000
68+
#PriorityWeightJobSize=1000
69+
#PriorityMaxAge=1-0
70+
#
71+
# LOGGING
72+
SlurmctldDebug=3
73+
SlurmctldLogFile=/var/log/slurm/slurmctld.log
74+
SlurmdDebug=3
75+
SlurmdLogFile=/var/log/slurm/slurmd.log
76+
JobCompType=jobcomp/filetxt
77+
JobCompLoc=/var/log/slurm/jobcomp.log
78+
#
79+
# ACCOUNTING
80+
JobAcctGatherType=jobacct_gather/linux
81+
JobAcctGatherFrequency=30
82+
#
83+
AccountingStorageType=accounting_storage/slurmdbd
84+
AccountingStorageHost=slurmdbd
85+
AccountingStoragePort=6819
86+
AccountingStorageLoc=slurm_acct_db
87+
#AccountingStoragePass=
88+
#AccountingStorageUser=
89+
#
90+
# COMPUTE NODES
91+
NodeName=c[1-2] RealMemory=1000 State=UNKNOWN
92+
#
93+
# PARTITIONS
94+
PartitionName=normal Default=yes Nodes=c[1-2] Priority=50 DefMemPerCPU=500 Shared=NO MaxNodes=1 MaxTime=5-00:00:00 DefaultTime=5-00:00:00 State=UP

docker/slurmdbd.conf

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#
2+
# Example slurmdbd.conf file.
3+
#
4+
# See the slurmdbd.conf man page for more information.
5+
#
6+
# Archive info
7+
#ArchiveJobs=yes
8+
#ArchiveDir="/tmp"
9+
#ArchiveSteps=yes
10+
#ArchiveScript=
11+
#JobPurge=12
12+
#StepPurge=1
13+
#
14+
# Authentication info
15+
AuthType=auth/munge
16+
#AuthInfo=/var/run/munge/munge.socket.2
17+
#
18+
# slurmDBD info
19+
DbdAddr=slurmdbd
20+
DbdHost=slurmdbd
21+
#DbdPort=6819
22+
SlurmUser=slurm
23+
#MessageTimeout=300
24+
DebugLevel=4
25+
#DefaultQOS=normal,standby
26+
LogFile=/var/log/slurm/slurmdbd.log
27+
PidFile=/var/run/slurmdbd/slurmdbd.pid
28+
#PluginDir=/usr/lib/slurm
29+
#PrivateData=accounts,users,usage,jobs
30+
#TrackWCKey=yes
31+
#
32+
# Database info
33+
StorageType=accounting_storage/mysql
34+
StorageHost=mysql
35+
StorageUser=slurm
36+
StoragePass=password
37+
StorageLoc=slurm_acct_db

0 commit comments

Comments
 (0)