Skip to content

Commit f1a7838

Browse files
committed
Added a Dockerfile to build a conda environment with py-mochi-sonata installed, giving users a clean python environment free from spack
1 parent e2fb4b0 commit f1a7838

File tree

4 files changed

+167
-0
lines changed

4 files changed

+167
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
FROM ubuntu:18.04 as base
2+
3+
SHELL ["/bin/bash", "-c"]
4+
5+
RUN mkdir -p /Downloads
6+
7+
ENV DEBIAN_FRONTEND=noninteractive
8+
RUN apt-get update && \
9+
apt-get install -y tzdata && \
10+
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \
11+
dpkg-reconfigure --frontend noninteractive tzdata && \
12+
apt-get install -y build-essential wget git-core libtool libtool-bin \
13+
python3 python3-dev \
14+
curl psmisc iproute2 gfortran libssl-dev locales && \
15+
apt autoremove -y && \
16+
rm -rf /var/lib/apt/lists/* && \
17+
locale-gen en_US.UTF-8 && dpkg-reconfigure locales
18+
19+
ENV LANG en_US.UTF-8
20+
ENV LANGUAGE en_US:en
21+
ENV LC_ALL en_US.UTF-8
22+
23+
from base as build
24+
25+
RUN mkdir /spack && cd /spack && git clone https://github.com/spack/spack.git -b v0.23.1 --single-branch
26+
27+
RUN mkdir /sds && cd /sds && git clone https://github.com/mochi-hpc/mochi-spack-packages.git && cd mochi-spack-packages && git checkout 29a196f299130ff8039bdfdc9b22715f7e6991dc
28+
29+
RUN mkdir -p /opt/spack-environment
30+
31+
RUN echo "RESET 3" >> /dev/null
32+
33+
COPY env.yaml /opt/spack-environment/spack.yaml
34+
35+
#apparently spack needs unzip!
36+
RUN apt-get update && apt-get install unzip
37+
RUN source /spack/spack/share/spack/setup-env.sh && cd /opt/spack-environment && spack env activate . && spack concretize -f && spack install && spack gc -y && spack clean -a
38+
COPY modules.yaml /root/.spack
39+
40+
41+
#install conda environment with py-mochi services
42+
RUN cd /opt/spack-environment/ && \
43+
source /spack/spack/share/spack/setup-env.sh && \
44+
spack env activate . && \
45+
spack load pkgconf && \
46+
cd /Downloads/ && \
47+
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
48+
chmod u+x Miniconda3-latest-Linux-x86_64.sh && \
49+
./Miniconda3-latest-Linux-x86_64.sh -p /conda -b && \
50+
source /conda/bin/activate && \
51+
conda create -n "conda-env" python=3.8.0 -y && \
52+
conda activate conda-env && \
53+
pip install wheel pybind11 pkgconfig && \
54+
git clone https://github.com/mochi-hpc/py-mochi-margo.git && \
55+
cd py-mochi-margo/ && \
56+
git checkout 976b14982f02bc98eac1b32052de5e8ec69fa081 && \
57+
python setup.py bdist_wheel && \
58+
pip install dist/pymargo-0.5.1-cp38-cp38-linux_x86_64.whl && \
59+
cd .. && \
60+
git clone https://github.com/mochi-hpc/py-mochi-sonata.git && \
61+
cd py-mochi-sonata/ && \
62+
git checkout 21ff608c81419470a26de645be5dad5d4aa35653 && \
63+
python setup.py bdist_wheel && \
64+
pip install dist/py_sonata-0.1-cp38-cp38-linux_x86_64.whl && \
65+
rm -rf /Downloads/*
66+
67+
#ensure shared libraries visible
68+
ENV LD_LIBRARY_PATH /opt/view/lib/
69+
70+
#python is now freed from the tyranny of spack!
71+
72+
73+
#install provdb-python
74+
RUN source /conda/bin/activate && \
75+
conda activate conda-env && \
76+
cd /Downloads && \
77+
git clone https://github.com/CODARcode/PerformanceAnalysis.git && \
78+
cd PerformanceAnalysis/ && \
79+
git checkout 6be55788fcc962a0bbb4ae9191404328afcfbe90 && \
80+
cd scripts/provdb_python && \
81+
python setup.py bdist_wheel && \
82+
pip install dist/provdb_python-0.0.1-py3-none-any.whl && \
83+
rm -rf /Downloads/*
84+
85+
ENTRYPOINT ["/bin/bash"]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
docker build --progress=plain -f Dockerfile -t chimbuko/chimbuko-conda:ubuntu18.04 .
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
spack:
2+
specs:
3+
- mochi-sonata~bedrock~unqlite_st
4+
concretizer:
5+
unify: true
6+
compilers:
7+
- compiler:
8+
spec: gcc@=7.5.0
9+
paths:
10+
cc: /usr/bin/gcc
11+
cxx: /usr/bin/g++
12+
f77: /usr/bin/gfortran
13+
fc: /usr/bin/gfortran
14+
flags: {}
15+
operating_system: ubuntu18.04
16+
target: x86_64
17+
modules: []
18+
environment: {}
19+
extra_rpaths: []
20+
repos:
21+
- /sds/mochi-spack-packages
22+
packages:
23+
all:
24+
compiler: [gcc@=7.5.0]
25+
providers: {}
26+
coreutils:
27+
externals:
28+
29+
prefix: /usr
30+
buildable: False
31+
diffutils:
32+
externals:
33+
34+
prefix: /usr
35+
buildable: False
36+
findutils:
37+
externals:
38+
39+
prefix: /usr
40+
buildable: False
41+
openssh:
42+
externals:
43+
44+
prefix: /usr
45+
buildable: False
46+
openssl:
47+
externals:
48+
49+
prefix: /usr
50+
buildable: False
51+
git:
52+
externals:
53+
- spec: [email protected]~tcltk
54+
prefix: /usr
55+
buildable: False
56+
gmake:
57+
externals:
58+
59+
prefix: /usr
60+
buildable: False
61+
libtool:
62+
externals:
63+
64+
prefix: /usr
65+
buildable: False
66+
67+
config:
68+
install_tree: /opt/software
69+
view: /opt/view
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
modules:
2+
prefix_inspections:
3+
lib: [LIBRARY_PATH]
4+
lib64: [LIBRARY_PATH]
5+
include:
6+
- C_INCLUDE_PATH
7+
- CPLUS_INCLUDE_PATH
8+
- INCLUDE

0 commit comments

Comments
 (0)