-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buildfetch
'd image.yaml
always used instead of the one from the config
#3616
Comments
I'm working on the fix. |
Better reproducer example:
EDIT: Clarified that "Complete the build" means |
I posted this over in #3618 (comment) but I'll post it here too:
I think we intentionally embed the image.json/image.yaml into the OSTree commit so that it's canonical for the later stages. i.e. the later stages are not intended to pick it up from the config but rather from the OCI Archive/OSTree commit. If you are running TL;DR if you change the image.yaml, you need to |
The specific reproducer here is running Sorry I wasn't more clear about that, I've updated the reproducer example. |
OK looking at your reproducer steps:
Are you sure that step 8 isn't skipping the build because there is nothing to do? Can you change step 8 to Also if you are doing a fresh build why do you need the |
Yes, I'm sure it's doing the build, I added a bunch of debugging to the build to track down this problem and I can see it's generating the different/correct
Sure, I can change that to be sure, but it's a completely different config commit I'm building that has a modified
Yup, exactly. The actual |
I'm able to reproduce this problem with something like:
The key part here is the |
It turns out the |
So the functionality is that when you run In the This begs the question, why are we extracting the This leaves us with a conundrum. The The options therefore are:
Option 1 seems reasonable when looking only at Option 2 doesn't really work, because some variables are collected during the import of the prior build that get used in unique ways later in some of the Option 3 would be the correct way to fix the order of operations, but the Option 4 is what I implemented in #3618. It's an ultra-low-impact partial version of Option 1, and allows Option 5 is just an alternative for Option 4 that avoids changing common code. Option 6 is Option 4, but allows the |
Bug Report
When doing a
build
where a priorbuildfetch
'd commit is present, theimage.yaml
from the fetched build in thebuilds
folder overwrites thetmp/image.jsong
that was generated from the current build right before it gets used.Using
buildfetch
always results in the fetchedimage.yaml
being used instead of the one from the config for the nextbuild
command run.Environment
What operating system is being used to run coreos-assembler?
Container image
quay.io/coreos-assembler/coreos-assembler:latest
generated on 2023.09.11 (digest:2d1ee8a77d31
).What operating system is being assembled?
Customized fedora-coreos-config variant.
Is coreos-assembler running in Podman or Docker?
Podman, though it's replicable in Docker as well.
If Podman, is coreos-assembler running privileged or unprivileged?
Privileged
Expected Behavior
The
image.yaml
from the current coreos config being built (merged on top of theimage-default.yaml
built into coreos-assembler to ensure it meets the minimum requirements) should be used for builds even when fetching a prior build.Actual Behavior
The
image.yaml
from the fetched build overwrites thetmp/image.json
generated from the current config right before it gets used.Reproduction Steps
In the following, build ID
4cdf84b
is a build from before the #3483 change addedcomposefs
toimage-default.yaml
and made it a mandatory key in theimage.yaml
.cosa init ....my-config...
cosa buildfetch --artifact=ostree --url file:///...path.../artifacts_of_4cdf8fb
cosa fetch
cosa build --skip-config-archive --version=5b7b124.202309014163002 --parent=4cdf8fb
Other Information
I've traced this issue specifically to the
build
command.In
cmd-build
, line 163-171 determine that the a prior build exists in the form of thebuildfetch
'd build, which results in line 189 being run to import the ostree commit for the priot build. This leads tocmdlib.py
import_ostree_commit
being called, which callsextract_image_json
to overwrite thetmp/image.json
with the one from the imported ostree commit right before it returns.Unfortunately this all happens in
cmd-build
after theprepare_build
was called, which is what reads the config'simage.yaml
, applies it on top ofimage-default.yaml
, and writes it totmp/image.json
.The text was updated successfully, but these errors were encountered: