Skip to content

Commit 7846210

Browse files
authored
Merge pull request #2 from ocaisa/containers_update
Update Docker support
2 parents b9f0b2b + ae92038 commit 7846210

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

easybuild/tools/containers/docker.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from easybuild.tools.containers.base import ContainerGenerator
3636
from easybuild.tools.containers.utils import det_os_deps
3737
from easybuild.tools.filetools import remove_dir
38+
from easybuild.tools.module_naming_scheme.easybuild_mns import EasyBuildMNS
3839
from easybuild.tools.run import run_cmd
3940

4041

@@ -61,34 +62,34 @@
6162
6263
RUN set -x && \\
6364
. /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
6566
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
7173
7274
CMD ["/bin/bash", "-l"]
7375
"""
7476

7577
DOCKER_UBUNTU2004_INSTALL_DEPS = """\
7678
RUN apt-get update && \\
77-
apt-get install -y python3 python3-pip lmod curl wget git \\
78-
bzip2 gzip tar zip unzip xz-utils \\
79+
DEBIAN_FRONTEND=noninteractive apt-get install -y python3 python3-pip lmod \\
80+
curl wget git bzip2 gzip tar zip unzip xz-utils \\
7981
patch automake git debianutils \\
8082
g++ libdata-dump-perl libthread-queue-any-perl libssl-dev
8183
8284
RUN OS_DEPS='%(os_deps)s' && \\
83-
test -n "${OS_DEPS}" && \\
8485
for dep in ${OS_DEPS}; do apt-get -qq install ${dep} || true; done
8586
"""
8687

8788
DOCKER_CENTOS7_INSTALL_DEPS = """\
8889
RUN yum install -y epel-release && \\
8990
yum install -y python3 python3-pip Lmod curl wget git \\
9091
bzip2 gzip tar zip unzip xz \\
91-
patch makefile git which \\
92+
patch make git which \\
9293
gcc-c++ perl-Data-Dumper perl-Thread-Queue openssl-dev
9394
9495
RUN OS_DEPS='%(os_deps)s' && \\
@@ -131,9 +132,12 @@ def resolve_template_data(self):
131132

132133
ec = self.easyconfigs[-1]['ec']
133134

134-
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))
135139

136-
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]
137141

138142
eb_opts = [os.path.basename(e['spec']) for e in self.easyconfigs]
139143

test/framework/containers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ def test_end2end_docker_image(self):
435435
'-C', # equivalent with --containerize
436436
'--experimental',
437437
'--container-type=docker',
438-
'--container-config=ubuntu:16.04',
438+
'--container-config=ubuntu:20.04',
439439
'--container-build-image',
440440
]
441441

0 commit comments

Comments
 (0)