-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
127 lines (105 loc) · 3.85 KB
/
Dockerfile
File metadata and controls
127 lines (105 loc) · 3.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
FROM hpchud/vcc-base-centos:7
# install packages required
RUN yum -y install make libtool openssl-devel libxml2-devel boost-devel gcc gcc-c++ git nano openssh-server openssh-clients gcc-gfortran
# build and install torque 5 in one step
WORKDIR /
RUN git clone https://github.com/adaptivecomputing/torque.git -b 5.1.1.2 torque-src \
&& cd torque-src \
&& ./autogen.sh \
&& ./configure --prefix=/usr --disable-posixmemlock --disable-cpuset \
&& make \
&& make install \
&& ldconfig \
&& cd .. \
&& cp torque-src/torque.setup . \
&& rm -r torque-src
# torque config
# we don't have interaction so need to fix setup script
RUN sed -i 's/-t create/-t create -f/' torque.setup \
&& ./torque.setup root localhost \
&& qmgr -c "set server auto_node_np=true" \
&& rm torque.setup
# build and install pdsh
RUN cd /tmp \
&& git clone https://github.com/grondo/pdsh.git pdsh-build \
&& cd pdsh-build \
&& git checkout -q e1c8e71dd6a26b40cd067a8322bd14e10e4f7ded \
&& ./configure --with-ssh --without-rsh --prefix=/usr --with-machines=/etc/vcc/pdsh_machines \
&& make \
&& make install \
&& cd / \
&& rm -rf /tmp/pdsh-build
# build and install MAUI
RUN cd /tmp \
&& git clone https://github.com/jbarber/maui.git maui-build \
&& cd maui-build \
&& git checkout -q 7a8513a1317afd57afab6f800d0c15f124d6083f \
&& ./configure --with-pbs \
&& make \
&& make install \
&& cd / \
&& rm -rf /tmp/maui-build
COPY maui-config.sh /etc/vcc/maui-config.sh
# build and install mpich
RUN cd /tmp \
&& curl -O https://www.mirrorservice.org/sites/distfiles.macports.org/mpich/mpich-3.2.tar.gz \
&& tar xf mpich-*.tar.gz \
&& cd mpich-* \
&& ./configure \
&& make \
&& make install \
&& cd / \
&& rm -rf /tmp/mpich-*
# make links for maui tools
RUN ln -s /usr/local/maui/bin/showq /usr/bin/showq
RUN ln -s /usr/local/maui/bin/showbf /usr/bin/showbf
RUN ln -s /usr/local/maui/bin/showres /usr/bin/showres
RUN ln -s /usr/local/maui/bin/checkjob /usr/bin/checkjob
# install vcc configuration files
COPY init.yml /etc/init.yml
COPY services.yml /etc/services.yml
COPY services-headnode.yml /etc/vcc/services-headnode.yml
COPY services-workernode.yml /etc/vcc/services-workernode.yml
COPY dependencies.yml /etc/vcc/dependencies.yml
# cluster hook scripts
ADD hooks/pbsnodes.sh /etc/vcc/cluster-hooks.d/pbsnodes.sh
ADD hooks/pdsh.sh /etc/vcc/cluster-hooks.d/pdsh.sh
RUN chmod +x /etc/vcc/cluster-hooks.d/*
# service hook scripts
ADD hooks/headnode.sh /etc/vcc/service-hooks.d/headnode.sh
RUN chmod +x /etc/vcc/service-hooks.d/*
# set up SSH config
ADD sshd_config /etc/ssh/sshd_config
RUN echo -e "\tPort 2222" >> /etc/ssh/ssh_config
RUN echo -e "\tStrictHostKeyChecking no" >> /etc/ssh/ssh_config
RUN echo -e "\tUserKnownHostsFile /dev/null" >> /etc/ssh/ssh_config
# add the batchuser user
RUN useradd --create-home --uid 900 --shell /bin/bash batchuser
RUN echo batchuser:batchuser | chpasswd
# add the SSH key for batchuser
RUN mkdir -p /home/batchuser/.ssh
ADD batchuser.id_rsa /home/batchuser/.ssh/id_rsa
ADD batchuser.id_rsa.pub /home/batchuser/.ssh/id_rsa.pub
RUN cat /home/batchuser/.ssh/id_rsa.pub > /home/batchuser/.ssh/authorized_keys
RUN cat /home/batchuser/.ssh/id_rsa.pub > /home/batchuser/.ssh/authorized_keys2
# add example MPI job
ADD hello.job /home/batchuser/hello.job
# fix permissions for batchuser
RUN chmod 700 /home/batchuser/.ssh
RUN chmod 600 /home/batchuser/.ssh/*
RUN chown -R batchuser:batchuser /home/batchuser/.ssh
# set up sshfs
RUN yum -y makecache fast
RUN yum -y install epel-release
RUN yum -y install sshfs
# add the SSH key for root
RUN mkdir -p /root/.ssh
ADD root.id_rsa /root/.ssh/id_rsa
ADD root.id_rsa.pub /root/.ssh/id_rsa.pub
RUN cat /root/.ssh/id_rsa.pub > /root/.ssh/authorized_keys
RUN cat /root/.ssh/id_rsa.pub > /root/.ssh/authorized_keys2
RUN chmod 700 /root/.ssh
RUN chmod 600 /root/.ssh/*
# set up /cluster shared folder
RUN mkdir /cluster
ADD test.sh /root/test.sh