Skip to content
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

build+metal: Use shared ostree-importing code #2487

Merged
merged 1 commit into from
Oct 7, 2021

Conversation

cgwalters
Copy link
Member

The metal case broke with gangplank+aarch64, because it is
running separate pods for the build or something.

In the Jenkins (x86_64) flow I think we bypass this because we have a single
pod which already has the cached commit in tmp/repo.

Anyways, dedup all this code using a shared helper.

@@ -161,10 +161,7 @@ if [ -n "${previous_commit}" ]; then
commitpartial=${tmprepo}/state/${previous_commit}.commitpartial
if [ ! -f "${commitpath}" ] || [ -f "${commitpartial}" ]; then
if [ -f "${previous_builddir}/${previous_ostree_tarfile_path}" ]; then
mkdir tmp/prev_repo
tar -C tmp/prev_repo -xf "${previous_builddir}/${previous_ostree_tarfile_path}"
ostree pull-local --repo="${tmprepo}" tmp/prev_repo "${previous_commit}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is ${tmprepo} here tmp/repo? I'm just wondering if we should still have the path to the tmprepo be an argument to the new import_ostree_commit_for_build() function.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but we hardcode tmp/repo in a bunch of places.

ostree_repo=$PWD/tmp/repo
fi
# Ensure that we have the cached unpacked commit
import_ostree_commit_for_build "${build}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously we were only doing the import if we needed to. if we needed to then we got a nice message about Cache for build ${build} is gone... - should we only import if we need to?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Python code will print out stuff when it's actually importing, and is also a no-op if the commit exists

# in the common case where we're operating on a recent build, the OSTree

Ah...but actually testing this shows we were importing into the wrong place. Fixed.

Copy link
Member

@dustymabe dustymabe Oct 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Python code will print out stuff when it's actually importing, and is also a no-op if the commit exists

# in the common case where we're operating on a recent build, the OSTree

Ahh. I see that now. Thanks for the link.

Only thing I would improve there is instead of just returning it would be nice to log that we're doing a no-op. i.e. inside the python fuction right before we return.

The metal case broke with gangplank+aarch64, because it is
running separate pods for the build or something.

In the Jenkins (x86_64) flow I think we bypass this because we have a single
pod which already has the cached commit in `tmp/repo`.

Anyways, dedup all this code using a shared helper.
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jlebon jlebon enabled auto-merge (rebase) October 7, 2021 15:33
@jlebon jlebon merged commit 1abee8b into coreos:main Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants