hpccm.Stage
source module hpccm.Stage
Bases : object
Class for container stages.
Docker may have one or more stages, Singularity will always have a single stage.
Parameters
-
name — Name to use when refering to the stage (Docker specific). The default is an empty string.
-
separator — Separator to insert between stages. The default is '\n\n'.
Methods
source method Stage.baseimage(image, _distro='')
Insert the baseimage as the first layer
Parameters
source method Stage.runtime(_from=None, exclude=[])
Generate the set of instructions to install the runtime specific components from a previous stage.
This method invokes the runtime() method for every layer in the stage. If a layer does not have a runtime() method, then it is skipped.
Parameters
-
_from — The name of the stage from which to copy the runtime. The default is
0. -
exclude — List of building blocks to exclude when generating the runtime. The default is an empty list.
Examples
Stage0 += baseimage(image='nvidia/cuda:9.0-devel')
Stage0 += gnu()
Stage0 += boost()
Stage0 += ofed()
Stage0 += openmpi()
...
Stage1 += baseimage(image='nvidia/cuda:9.0-base')
Stage1 += Stage0.runtime(exclude=['boost'])