forked from ac6y/lume-impact-live-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
87 lines (60 loc) · 2.86 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Define base image
#FROM centos:centos7
FROM continuumio/miniconda3
RUN mkdir /app/
# Create Conda environment from the YAML filei
COPY . /app/
RUN ls /app/
WORKDIR /app/
RUN conda env create -f lume-live-dev.yml
RUN export PATH="/opt/conda/bin/:/opt/slurm/slurm-curr/bin/:$PATH"
RUN apt-get update && apt install gfortran -y
# Override default shell and use bash:
SHELL ["conda", "run", "-n", "lume-live-dev", "/bin/bash", "-c"]
RUN source ~/.bashrc \
&& source /opt/conda/etc/profile.d/conda.sh \
&& /opt/conda/bin/activate && conda init bash \
&& conda activate lume-live-dev \
&& conda install -c conda-forge impact-t=*=mpi_openmpi* \
&& echo "conda activate lume-live-dev" > ~/.bashrc \
&& echo "echo \"Hello World\"" >> ~/.bashrc \
&& conda clean -a
RUN apt install make
RUN git clone https://github.com/impact-lbl/IMPACT-T.git
RUN cd IMPACT-T/src/ && /opt/conda/envs/lume-live-dev/bin/cmake -S . -B build -DUSE_MPI=ON \
&& /opt/conda/envs/lume-live-dev/bin/cmake --build build \
&& /opt/conda/envs/lume-live-dev/bin/cmake --build build --target install
RUN ls /usr/local/bin | grep "Impact"
RUN echo "Installing Impact-T seperately"
RUN ls -a /root/
SHELL ["/bin/bash", "-c"]
RUN ls -a ~
RUN conda info | grep -i 'base environment'
RUN echo "Check if Impactexe and Impactexe-mpi are installed"
RUN ls -ltr /opt/conda/envs/lume-live-dev/bin/ | grep "Impact"
# Activate Conda environment and check if it is working properly
RUN echo "Making sure Key Packages are installed correctly..."
RUN conda run -n lume-live-dev python -c "import impact"
RUN mkdir -p /app/output/{archive,output,plot,snapshot,log,summary}
#Convert Jupyter Notebooks to Python Files and Create Necessary Folders
RUN echo "Convert Jupyter Notebooks to Python Files and Create Necessary Folders"
RUN conda run -n lume-live-dev jupyter nbconvert --to script lume-impact-live-demo.ipynb \
&& conda run -n lume-live-dev jupyter nbconvert --to script make_dashboard.ipynb \
&& conda run -n lume-live-dev jupyter nbconvert --to script get_vcc_image.ipynb
# Setup our EPICS environment to be able to read PROD variables
ENV EPICS_PVA_SERVER_PORT 5075
ENV EPICS_PVA_BROADCAST_PORT 5076
ENV EPICS_PVA_AUTO_ADDR_LIST FALSE
ENV EPICS_PVA_ADDR_LIST "lcls-prod01:5068"
ENV EPICS_PVA_ADDR_LIST "${EPICS_PVA_ADDR_LIST} lcls-prod01:5063"
ENV EPICS_PVA_ADDR_LIST "${EPICS_PVA_ADDR_LIST} mcc-dmz mccas0.slac.stanford.edu"
ENV EPICS_CA_AUTO_ADDR_LIST NO
ENV EPICS_CA_ADDR_LIST "lcls-prod01:5068 lcls-prod01:5063 mcc-dmz"
ENV EPICS_CA_REPEATER_PORT "5069"
ENV EPICS_CA_SERVER_PORT "5068"
ENV EPICS_TS_NTP_INET "134.79.48.11"
ENV EPICS_IOC_LOG_INET "134.79.151.21"
ENV OMPI_ALLOW_RUN_AS_ROOT 1
ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM 1
# Python program to run in the container
#ENTRYPOINT ["conda", "run", "-n", "lume-live-dev", "ipython", "/app/lume-impact-live-demo.py", "--", "-t", "'singularity'"]