Pavilion Builder Objects
Table of Contents
pavilion.pav_test module
Contains the object for tracking multi-threaded builds, along with the TestBuilder class itself.
- class pavilion.builder.TestBuilder(pav_cfg: PavConfig, working_dir: Path, config: dict, script: Path, status: TestStatusFile, download_dest: Path, templates: Optional[Dict[Path, Path]] = None, spack_config: Optional[dict] = None, 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(test_id: str, tracker: BuildTracker, cancel_event: Optional[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.
- Parameters
test_id – The test ‘full_id’ for the test initiating this build.
tracker – A thread-safe tracker object for keeping info on what the build is doing.
cancel_event – Allows builds to tell each other to die.
- Returns
True if these steps completed successfully.
- copy_build(dest: Path)
Copy the build (using ‘symlink’ copying to the destination.
- Parameters
dest – Where to copy the build to.
- Raises
TestBuilderError – When copy errors happen
- Returns
True on success, False on failure
- create_build_hash() str
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(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() str
Search for the first non-deprecated version of this build (whether or not it exists) and name the build for it.
- classmethod rehash_name(name: str) str
Rehash the given build name with the given version.
- rename_build()
Rechecks deprecation and updates the build name.