Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
- move non-root user creation in examples dockerfiles
- move jupyter from base dockerfile to ior example dockerfile
- simplify ior example notebook
  • Loading branch information
JCapul committed Mar 22, 2019
1 parent ae0414a commit 55eb7aa
Show file tree
Hide file tree
Showing 6 changed files with 222 additions and 334 deletions.
19 changes: 0 additions & 19 deletions examples/base_dockerfile/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ RUN yum -y update && yum -y install \
automake \
make \
strace \
zlib-devel \
git \
python-devel; \
yum clean all

# Go language
Expand All @@ -36,23 +34,6 @@ RUN mkdir -p /tmp/src/redis && \

RUN rm -rf /tmp/src

RUN wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' && \
python get-pip.py && \
python -m pip install jupyter matplotlib pandas

EXPOSE 8888

# Switch to non-root user
# replace UID and GID with yours to access your files through a mounted volume
RUN groupadd --gid 1010 rebels && \
useradd --uid 1010 --gid rebels luke

USER luke
ENV HOME /home/luke
WORKDIR ${HOME}

COPY --chown=luke:rebels jupyter_notebook_config.py ${HOME}/.jupyter/

CMD bash


Expand Down
28 changes: 16 additions & 12 deletions examples/hydroC_ParaView/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,37 @@ RUN wget -O ffmpeg.tar.xz 'https://johnvansickle.com/ffmpeg/releases/ffmpeg-rele
rm ffmpeg.tar.xz


# Clone and build Hydro simulation code and pdwfs in user space
# Switch to non-root user
# replace UID and GID with yours to access your files through a mounted volume
RUN groupadd --gid 1010 rebels && \
useradd --uid 1010 --gid rebels luke

USER luke
ENV HOME /home/luke
WORKDIR ${HOME}
RUN mkdir -p ${HOME}/run ${HOME}/src


RUN mkdir -p ${HOME}/src && cd ${HOME}/src && \
git clone 'https://github.com/JCapul/Hydro' && \
# Clone and build Hydro simulation code and pdwfs in user space

RUN cd src && git clone 'https://github.com/JCapul/Hydro' && \
make -C Hydro/HydroC/HydroC99_2DMpi/Src && \
install Hydro/HydroC/HydroC99_2DMpi/Src/hydro -D ${HOME}/opt/hydro/bin/hydro

ENV PATH "${HOME}/opt/hydro/bin:$PATH"

RUN cd ${HOME}/src && \
git clone 'https://github.com/cea-hpc/pdwfs' && \
RUN cd src && git clone 'https://github.com/cea-hpc/pdwfs' && \
make -C pdwfs PREFIX=${HOME}/opt/pdwfs install

ENV PATH "${HOME}/opt/pdwfs/bin:$PATH"
ENV PATH "${HOME}/opt/pdwfs/bin:${PATH}"

# uncomment to use pdwfs from a volume mounted on the pdwfs source directory on the host (for debug/development)
# (a modification is needed in the Makefile as well)
#ENV PATH "/pdwfs/build/bin:$PATH"
# uncomment to build pdwfs from a volume mounted on the pdwfs source directory on the host (for debug/development)
# (a modification is needed in the Makefile as well)
#ENV PATH "/pdwfs/build/bin:${PATH}"

COPY banner.sh /tmp/
RUN cat /tmp/banner.sh >> ${HOME}/.bashrc

RUN mkdir -p ${HOME}/run
WORKDIR ${HOME}/run

COPY --chown=luke:rebels paraview_run.py .
COPY --chown=luke:rebels process_all.py .
COPY --chown=luke:rebels hydro_input.nml .
Expand Down
40 changes: 27 additions & 13 deletions examples/ior_benchmark/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
FROM pdwfs-base

USER root
RUN yum -y update && yum -y install \
python-devel \
zlib-devel; \
yum clean all

# Download, build HDF5 and IOR, install in /usr/local

Expand All @@ -16,27 +19,38 @@ RUN git clone 'https://github.com/hpc/ior' && \
cd .. && rm -rf ior/


# Jupyter, matplotlib and pandas
RUN wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' && \
python get-pip.py && \
python -m pip install jupyter matplotlib pandas

EXPOSE 8888


# Switch to non-root user
# replace UID and GID with yours to access your files through a mounted volume
RUN groupadd --gid 1010 rebels && \
useradd --uid 1010 --gid rebels luke

USER luke
ENV HOME /home/luke
WORKDIR ${HOME}
RUN mkdir -p ${HOME}/run

# Clone, build and install pdwfs in user space
RUN git clone 'https://github.com/cea-hpc/pdwfs' && \
cd pdwfs && make PREFIX=${HOME}/opt/pdwfs install

RUN mkdir -p ${HOME}/src && cd ${HOME}/src && \
git clone 'https://github.com/cea-hpc/pdwfs' && \
cd pdwfs && git checkout develop && \
make PREFIX=${HOME}/opt/pdwfs install
ENV PATH "${HOME}/opt/pdwfs:${PATH}"

ENV PATH "${HOME}/opt/pdwfs/bin:$PATH"
# uncomment to build pdwfs from a volume mounted on the pdwfs source directory on the host (for debug/development)
# (a modification is needed in the Makefile as well)
#ENV PATH "/pdwfs/build/bin:${PATH}"

# uncomment to use pdwfs from a volume mounted on the pdwfs source directory on the host (for debug/development)
# (a modification is needed in the Makefile as well)
ENV PATH "/pdwfs/build/bin:$PATH"

COPY banner.sh /tmp/
RUN cat /tmp/banner.sh >> ${HOME}/.bashrc

RUN mkdir -p ${HOME}/run
WORKDIR ${HOME}

COPY --chown=luke:rebels jupyter_notebook_config.py ${HOME}/.jupyter/
COPY --chown=luke:rebels notebook/ior_example.ipynb .
COPY --chown=luke:rebels notebook/ior_script.jinja2 .

Expand Down
Loading

0 comments on commit 55eb7aa

Please sign in to comment.