flint.containers¶
Helper utility functions to download and otherwise manage containers required for flint
Attributes¶
Classes¶
Item representing a Flint container |
Functions¶
|
Pull a container and check that it was downloaded correctly |
|
Do some quick validation checks on the set of loaded containers. Make sure there are no |
|
|
|
Download known containers for use throughout flint. This |
|
Download known containers for use throughout flint. |
|
Return the path to a |
|
Create the CLI argument parser |
|
Log the known containers. This simply prints the set of known containers. |
|
Inspect the provided |
Module Contents¶
- class flint.containers.FlintContainer(/, **data: Any)[source]¶
Bases:
flint.options.BaseOptionsItem representing a Flint container
- async flint.containers._pull_and_check_container(container_directory: pathlib.Path, known_container: FlintContainer, expected_output_path: pathlib.Path) pathlib.Path[source]¶
Pull a container and check that it was downloaded correctly
- Parameters:
container_directory (Path) – Output directory to store containers. Will be created if necessary.
known_container (FlintContainer) – Container to download
expected_output_path (Path) – Expected output path
- Returns:
The expected path of the container
- Return type:
Path
- flint.containers._sanity_check_containers(container_list: list[FlintContainer] | tuple[FlintContainer, Ellipsis]) None[source]¶
Do some quick validation checks on the set of loaded containers. Make sure there are no duplicated names or file names
- flint.containers.download_known_containers(container_directory: pathlib.Path | str, new_tag: str | None = None) tuple[pathlib.Path, Ellipsis][source]¶
Download known containers for use throughout flint. This calls the async enabled download function and blocks until results are gathered.
- Parameters:
container_directory (Path | str) – Output directory to store containers. Will be created if necessary.
new_tag (str, optional) – The tag associated with the containers to download. If None the latest image will be downloaded. Defaults to None.
- Returns:
Paths to all containers downloaded
- Return type:
tuple[Path, …]
- async flint.containers.download_known_containers_coro(container_directory: pathlib.Path | str, new_tag: str | None = None) tuple[pathlib.Path, Ellipsis][source]¶
Download known containers for use throughout flint.
- Parameters:
container_directory (Path | str) – Output directory to store containers. Will be created if necessary.
new_tag (str, optional) – The tag associated with the containers to download. If None the latest image will be downloaded. Defaults to None.
- Returns:
Paths to all containers downloaded
- Return type:
tuple[Path, …]
- flint.containers.get_known_container_path(container_directory: pathlib.Path | str, name: str) pathlib.Path[source]¶
Return the path to a
flintknown container. These are containers that are downloaded through thedownload_known_containersfunction.- Parameters:
container_directory (Path | str) – Path to directory containing downloaded containers
name (str) – Name of the container. Note that this is not the file name.
- Raises:
ValueError – Raised when the name is not known
- Returns:
Path to the requested
- Return type:
Path
- flint.containers.get_parser() argparse.ArgumentParser[source]¶
Create the CLI argument parser
- Returns:
Constructed argument parser
- Return type:
ArgumentParser
- flint.containers.log_known_containers() None[source]¶
Log the known containers. This simply prints the set of known containers.
- flint.containers.verify_known_containers(container_directory: pathlib.Path | str) bool[source]¶
Inspect the provided
container_directoryto examine that the set of containers that are expected to exist are present.- Parameters:
container_directory (Path | str) – Directory to search that should have containers
- Returns:
True is all containers are available. False otherwise.
- Return type:
bool
- flint.containers.KNOWN_CONTAINER_LOOKUP: dict[str, FlintContainer][source]¶