1+ # #
2+ # Copyright 2009-2018 Ghent University
3+ #
4+ # This file is part of EasyBuild,
5+ # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
6+ # with support of Ghent University (http://ugent.be/hpc),
7+ # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
8+ # Flemish Research Foundation (FWO) (http://www.fwo.be/en)
9+ # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).
10+ #
11+ # https://github.com/easybuilders/easybuild
12+ #
13+ # EasyBuild is free software: you can redistribute it and/or modify
14+ # it under the terms of the GNU General Public License as published by
15+ # the Free Software Foundation v2.
16+ #
17+ # EasyBuild is distributed in the hope that it will be useful,
18+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
19+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+ # GNU General Public License for more details.
21+ #
22+ # You should have received a copy of the GNU General Public License
23+ # along with EasyBuild. If not, see <http://www.gnu.org/licenses/>.
24+ # #
25+ """
26+ Support for generating docker container recipes and creating container images
27+
28+ :author Mohamed Abidi (Bright Computing)
29+ """
130import os
231import shutil
332import tempfile
95124
96125
97126def check_docker_containerize ():
127+ """Validates the required conditions are satisfied for a docker recipe generation and image creation"""
98128 docker_container_base = build_option ('container_base' ) or DEFAULT_DOCKER_BASE_IMAGE
99129
100130 if docker_container_base not in [DOCKER_BASE_IMAGE_UBUNTU , DOCKER_BASE_IMAGE_CENTOS ]:
@@ -131,6 +161,7 @@ def _det_os_deps(easyconfigs):
131161
132162
133163def generate_dockerfile (easyconfigs , container_base ):
164+ """Generate a dockerfile out of the passed easybuild modules"""
134165 os_deps = _det_os_deps (easyconfigs )
135166
136167 module_naming_scheme = ActiveMNS ()
@@ -173,6 +204,7 @@ def generate_dockerfile(easyconfigs, container_base):
173204
174205
175206def build_docker_image (easyconfigs , dockerfile ):
207+ """Generates a docker image from a dockerfile"""
176208 ec = easyconfigs [- 1 ]['ec' ]
177209
178210 module_naming_scheme = ActiveMNS ()
@@ -190,6 +222,7 @@ def build_docker_image(easyconfigs, dockerfile):
190222
191223
192224def docker_containerize (easyconfigs ):
225+ """Entry point to docker recipe and image creation"""
193226
194227 check_docker_containerize ()
195228
0 commit comments