forked from madminer-tool/madminer-jupyter-env
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
84 lines (63 loc) · 2.62 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
### IMPORTANT NOTE:
###
### This Dockerfile builds the Docker image for the MadMiner "heavy-weight" environment.
### The "heavy-weight" environment provides a working installation of MadGraph 5
### and all the necessary sub-dependencies to run Physics dependent steps:
### - pythia8
### - Delphes
###
### Please consider, that even if this Dockerfile definition is extremely similar as the one
### used for the "madminer-workflow-ph" Docker image, it is better not to depend on it,
### given that the common sections between the two will be moved to a MadMiner provided
### "heavy" version image soon enough.
###
### Check: https://github.com/madminer-tool/madminer/issues/421
#### Base image
#### Reference: https://github.com/root-project/root-docker/blob/master/ubuntu/Dockerfile
FROM rootproject/root:6.24.00-ubuntu20.04
#### Install binary dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
curl \
wget \
rsync \
gfortran \
build-essential \
ca-certificates \
libboost-all-dev \
python3-pip
#### Define working folders
ENV PROJECT_FOLDER "/madminer"
ENV SOFTWARE_FOLDER "/madminer/software"
#### MadGraph 5 environment variables
ENV MG_VERSION "MG5_aMC_v2.9.16"
ENV MG_FOLDER "MG5_aMC_v2_9_16"
ENV MG_FOLDER_PATH "${SOFTWARE_FOLDER}/${MG_FOLDER}"
ENV MG_BINARY_PATH "${SOFTWARE_FOLDER}/${MG_FOLDER}/bin/mg5_aMC"
#### CERN ROOT environment variables
ENV PATH $PATH:$ROOTSYS/bin
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:$ROOTSYS/lib
### Install MadGraph 5 Python dependencies
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
python3 -m pip install --no-cache-dir six==1.15.0
#### Install MadGraph 5
RUN mkdir -p ${SOFTWARE_FOLDER} && true \
| curl -sSL "https://launchpad.net/mg5amcnlo/lts/2.9.x/+download/${MG_VERSION}.tar.gz" \
| tar -xz -C ${SOFTWARE_FOLDER}
#### Install Pythia8 and Delphes
RUN echo "n" | python3 ${MG_BINARY_PATH}
RUN echo "install pythia8" | python3 ${MG_BINARY_PATH}
RUN echo "install Delphes" | python3 ${MG_BINARY_PATH}
# Turn ON Python2 -> Python3 models conversion
RUN echo "set auto_convert_model T" | python3 ${MG_BINARY_PATH}
RUN echo "import model EWdim6-full" | python3 ${MG_BINARY_PATH}
# Delphes environment variables
ENV ROOT_INCLUDE_PATH "${ROOT_INCLUDE_PATH}:${MG_FOLDER_PATH}/Delphes/external"
#### Copy files
COPY requirements.txt ${PROJECT_FOLDER}/
# Install Python3 dependencies
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
python3 -m pip install --no-cache-dir --requirement ${PROJECT_FOLDER}/requirements.txt
#### Set working directory
WORKDIR ${PROJECT_FOLDER}