|
35 | 35 | from easybuild.tools.containers.base import ContainerGenerator |
36 | 36 | from easybuild.tools.containers.utils import det_os_deps |
37 | 37 | from easybuild.tools.filetools import remove_dir |
| 38 | +from easybuild.tools.module_naming_scheme.easybuild_mns import EasyBuildMNS |
38 | 39 | from easybuild.tools.run import run_cmd |
39 | 40 |
|
40 | 41 |
|
|
44 | 45 | """ |
45 | 46 |
|
46 | 47 | DOCKER_INSTALL_EASYBUILD = """\ |
47 | | -RUN pip install -U pip setuptools && \\ |
48 | | - hash -r pip && \\ |
49 | | - pip install -U easybuild |
| 48 | +RUN pip3 install -U pip setuptools && \\ |
| 49 | + hash -r pip3&& \\ |
| 50 | + pip3 install -U easybuild |
50 | 51 |
|
51 | 52 | RUN mkdir /app && \\ |
52 | 53 | mkdir /scratch && \\ |
|
61 | 62 |
|
62 | 63 | RUN set -x && \\ |
63 | 64 | . /usr/share/lmod/lmod/init/sh && \\ |
64 | | - eb %(eb_opts)s --installpath=/app/ --prefix=/scratch --tmpdir=/scratch/tmp |
| 65 | + eb --robot %(eb_opts)s --installpath=/app/ --prefix=/scratch --tmpdir=/scratch/tmp |
65 | 66 |
|
66 | | -RUN touch ${HOME}/.profile && \\ |
67 | | - echo '\\n# Added by easybuild docker packaging' >> ${HOME}/.profile && \\ |
68 | | - echo 'source /usr/share/lmod/lmod/init/bash' >> ${HOME}/.profile && \\ |
69 | | - echo 'module use %(init_modulepath)s' >> ${HOME}/.profile && \\ |
70 | | - echo 'module load %(mod_names)s' >> ${HOME}/.profile |
| 67 | +RUN touch ${HOME}/.bashrc && \\ |
| 68 | + echo '' >> ${HOME}/.bashrc && \\ |
| 69 | + echo '# Added by easybuild docker packaging' >> ${HOME}/.bashrc && \\ |
| 70 | + echo 'source /usr/share/lmod/lmod/init/bash' >> ${HOME}/.bashrc && \\ |
| 71 | + echo 'module use %(init_modulepath)s' >> ${HOME}/.bashrc && \\ |
| 72 | + echo 'module load %(mod_names)s' >> ${HOME}/.bashrc |
71 | 73 |
|
72 | 74 | CMD ["/bin/bash", "-l"] |
73 | 75 | """ |
74 | 76 |
|
75 | | -DOCKER_UBUNTU1604_INSTALL_DEPS = """\ |
| 77 | +DOCKER_UBUNTU2004_INSTALL_DEPS = """\ |
76 | 78 | RUN apt-get update && \\ |
77 | | - apt-get install -y python python-pip lmod curl wget |
| 79 | + DEBIAN_FRONTEND=noninteractive apt-get install -y python3 python3-pip lmod \\ |
| 80 | + curl wget git bzip2 gzip tar zip unzip xz-utils \\ |
| 81 | + patch automake git debianutils \\ |
| 82 | + g++ libdata-dump-perl libthread-queue-any-perl libssl-dev |
78 | 83 |
|
79 | 84 | RUN OS_DEPS='%(os_deps)s' && \\ |
80 | | - test -n "${OS_DEPS}" && \\ |
81 | 85 | for dep in ${OS_DEPS}; do apt-get -qq install ${dep} || true; done |
82 | 86 | """ |
83 | 87 |
|
84 | 88 | DOCKER_CENTOS7_INSTALL_DEPS = """\ |
85 | 89 | RUN yum install -y epel-release && \\ |
86 | | - yum install -y python python-pip Lmod curl wget git |
| 90 | + yum install -y python3 python3-pip Lmod curl wget git \\ |
| 91 | + bzip2 gzip tar zip unzip xz \\ |
| 92 | + patch make git which \\ |
| 93 | + gcc-c++ perl-Data-Dumper perl-Thread-Queue openssl-dev |
87 | 94 |
|
88 | 95 | RUN OS_DEPS='%(os_deps)s' && \\ |
89 | 96 | test -n "${OS_DEPS}" && \\ |
90 | 97 | yum --skip-broken install -y "${OS_DEPS}" || true |
91 | 98 | """ |
92 | 99 |
|
93 | 100 | DOCKER_OS_INSTALL_DEPS_TMPLS = { |
94 | | - DOCKER_BASE_IMAGE_UBUNTU: DOCKER_UBUNTU1604_INSTALL_DEPS, |
| 101 | + DOCKER_BASE_IMAGE_UBUNTU: DOCKER_UBUNTU2004_INSTALL_DEPS, |
95 | 102 | DOCKER_BASE_IMAGE_CENTOS: DOCKER_CENTOS7_INSTALL_DEPS, |
96 | 103 | } |
97 | 104 |
|
@@ -125,9 +132,12 @@ def resolve_template_data(self): |
125 | 132 |
|
126 | 133 | ec = self.easyconfigs[-1]['ec'] |
127 | 134 |
|
128 | | - init_modulepath = os.path.join("/app/modules/all", *self.mns.det_init_modulepaths(ec)) |
| 135 | + # We are using the default MNS inside the container |
| 136 | + docker_mns = EasyBuildMNS() |
| 137 | + |
| 138 | + init_modulepath = os.path.join("/app/modules/all", *docker_mns.det_init_modulepaths(ec)) |
129 | 139 |
|
130 | | - mod_names = [e['ec'].full_mod_name for e in self.easyconfigs] |
| 140 | + mod_names = [docker_mns.det_full_module_name(e['ec']) for e in self.easyconfigs] |
131 | 141 |
|
132 | 142 | eb_opts = [os.path.basename(e['spec']) for e in self.easyconfigs] |
133 | 143 |
|
|
0 commit comments