spack.mirrors package¶
Submodules¶
spack.mirrors.layout module¶
- class spack.mirrors.layout.DefaultLayout(alias_path: str, digest_path: str | None = None)[source]¶
Bases:
MirrorLayout
- class spack.mirrors.layout.MirrorLayout(path: str)[source]¶
Bases:
objectA
MirrorLayoutobject describes the relative path of a mirror entry.
- class spack.mirrors.layout.OCILayout(digest: Digest)[source]¶
Bases:
MirrorLayoutFollow the OCI Image Layout Specification to archive blobs where paths are of the form
blobs/<algorithm>/<digest>
- spack.mirrors.layout.default_mirror_layout(fetcher: FetchStrategy, per_package_ref: str, spec: Spec | None = None) MirrorLayout[source]¶
Returns a
MirrorReferenceobject which keeps track of the relative storage path of the resource associated with the specifiedfetcher.
spack.mirrors.mirror module¶
- class spack.mirrors.mirror.Mirror(data: str | dict, name: str | None = None)[source]¶
Bases:
objectRepresents a named location for storing source tarballs and binary packages.
Mirrors have a fetch_url that indicate where and how artifacts are fetched from them, and a push_url that indicate where and how artifacts are pushed to them. These two URLs are usually the same.
- static from_url(url: str) Mirror[source]¶
Create an anonymous mirror by URL. This method validates the URL.
- get_credentials(direction: str) Dict[str, Any][source]¶
Get the mirror credentials from the mirror config
- Parameters:
direction – fetch or push mirror config
- Returns:
Dictionary from credential type string to value
Credential Type Map:
access_token:straccess_pair:Tuple[str, str]profile:str
- property supported_layout_versions: List[int]¶
List all of the supported layouts a mirror can fetch from
- class spack.mirrors.mirror.MirrorCollection(mirrors: Mapping[str, Any] | None = None, scope: str | None = None, binary: bool | None = None, source: bool | None = None, autopush: bool | None = None)[source]¶
-
A mapping of mirror names to mirrors.
- spack.mirrors.mirror.SUPPORTED_LAYOUT_VERSIONS¶
The layout version spack can current install
- spack.mirrors.mirror.supported_url_schemes¶
What schemes do we support
spack.mirrors.utils module¶
- class spack.mirrors.utils.MirrorStatsForAllSpecs[source]¶
Bases:
object- merge(ext_mirror_stat: MirrorStatsForOneSpec)[source]¶
- spack.mirrors.utils.create_mirror_from_package_object(pkg_obj, mirror_cache: MirrorCache, mirror_stats: MirrorStatsForOneSpec) bool[source]¶
Add a single package object to a mirror.
The package object is only required to have an associated spec with a concrete version.
- Parameters:
pkg_obj (spack.package_base.PackageBase) – package object with to be added.
mirror_cache – mirror where to add the spec.
mirror_stats – statistics on the current mirror
- Returns:
True if the spec was added successfully, False otherwise
- spack.mirrors.utils.get_all_versions(specs)[source]¶
Given a set of initial specs, return a new set of specs that includes each version of each package in the original set.
Note that if any spec in the original set specifies properties other than version, this information will be omitted in the new set; for example; the new set of specs will not include variant settings.
- spack.mirrors.utils.get_matching_versions(specs, num_versions=1)[source]¶
Get a spec for EACH known version matching any spec in the list. For concrete specs, this retrieves the concrete version and, if more than one version per spec is requested, retrieves the latest versions of the package.
- spack.mirrors.utils.get_mirror_cache(path, skip_unstable_versions=False)[source]¶
Returns a mirror cache, starting from the path where a mirror ought to be created.
- Parameters:
path (str) – path to create a mirror directory hierarchy in.
skip_unstable_versions – if true, this skips adding resources when they do not have a stable archive checksum (as determined by
fetch_strategy.stable_target).
- Returns:
mirror cache object for the given path.
- Return type: