Skip to content

Commit 04b4dca

Browse files
committed
update docker for master branch
1 parent 0bc32a2 commit 04b4dca

File tree

11 files changed

+246
-93
lines changed

11 files changed

+246
-93
lines changed

Docker/run_docker.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
containername="cloudbusting/simex"
3+
J_PORT=8897
4+
TRASIT_HOST=max-exfl-display.desy.de
5+
HOST_PATH=/gpfs/exfel/data/user/
6+
MOUNT_PATH=/home/xfeluser
7+
JUPYTER_START_PATH=/home/xfeluser/juncheng
8+
9+
# To forward to external host
10+
DISPHOST=`dig +short $TRASIT_HOST |head -1`
11+
DISPHOST=${DISPHOST%.}
12+
echo "Transit host: " $DISPHOST
13+
ssh -f -N -T -R ${J_PORT}:localhost:$J_PORT $DISPHOST &
14+
15+
docker run -v ${HOST_PATH}:${MOUNT_PATH} -e HOME=${JUPYTER_START_PATH} -u `id -u`:`id -g` --userns=host --security-opt no-new-privileges -ti -e JUPYTER_RUNTIME_DIR=/tmp -p ${J_PORT}:${J_PORT} $containername jupyter notebook --no-browser --ip 0.0.0.0 --port ${J_PORT} ${JUPYTER_START_PATH}

Docker/simex/Dockerfile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
1+
# [email protected] - Daniel Webster
12
FROM chuckie82/centos_env
2-
MAINTAINER Chunhong Yoon <[email protected]>
3+
LABEL maintainer="Chunhong Yoon <[email protected]>"
34

45
ADD requirements.txt /opt/requirements.txt
56
ADD python_install.sh /opt/python_install.sh
6-
RUN ["bash", "/opt/python_install.sh"]
7+
RUN yum remove -y cmake && yum install -y cmake3 hdf5-devel flex bison && \
8+
yum clean all && rm -rf /var/cache/yum && \
9+
update-alternatives --install /usr/bin/cmake cmake /usr/bin/cmake3 3 && \
10+
/opt/python_install.sh
711
ENV PATH /opt/miniconda/bin:$PATH
812

913
ARG simex_script=simex_install.sh
1014
ADD $simex_script /opt/simex_install.sh
1115

1216
RUN ["bash", "/opt/simex_install.sh"]
1317

14-
ENV SIMEX_ROOT=/opt/simex_platform
18+
ENV MKLROOT=/opt/miniconda
19+
ENV MKL_ROOT=/opt/miniconda
20+
ENV PYPATH=/opt/miniconda
21+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/miniconda/lib
22+
ENV SIMEX_ROOT=/opt/SimEx-master
1523
ENV PATH=$SIMEX_ROOT/bin:$PATH
16-
ENV PYTHONPATH=$SIMEX_ROOT/Sources/python:$SIMEX_ROOT/lib/python3.6:$PYTHONPATH
24+
ENV PYTHONPATH=$SIMEX_ROOT/Sources/python:$SIMEX_ROOT/lib/python3.7:$PYTHONPATH:/opt/SimEx-master/build/Modules/Others/sdf/sdf-prefix/src/sdf-build/lib/python3.7/site-packages/lib/python
1725
ENV SIMEX_TESTS=$SIMEX_ROOT/Tests
1826
ENV PYFAI_TESTIMAGES=/tmp
1927

28+
RUN useradd -m jovyan

Docker/simex/build_image

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
cp ../../requirements.txt .
22

3-
docker build --no-cache -t cfgrote/simex .
3+
buildah bud -t cloudbusting/simex -f Dockerfile .
44

Docker/simex/python_install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22

3-
export myminiconda=Miniconda3-4.4.10-Linux-x86_64.sh
3+
#export myminiconda=Miniconda3-4.4.10-Linux-x86_64.sh
4+
export myminiconda=Miniconda3-py37_4.8.3-Linux-x86_64.sh
45
URL=https://repo.continuum.io/miniconda/$myminiconda
56

67
# Install dir
@@ -21,7 +22,7 @@ export PATH=$PREFIX/bin:$PATH
2122
conda config --set always_yes True
2223

2324
# pip cannot install pyqt
24-
conda install --no-update-deps pyqt=4
25+
conda install --no-update-deps pyqt=5.9.2
2526

2627
# delete tests
2728
find . -type d -name tests -depth -exec rm -rf {} \;

Docker/simex/simex_install.sh

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,50 @@
22

33
set -e
44

5-
BRANCH=develop
5+
BRANCH=master
66
URL=https://github.com/PaNOSC-ViNYL/SimEx/archive/${BRANCH}.zip
77

88
cd /opt
99

1010
wget $URL
1111
unzip ${BRANCH}.zip
1212
rm ${BRANCH}.zip
13-
cd simex_platform-${BRANCH}
13+
cd SimEx-${BRANCH}
1414

1515
export PATH=/opt/miniconda/bin:$PATH
16-
export HDF5_ROOT=/opt/miniconda
16+
#export HDF5_ROOT=/opt/miniconda
1717

1818
echo "###### DONE unzip ${BRANCH}.zip"
1919

2020
conda install -c intel mkl
21+
export MKLROOT=/opt/miniconda
22+
23+
# This is a dirty hack
24+
pushd ${MKLROOT}/lib
25+
ln -s . intel64
26+
popd
2127

2228
echo "##### DONE install mkl"
2329

24-
ROOT_DIR=/opt/simex_platform
25-
mkdir -p $ROOT_DIR
30+
#ROOT_DIR=/opt/simex_platform
31+
#mkdir -p $ROOT_DIR
32+
33+
# PYPATH is necessary to facilitate the
34+
# install of sdf and s2e; otherwise the
35+
# modules are not installed outside of
36+
# the build tree -- dwebster.
37+
PYPATH=/opt/miniconda
38+
39+
CONDA_PREFIX=/opt/miniconda
40+
CONDA_BIN=`which conda`
41+
CONDA_BIN=${CONDA_BIN%/*}
42+
source ${CONDA_BIN%/*}/etc/profile.d/conda.sh
43+
INSTALL_PREFIX=$CONDA_PREFIX
44+
PYVERSION=`python -V | tr '[:upper:]' '[:lower:]' | tr -d ' '`
45+
PYLIB=${PYVERSION%.*}
46+
DEVELOPER_MODE=ON
47+
export ZLIB_ROOT=$CONDA_PREFIX
48+
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
2649

2750
# Create new build dir and cd into it.
2851

@@ -32,20 +55,27 @@ cd build
3255
# Uncomment the next line and specify the install dir for a custom user install.
3356
#cmake -DCMAKE_INSTALL_PREFIX=$ROOT_DIR $ROOT_DIR
3457
# Uncomment the next line and specify the install dir for a developer install.
35-
cmake -DXCSITPhotonDetector=OFF \
36-
-DGAPDPhotonDiffractor=OFF \
37-
-DCrystFELPhotonDiffractor=OFF \
58+
cmake -DUSE_XCSITPhotonDetector=OFF \
59+
-DUSE_GAPDPhotonDiffractor=OFF \
60+
-DUSE_CrystFELPhotonDiffractor=ON \
61+
-DUSE_SingFELPhotonDiffractor=ON \
3862
-DINSTALL_TESTS=OFF \
3963
-DSRW_OPTIMIZED=ON \
40-
-DDEVELOPER_INSTALL=OFF \
41-
-DCMAKE_INSTALL_PREFIX=$ROOT_DIR \
42-
$ROOT_DIR \
43-
..
64+
-DDEVELOPER_INSTALL=$DEVELOPER_MODE \
65+
-DCMAKE_INSTALL_PREFIX=/opt/miniconda \
66+
-DUSE_sdf=ON \
67+
-DUSE_s2e=ON \
68+
-DUSE_S2EReconstruction_EMC=ON \
69+
-DUSE_S2EReconstruction_DM=ON \
70+
-DUSE_wpg=ON \
71+
-DUSE_GenesisPhotonSource=ON \
72+
-DUSE_FEFFPhotonInteractor=ON \
73+
-DCMAKE_INSTALL_LOCAL_ONLY=0 \
74+
..
4475

45-
chmod og+rwX -R $ROOT_DIR
4676

4777
# Build the project.
48-
make
78+
make -j12
4979

5080
echo "######## done make"
5181

@@ -55,18 +85,10 @@ cd ../..
5585

5686
echo "####### done make install"
5787

58-
#rm -rf simex_platform-${BRANCH}
59-
60-
61-
#remove tests?
62-
#rm -rf $ROOT_DIR/Tests
6388

64-
echo "source /opt/simex_platform/bin/simex_vars.sh" > /etc/profile.d/scripts-simex.sh && \
89+
cp /opt/SimEx-${BRANCH}/build/simex_vars.sh ${CONDA_PREFIX}/bin
90+
echo "source ${CONDA_PREFIX}/bin/simex_vars.sh" > /etc/profile.d/scripts-simex.sh && \
6591
chmod 755 /etc/profile.d/scripts-simex.sh
6692

67-
6893
echo "export PYFAI_TESTIMAGES=/tmp" >> /etc/profile.d/scripts-simex.sh
6994

70-
71-
chmod og+rwX -R /opt/simex_platform
72-

Docker/simex_devel/Dockerfile

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
1-
FROM yakser/simex_3rdparty
2-
MAINTAINER Sergey Yakubov <[email protected]>
1+
# [email protected] - Daniel Webster
2+
FROM chuckie82/centos_env
3+
LABEL maintainer="Chunhong Yoon <[email protected]>"
34

4-
ARG simex_script=simex_install_devel.sh
5+
ADD requirements.txt /opt/requirements.txt
6+
ADD python_install.sh /opt/python_install.sh
7+
RUN yum remove -y cmake && yum install -y cmake3 hdf5-devel flex bison && \
8+
yum clean all && rm -rf /var/cache/yum && \
9+
update-alternatives --install /usr/bin/cmake cmake /usr/bin/cmake3 3 && \
10+
/opt/python_install.sh
11+
ENV PATH /opt/miniconda/bin:$PATH
12+
13+
ARG simex_script=simex_install.sh
514
ADD $simex_script /opt/simex_install.sh
15+
616
RUN ["bash", "/opt/simex_install.sh"]
7-
ENV SIMEX_ROOT=/opt/simex_platform
17+
18+
ENV MKLROOT=/opt/miniconda
19+
ENV MKL_ROOT=/opt/miniconda
20+
ENV PYPATH=/opt/miniconda
21+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/miniconda/lib
22+
ENV SIMEX_ROOT=/opt/SimEx-master
823
ENV PATH=$SIMEX_ROOT/bin:$PATH
9-
ENV PYTHONPATH=$SIMEX_ROOT/Sources/python:$SIMEX_ROOT/lib/python2.7:$PYTHONPATH
24+
ENV PYTHONPATH=$SIMEX_ROOT/Sources/python:$SIMEX_ROOT/lib/python3.7:$PYTHONPATH:/opt/SimEx-master/build/Modules/Others/sdf/sdf-prefix/src/sdf-build/lib/python3.7/site-packages/lib/python
1025
ENV SIMEX_TESTS=$SIMEX_ROOT/Tests
1126
ENV PYFAI_TESTIMAGES=/tmp
12-
ENTRYPOINT ["python"]
27+
28+
RUN useradd -m jovyan

Docker/simex_devel/build_image

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
cp ../../requirements.txt .
2+
3+
buildah bud -t cloudbusting/simex:devel -f Dockerfile .
4+

Docker/simex_devel/build_image_develop

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
3+
#export myminiconda=Miniconda3-4.4.10-Linux-x86_64.sh
4+
export myminiconda=Miniconda3-py37_4.8.3-Linux-x86_64.sh
5+
URL=https://repo.continuum.io/miniconda/$myminiconda
6+
7+
# Install dir
8+
PREFIX=/opt/miniconda
9+
10+
# Download Miniconda
11+
wget -q $URL
12+
13+
# Extract packages
14+
15+
chmod +x $myminiconda
16+
./$myminiconda -b -p $PREFIX
17+
rm ./$myminiconda
18+
cd $PREFIX
19+
20+
# config
21+
export PATH=$PREFIX/bin:$PATH
22+
conda config --set always_yes True
23+
24+
# pip cannot install pyqt
25+
conda install --no-update-deps pyqt=5.9.2
26+
27+
# delete tests
28+
find . -type d -name tests -depth -exec rm -rf {} \;
29+
find . -type d -name test -depth -exec rm -rf {} \;
30+
31+
conda clean --tarballs
32+
33+
# install requirements from file (in given order)
34+
#$PREFIX/bin/pip install -r /opt/requirements.txt
35+
xargs -L 1 pip install < /opt/requirements.txt
36+
37+
# remove .pyc
38+
find . -name \__pycache__ -depth -exec rm -rf {} \;
39+
find . -name "*.pyc" -exec rm -rf {} \;
40+
41+
42+
# remove cache
43+
rm -r pkgs/*
44+
rm -rf /root/.cache/pip
45+
46+
47+
echo "export PATH=/opt/miniconda/bin:${PATH}" >> /etc/profile.d/scripts-path.sh
48+
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
BRANCH=develop
6+
URL=https://github.com/PaNOSC-ViNYL/SimEx/archive/${BRANCH}.zip
7+
8+
cd /opt
9+
10+
wget $URL
11+
unzip ${BRANCH}.zip
12+
rm ${BRANCH}.zip
13+
cd SimEx-${BRANCH}
14+
15+
export PATH=/opt/miniconda/bin:$PATH
16+
#export HDF5_ROOT=/opt/miniconda
17+
18+
echo "###### DONE unzip ${BRANCH}.zip"
19+
20+
conda install -c intel mkl
21+
export MKLROOT=/opt/miniconda
22+
23+
# This is a dirty hack
24+
pushd ${MKLROOT}/lib
25+
ln -s . intel64
26+
popd
27+
28+
echo "##### DONE install mkl"
29+
30+
#ROOT_DIR=/opt/simex_platform
31+
#mkdir -p $ROOT_DIR
32+
33+
# PYPATH is necessary to facilitate the
34+
# install of sdf and s2e; otherwise the
35+
# modules are not installed outside of
36+
# the build tree -- dwebster.
37+
PYPATH=/opt/miniconda
38+
39+
CONDA_PREFIX=/opt/miniconda
40+
CONDA_BIN=`which conda`
41+
CONDA_BIN=${CONDA_BIN%/*}
42+
source ${CONDA_BIN%/*}/etc/profile.d/conda.sh
43+
INSTALL_PREFIX=$CONDA_PREFIX
44+
PYVERSION=`python -V | tr '[:upper:]' '[:lower:]' | tr -d ' '`
45+
PYLIB=${PYVERSION%.*}
46+
DEVELOPER_MODE=ON
47+
export ZLIB_ROOT=$CONDA_PREFIX
48+
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
49+
50+
# Create new build dir and cd into it.
51+
52+
mkdir -v build
53+
cd build
54+
55+
# Uncomment the next line and specify the install dir for a custom user install.
56+
#cmake -DCMAKE_INSTALL_PREFIX=$ROOT_DIR $ROOT_DIR
57+
# Uncomment the next line and specify the install dir for a developer install.
58+
cmake -DUSE_XCSITPhotonDetector=OFF \
59+
-DUSE_GAPDPhotonDiffractor=OFF \
60+
-DUSE_CrystFELPhotonDiffractor=ON \
61+
-DUSE_SingFELPhotonDiffractor=ON \
62+
-DINSTALL_TESTS=OFF \
63+
-DSRW_OPTIMIZED=ON \
64+
-DDEVELOPER_INSTALL=$DEVELOPER_MODE \
65+
-DCMAKE_INSTALL_PREFIX=/opt/miniconda \
66+
-DUSE_sdf=ON \
67+
-DUSE_s2e=ON \
68+
-DUSE_S2EReconstruction_EMC=ON \
69+
-DUSE_S2EReconstruction_DM=ON \
70+
-DUSE_wpg=ON \
71+
-DUSE_GenesisPhotonSource=ON \
72+
-DUSE_FEFFPhotonInteractor=ON \
73+
-DCMAKE_INSTALL_LOCAL_ONLY=0 \
74+
..
75+
76+
77+
# Build the project.
78+
make -j12
79+
80+
echo "######## done make"
81+
82+
# Install the project.
83+
make install
84+
cd ../..
85+
86+
echo "####### done make install"
87+
88+
89+
cp /opt/SimEx-${BRANCH}/build/simex_vars.sh ${CONDA_PREFIX}/bin
90+
echo "source ${CONDA_PREFIX}/bin/simex_vars.sh" > /etc/profile.d/scripts-simex.sh && \
91+
chmod 755 /etc/profile.d/scripts-simex.sh
92+
93+
echo "export PYFAI_TESTIMAGES=/tmp" >> /etc/profile.d/scripts-simex.sh
94+

0 commit comments

Comments
 (0)