Don't pull-local over 9p during rpm-ostree compose#2946
Don't pull-local over 9p during rpm-ostree compose#2946cgwalters merged 7 commits intocoreos:mainfrom
pull-local over 9p during rpm-ostree compose#2946Conversation
If the cache was nuked, we should re-download everything even if nothing changed since the last build. Otherwise, it's impossible to do a `cosa build --force` afterwards.
Prep for future patch.
This inlines back `impl_rpmostree_compose` in the two places where it's called. Prep for future patch.
Prep for future patch.
Now that the variable is declared publicly, we can just add it to the list of rpm-ostree args as part of the compose helper. This has no functional change in the `cosa build` path. In the `cosa fetch` path, this will add the switch but rpm-ostree will ignore it since we're not actually writing a commit.
All the other overlays have the prefix `overlay/`. Do that here too for consistency.
|
I've spent way more time than I'd care to admit on investigating this bug. The first issue is that it's really hard to reproduce locally in the first place. Doing lots of I've tried a couple of other alternatives (including playing with |
| # whether the package set didn't changed since the last build. | ||
| # shellcheck disable=SC2086 | ||
| runcompose_tree --download-only ${args} | ||
| runcompose_tree --download-only ${args} --force-nocache |
There was a problem hiding this comment.
hmm. Does this mean I'm not able to take advantage of RPMs that are already local to my system?
There was a problem hiding this comment.
This switch shouldn't have any semantic differences except for the corner-case mentioned in the commit message.
20b1c40 to
a279741
Compare
cgwalters
left a comment
There was a problem hiding this comment.
Only did a superficial review...seems sane, I think we should probably ship this and polish later.
|
|
||
| commit=$(jq -r '.["ostree-commit"]' < "${composejson}") | ||
|
|
||
| tar -f "${tarball}" -C "${repo}" -c . |
There was a problem hiding this comment.
Note that https://github.com/ostreedev/ostree-rs-ext/#module-tar-tar-exportimport also exists now...and can be used to do streaming even. An advantage of this is that (unlike tar), ostree knows not to overwrite extant objects, etc.
I think where this is heading is that we drop 9p usage entirely, and e.g. stream the resulting tarball over a virtio-serial channel.
(The input arguments could also be a tarball streamed over virtio-serial; they're pretty small I think)
dustymabe
left a comment
There was a problem hiding this comment.
I don't see any issues that jump out. Thanks for working on this.
CI failure here is likely related |
Instead of having rpm-ostree effectively doing a `pull-local` under the hood over 9p, change things so we compose in a local repo, export the commit to an archive and only copy *that* over 9p. This should greatly help with pipelines hitting ENOMEM due to transferring many small files over 9p: openshift/os#594 An initial approach exported to OCI archive instead, but encapsulating and unencapsulating are more expensive operations. Unfortunately, we still need to unpack into `tmp/repo` given that many follow-up commands expect the commit to be available in `tmp/repo`. If we can drop that assumption (and get rid of `tmp/repo` entirely), we could refactor things further so that `compose.sh` creates the final chunked OCI artifact upfront. In local testing, this adds about 30s to `cosa build`. We still compress just once, and we get hardlinks pulling out of the tarball.
a279741 to
5d3b6f7
Compare
|
/retest |
|
All green! 🎉 |
|
Note that cmdlib: rename cosa-image-json ostree overlay affects the generated treefile and so will cause a ripple of change detection even though the overlay contents itself didn't change. I think it'd make sense to rework rpm-ostree to not include the ostree layer names in the hash since the content checksum is what we care about and it already hashes those. (Edit: filed coreos/rpm-ostree#3796). |
|
I saw this odd failure https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/coreos_rpm-ostree/3795/pull-ci-coreos-rpm-ostree-main-fcos-e2e/1541316618062139392 It's probably a flake of some kind? But just commenting to keep track in case. |
Filed #2949 for this. |
Instead of having rpm-ostree effectively doing a
pull-localunder thehood over 9p, change things so we compose in a local repo, export the
commit to an archive and only copy that over 9p.
This should greatly help with pipelines hitting ENOMEM due to
transferring many small files over 9p:
openshift/os#594
An initial approach exported to OCI archive instead, but encapsulating
and unencapsulating are more expensive operations. Unfortunately, we
still need to unpack into
tmp/repogiven that many follow-up commandsexpect the commit to be available in
tmp/repo. If we can drop thatassumption (and get rid of
tmp/repoentirely), we could refactorthings further so that
compose.shcreates the final chunked OCIartifact upfront.
In local testing, this adds about 30s to
cosa build. We still compressjust once, and we get hardlinks pulling out of the tarball.