livery.toolroom.bench._artifacts¶
livery.toolroom.bench._artifacts ¶
Record a version's release artifacts, one per host, by downloading them.
A tool read from a forge tier has a release with one asset per host,
and node publishes one build per host under its own release index.
The record needs the asset's URL and its sha256 for every host before
the store can supply the version, and the only honest hash is the hash
of bytes the bench had: each asset is picked for its host from the
release's asset list, downloaded once, hashed, landed in the bench's
store so the ingest verification stages it without a second download,
and written on the version line as artifacts[host].
A host the release publishes no asset for is absent from the version: not a hole, not a refusal. A tool on a package tier (PyPI, npm) has no artifacts to record, since its installer supplies it.
fm toolroom.artifacts <tool> records a version already read; the
assembler calls the same function for every fresh version of a
forge-tier tool.
Classes:
| Name | Description |
|---|---|
ArtifactError |
A version's artifacts could not be recorded; the message says why. |
Recorded |
What one version's artifact step found. |
Functions:
| Name | Description |
|---|---|
forge_of |
The forge to list assets from, or empty for a tier that is not a forge. |
lists_assets |
Whether the driver's tier publishes per-host assets to record. |
record_version |
record with version's artifacts for every host that has an asset. |
Attributes:
| Name | Type | Description |
|---|---|---|
FORGE_TIERS |
The provision tiers whose releases publish per-host assets on a forge. |
|
ASSET_TIERS |
Every tier a version's artifacts can be recorded from: the forges, |
FORGE_TIERS
module-attribute
¶
The provision tiers whose releases publish per-host assets on a forge.
ASSET_TIERS
module-attribute
¶
ASSET_TIERS = (*FORGE_TIERS, 'nodejs', 'dotnet')
Every tier a version's artifacts can be recorded from: the forges, node's own release index, and Microsoft's for the .NET SDK.
Recorded
dataclass
¶
What one version's artifact step found.
Attributes:
| Name | Type | Description |
|---|---|---|
version |
str
|
The version recorded. |
found |
dict[str, tuple[str, int]]
|
Per host, the asset's name and its size in bytes. |
absent |
tuple[str, ...]
|
The hosts the release publishes no asset for. |
Methods:
| Name | Description |
|---|---|
lines |
The step as report lines, one per host. |
lines ¶
The step as report lines, one per host.
Source code in packages/toolroom-bench/src/livery/toolroom/bench/_artifacts.py
forge_of ¶
The forge to list assets from, or empty for a tier that is not a forge.
Source code in packages/toolroom-bench/src/livery/toolroom/bench/_artifacts.py
lists_assets ¶
Whether the driver's tier publishes per-host assets to record.
record_version ¶
record_version(record: Record, driver: Driver, version: str, tag: str, *, store: Store, hosts: tuple[str, ...] = HOSTS) -> tuple[Record, Recorded]
record with version's artifacts for every host that has an asset.
Lists the release at tag (the version when the tag is empty),
picks one asset per host, downloads and hashes each, lands the
bytes in store, and writes the artifacts on the version line.
Hosts already recorded on the version are left as they are. The
record's hosts gains every host recorded. The record validates
itself as it is rebuilt, so a layout the record lacks refuses
here, naming what is missing, and never on disk.
Raises:
| Type | Description |
|---|---|
ArtifactError
|
for a driver on a package tier, a version the record does not track, a release with no asset for any host, or a host whose deployment does not resolve whole. |
Source code in packages/toolroom-bench/src/livery/toolroom/bench/_artifacts.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |