Pavilion Builder Objects

pavilion.pav_test module

Contains the object for tracking multi-threaded builds, along with the TestBuilder class itself.

class pavilion.builder.TestBuilder(pav_cfg, test, mb_tracker, build_name=None)

Bases: object

Manages a test build and their organization.

Variables:
  • _BLOCK_SIZE (int) – Chunk size when reading and hashing files.
  • BUILD_HASH_BYTES (int) – Number of bytes in the build hash (1/2 the chars)
  • DEPRECATED (str) – The name of the build deprecation file.
  • path (Path) – The intended location of this build in the build directory.
  • fail_path (Path) – Where this build will be placed if it fails.
  • name (str) – The name of this build.
BUILD_HASH_BYTES = 8
DEPRECATED = '.pav_deprecated_build'
DOWNLOAD_HASH_SIZE = 13
FINISHED_SUFFIX = '.finished'
LOG_NAME = 'pav_build_log'
TAR_SUBTYPES = ('gzip', 'x-gzip', 'x-bzip2', 'x-xz', 'x-tar', 'x-lzma')
build(cancel_event=None)

Perform the build if needed, do a soft-link copy of the build directory into our test directory, and note that we’ve used the given build. :param threading.Event cancel_event: Allows builds to tell each other to die. :return: True if these steps completed successfully.

copy_build(dest)

Copy the build (using ‘symlink’ copying to the destination.

Parameters:dest (Path) – Where to copy the build to.
Returns:True on success, False on failure
create_build_hash()

Turn the build config, and everything the build needs, into a hash. This includes the build config itself, the source tarball, and all extra files.

create_spack_env(spack_config, build_dir)

Creates a spack.yaml file in the build dir, so that each unique build can activate it’s own spack environment.

deprecate()

Deprecate this build, so that it will be rebuilt if any other test run wants to use it.

exists()

Return True if the given build exists.

log_updated() → Optional[float]

Return the last time the build log was updated. Simply returns None if the log can’t be found or read.

name_build()

Search for the first non-deprecated version of this build (whether or not it exists) and name the build for it.

rename_build()

Rechecks deprecation and updates the build name.

exception pavilion.builder.TestBuilderError

Bases: RuntimeError

Exception raised when builds encounter an error.