WIP: cobald container containing and using slurm
This commit is contained in:
68
roles/cobald/templates/cobald.Dockerfile
Normal file
68
roles/cobald/templates/cobald.Dockerfile
Normal file
@@ -0,0 +1,68 @@
|
||||
FROM {{ cobald_docker_base_image | default("docker.io/library/centos:7") }}
|
||||
|
||||
RUN yum update -y && \
|
||||
yum install -y python3 git && pip3 install --upgrade pip && \
|
||||
yum clean all && rm -rf /var/cache/yum
|
||||
|
||||
ARG REPOCOBALD=https://github.com/MatterMiners/cobald
|
||||
ARG REPOTARDIS=https://github.com/MatterMiners/tardis
|
||||
|
||||
RUN git clone $REPOCOBALD /usr/local/src/cobald && \
|
||||
git clone $REPOTARDIS /usr/local/src/tardis
|
||||
|
||||
RUN mkdir /etc/cobald /var/log/cobald && \
|
||||
useradd -m -d /var/lib/cobald --no-log-init --system cobald && \
|
||||
chown cobald:cobald /var/log/cobald
|
||||
|
||||
#RUN mkdir /cobald && python3 -m venv /cobald && source /cobald/bin/activate &&\
|
||||
# pip3 install --upgrade pip && pip3 install cobald
|
||||
|
||||
RUN mkdir /usr/local/src/cobaldmodules /usr/local/lib/cobaldmodules && \
|
||||
ln -s /usr/local/src/cobaldmodules/setup.py \
|
||||
/usr/local/lib/cobaldmodules/setup.py && \
|
||||
ln -s /usr/local/src/cobaldmodules/cobaldmodules \
|
||||
/usr/local/lib/cobaldmodules/cobaldmodules && \
|
||||
chown cobald:cobald /usr/local/lib/cobaldmodules
|
||||
|
||||
RUN pip3 install --editable /usr/local/src/cobald && \
|
||||
pip3 install --editable /usr/local/src/cobald[contrib]
|
||||
|
||||
RUN pip3 install --editable /usr/local/src/tardis&& \
|
||||
pip3 install --editable /usr/local/src/tardis[contrib]
|
||||
|
||||
ENV PYTHONPATH=/usr/local/src/cobaldmodules
|
||||
|
||||
# pip3 install --editable .
|
||||
# pip3 install --editable .[contrib]
|
||||
# pip3 install --upgrade --editable /etc/cobald/modules/
|
||||
# su cobald -c "python3 -m cobald.daemon /etc/cobald/config.yaml"
|
||||
|
||||
VOLUME /usr/local/src/cobaldmodules
|
||||
|
||||
VOLUME /etc/cobald
|
||||
|
||||
RUN mkdir -p /usr/local/lib/entrypoints.d/
|
||||
|
||||
COPY init-cobaldmodules.sh /usr/local/lib/entrypoints.d/50-init-cobaldmodules.sh
|
||||
|
||||
RUN chmod 755 /usr/local/lib/entrypoints.d/50-init-cobaldmodules.sh
|
||||
|
||||
RUN echo -e "#!/bin/sh\npython3 -m cobald.daemon /etc/cobald/config.yaml" >> /etc/docker-init.d/70-cobald && chmod 755 /etc/docker-init.d/70-cobald
|
||||
|
||||
{% if cobald_docker_default_command | default(True) -%}
|
||||
COPY cobald-entrypoint.sh /usr/local/sbin/cobald-entrypoint.sh
|
||||
|
||||
RUN chmod 755 /usr/local/sbin/cobald-entrypoint.sh
|
||||
|
||||
ENTRYPOINT [ "/usr/local/sbin/cobald-entrypoint.sh" ]
|
||||
|
||||
RUN yum -y install iproute &&\
|
||||
yum clean all && rm -rf /var/cache/yum
|
||||
|
||||
USER cobald
|
||||
|
||||
STOPSIGNAL SIGINT
|
||||
|
||||
# CMD "python3 -m cobald.daemon /etc/cobald/config.yaml"
|
||||
CMD /etc/docker-init.d/60-cobald
|
||||
{%- endif %}
|
Reference in New Issue
Block a user