|
| 1 | +FROM ubuntu:18.04 as conda |
| 2 | +RUN apt-get update && apt-get install -y build-essential wget && apt-get clean && rm -rf /var/lib/apt/lists/* |
| 3 | +ENV CONDA_DIR /opt/conda |
| 4 | +ENV PATH=$CONDA_DIR/bin:$PATH |
| 5 | +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && /bin/bash ~/miniconda.sh -b -p /opt/conda |
| 6 | +RUN conda init bash |
| 7 | + |
| 8 | +FROM conda as builder |
| 9 | +RUN apt-get update && apt-get install -y git |
| 10 | +WORKDIR /Downloads |
| 11 | +RUN git clone https://github.com/CODARcode/PerformanceAnalysis.git && rm -rf PerformanceAnalysis/spack/repo/chimbuko/packages/binutils |
| 12 | +RUN git clone https://github.com/mochi-hpc/mochi-spack-packages.git |
| 13 | +WORKDIR / |
| 14 | +RUN git clone https://github.com/spack/spack.git |
| 15 | +WORKDIR /Downloads |
| 16 | +RUN . /spack/share/spack/setup-env.sh && spack repo add PerformanceAnalysis/spack/repo/chimbuko && spack repo add mochi-spack-packages |
| 17 | +WORKDIR /opt/spack-environment |
| 18 | +RUN echo 'invalidate 8' |
| 19 | +COPY provdb_python_spack_env /opt/spack-environment/spack.yaml |
| 20 | +RUN . /spack/share/spack/setup-env.sh && spack env activate . && spack install --fail-fast && spack gc -y |
| 21 | + |
| 22 | +RUN apt-get update && apt-get install -y file && find -L /opt/view/* -type f -exec readlink -f '{}' \; | \ |
| 23 | + xargs file -i | \ |
| 24 | + grep 'charset=binary' | \ |
| 25 | + grep 'x-executable\|x-archive\|x-sharedlib' | \ |
| 26 | + awk -F: '{print $1}' | xargs strip -s |
| 27 | + |
| 28 | +RUN cd /opt/spack-environment && \ |
| 29 | + . /spack/share/spack/setup-env.sh && spack env activate --sh -d . >> /etc/profile.d/z10_spack_environment.sh |
| 30 | + |
| 31 | +FROM conda |
| 32 | +COPY --from=builder /opt/spack-environment /opt/spack-environment |
| 33 | +COPY --from=builder /opt/software /opt/software |
| 34 | +COPY --from=builder /opt/view /opt/view |
| 35 | +COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/profile.d/z10_spack_environment.sh |
| 36 | + |
| 37 | +RUN pip3 install jupyter |
| 38 | +WORKDIR /jupyter |
| 39 | +RUN echo '#!/bin/bash\njupyter notebook --no-browser --port=$1 --allow-root --ip=0.0.0.0' > run_notebook.sh && chmod u+x run_notebook.sh |
| 40 | +COPY jupyter_example.ipynb /jupyter/ |
| 41 | + |
| 42 | +ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l"] |
0 commit comments