spack.container package


spack.container.images module

Manages the details on the images used in the various stages.


Return a list of all the OS that can be used to bootstrap Spack

spack.container.images.build_info(image, spack_version)[source]

Returns the name of the build image and its tag.

  • image (str) – image to be used at run-time. Should be of the form <image_name>:<image_tag> e.g. “ubuntu:18.04”

  • spack_version (str) – version of Spack that we want to use to build


A tuple with (image_name, image_tag) for the build image

spack.container.images.checkout_command(url, ref, enforce_sha, verify)[source]

Return the checkout command to be used in the bootstrap phase.

  • url (str) – url of the Spack repository

  • ref (str) – either a branch name, a tag or a commit sha

  • enforce_sha (bool) – if true turns every

  • verify (bool) –


Returns the commands used to update system repositories, install system packages and clean afterwards.


package_manager (str) – package manager to be used


A tuple of (update, install, clean) commands.[source]

Returns a dictionary with the static data on the images.

The dictionary is read from a JSON file lazily the first time this function is called.


Returns the name of the OS package manager for the image passed as argument.


image (str) – image to be used at run-time. Should be of the form <image_name>:<image_tag> e.g. “ubuntu:18.04”


Name of the package manager, e.g. “apt” or “yum”

Module contents

Package that provides functions and classes to generate container recipes from a Spack environment

spack.container.recipe(configuration, last_phase=None)[source]

Returns a recipe that conforms to the configuration passed as input.

  • configuration (dict) – how to generate the current recipe

  • last_phase (str) – last phase to be printed or None to print them all


Validate a Spack environment YAML file that is being used to generate a recipe for a container.

Since a few attributes of the configuration must have specific values for the container recipe, this function returns a sanitized copy of the configuration in the input file. If any modification is needed, a warning will be issued.


configuration_file (str) – path to the Spack environment YAML file


A sanitized copy of the configuration stored in the input file