Repository navigation
Commit 9d3cb1e
committed
Apply OCI deltas with the ostree backend
`bootc upgrade --from-delta` and `bootc switch --from-delta` worked only
with the composefs backend. Wire them up for ostree too.
A tar-diff patch reads the source image by *path*, not from the original
tar byte stream, so the source does not have to be a container layer:
an ostree commit holding the same filesystem works just as well.
`OstreeDataSource` serves file content out of a commit, and
`DeltaLayerSource` plugs that into the container importer in place of
the image proxy, so nothing is fetched.
ostree does not store an image's root filesystem verbatim - the tar
importer moves `/etc` to `/usr/etc`, and `/var` to
`/usr/share/factory/var` on ostree older than v2024.3 - so a source path
is tried at each of the locations that importer could have put it.
Each reconstructed layer is streamed to the importer over a pipe, with
the reconstruction itself running as the driver future that
`join_fetch` already polls concurrently, so a multi-GB base layer never
has to be spooled to disk.
The source image is looked up by config digest among the images in the
repository, and an absent source is fatal: there is no guarantee of a
network connection at the point a delta is applied, so falling back to
the registry would defeat the purpose.
Byte-level progress is not reported for delta layers: the reconstructed
bytes are uncompressed, so counting them against the descriptor's
compressed size would overshoot. Per-layer start/completion still is.
A layer's ref is written as the layer is unpacked, i.e. before the
driver future has had the chance to report a diff_id mismatch, so a
failed apply can leave a ref to unverified content that a retry would
reuse. Prune the unreferenced layers after a failed delta apply.
Also, `switch --from-delta` no longer short-circuits when the image
specification is unchanged - a delta names one specific target digest,
and switching to the reference you are already tracking is exactly how
it is normally used.
Assisted-by: AI
Signed-off-by: Alexander Larsson <alexl@redhat.com>1 parent 654b659 commit 9d3cb1e
5 files changed
Lines changed: 594 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1284 | 1284 | | |
1285 | 1285 | | |
1286 | 1286 | | |
1287 | | - | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
1288 | 1290 | | |
1289 | 1291 | | |
1290 | 1292 | | |
| |||
1349 | 1351 | | |
1350 | 1352 | | |
1351 | 1353 | | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
1352 | 1357 | | |
1353 | 1358 | | |
1354 | 1359 | | |
| |||
1375 | 1380 | | |
1376 | 1381 | | |
1377 | 1382 | | |
1378 | | - | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
1379 | 1394 | | |
1380 | 1395 | | |
1381 | 1396 | | |
| |||
1512 | 1527 | | |
1513 | 1528 | | |
1514 | 1529 | | |
1515 | | - | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
1516 | 1533 | | |
1517 | 1534 | | |
1518 | 1535 | | |
| |||
1577 | 1594 | | |
1578 | 1595 | | |
1579 | 1596 | | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
1580 | 1600 | | |
1581 | | - | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
1582 | 1612 | | |
1583 | 1613 | | |
1584 | 1614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
110 | | - | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| 116 | + | |
| 117 | + | |
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
117 | 128 | | |
118 | 129 | | |
119 | 130 | | |
| |||
148 | 159 | | |
149 | 160 | | |
150 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
151 | 167 | | |
152 | 168 | | |
153 | 169 | | |
| |||
196 | 212 | | |
197 | 213 | | |
198 | 214 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | 215 | | |
208 | 216 | | |
209 | 217 | | |
| |||
215 | 223 | | |
216 | 224 | | |
217 | 225 | | |
218 | | - | |
| 226 | + | |
219 | 227 | | |
220 | 228 | | |
221 | 229 | | |
| |||
253 | 261 | | |
254 | 262 | | |
255 | 263 | | |
256 | | - | |
| 264 | + | |
257 | 265 | | |
258 | 266 | | |
259 | 267 | | |
| |||
637 | 645 | | |
638 | 646 | | |
639 | 647 | | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | 648 | | |
648 | 649 | | |
649 | 650 | | |
| |||
0 commit comments