Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ENTRYPOINT and tini to support Dask KubeCluster #29

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ RUN yum install -y \
graphviz && \
yum clean all

# Add Tini
ENV TINI_VERSION=v0.19.0
ADD --chown=atlas https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini

COPY --chown=atlas docker/requirements.txt /docker/
COPY --chown=atlas docker/requirements.lock /docker/
COPY --chown=atlas analysis /analysis
WORKDIR /analysis

COPY --chown=atlas /docker/entrypoint.sh /entrypoint.sh
COPY --chown=atlas /docker/cmd.sh /cmd.sh

RUN echo -e '\n# Activate python virtual environment\nif [ -d /venv/bin ]; then\n . /venv/bin/activate\nfi' >> /release_setup.sh && \
Expand All @@ -33,7 +38,10 @@ RUN echo -e '\n# Activate python virtual environment\nif [ -d /venv/bin ]; then\
python -m pip list && \
root --version

RUN chmod +x /release_setup.sh
RUN chmod +x /tini && \
chmod +x /entrypoint.sh && \
chmod +x /cmd.sh && \
chmod +x /release_setup.sh

# Need to use an additonal directory beyond /usr/AnalysisBase to install
# given how ATLAS CMake works.
Expand Down Expand Up @@ -76,4 +84,6 @@ RUN echo -e '\n# Activate AnalysisBase environment on login shell\n. /release_se
# $(jupyter --config) should be /home/atlas/.jupyter/
COPY --chown=atlas docker/jupyter_lab_config.py /home/atlas/.jupyter/

ENTRYPOINT ["/tini", "-g", "--", "/entrypoint.sh"]

CMD [ "/cmd.sh" ]
2 changes: 0 additions & 2 deletions docker/cmd.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash

. /release_setup.sh

jupyter lab --no-browser --ip 0.0.0.0 --port 8888
6 changes: 6 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

. /release_setup.sh

# Run extra commands
exec "$@"