-
-
Notifications
You must be signed in to change notification settings - Fork 10
CI: Generate RPM diff and auto-publish GitHub Release #63
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
base: main
Are you sure you want to change the base?
Conversation
…ous release in the container build workflow
|
Great work! For the atomic-desktop images, this changelog is generated by the rechunker, which is very useful. One of the things it does is attach the full package list (ie. your How about doing this instead? This is kind of like a poor man's SBOM, and since it's tied to the image it makes it much easier for you to get the information of the previous released image and it also makes the information available for other future uses. |
| delc=$(wc -l < removed.tmp | tr -d ' ') | ||
| echo "" >> "${out}" | ||
| echo "**Added (${addc})**" >> "${out}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about skipping the sections altogether if there are no packages in that category?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion
I’ve updated the changelog generation so that it now skips any Added / Updated / Removed section when the count is zero
| run: | | ||
| IMAGE_REPO="${IMAGE_NAMES%%,*}" | ||
| # Fetch tag list and pick latest dated tag (<today): <VMJ><VMIN>-YYYYMMDD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use the current ${VMJ} tag, which should always be the latest released tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out
I had overlooked that the ${VMJ} tag is always kept up to date with the latest release
I’ve updated the workflow to simply use ${VMJ} as the comparison base instead of scanning dated tags
Co-authored-by: Alex Iribarren <[email protected]>
23b0c9f to
b63a774
Compare
c49569a to
5ebb806
Compare
| echo "Checking ${IMAGE_REPO}:${PREV_TAG}" | ||
| if ! skopeo inspect docker://"${IMAGE_REPO}:${PREV_TAG}" >/dev/null 2>&1; then | ||
| echo "::error ::Tag not found: ${IMAGE_REPO}:${PREV_TAG}" | ||
| exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it impossible for the workflow to run the first time, when there's no previous tag. Not too relevant now that it exists, but still...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the step so the workflow won’t fail on the very first run when there’s no previous tag
97f081e to
d299edb
Compare
… loop ci: switch <details> blocks to printf and always close after platform loop
I agree that this approach makes perfect sense. Here’s what I’m thinking:
|
…iner images feat: embed rechunker-style RPM metadata as compressed label in container images
| IMT: ${{ matrix.image_types }} | ||
| PREV_TAG: ${{ env.prev_tag }} | ||
| DTS: ${{ needs.init-data.outputs.date_time_stamp }} | ||
| LABEL_KEY: dev.hhd.rechunk.info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dev.hdd.rechunk.info isn't a standardized label or anything, and given the format is different maybe we shouldn't use the same label. How about org.almalinux.sbom? Reference: https://github.com/opencontainers/image-spec/blob/main/annotations.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good
I'll use org.almalinux.sbom instead.
| rm -f pkgs_${key}.json | ||
| done | ||
| # Compress and encode JSON into a single-line lable payload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Compress and encode JSON into a single-line lable payload | |
| # Compress and encode JSON into a single-line label payload |
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: | | ||
| ${{ env.LABLE_KEY }}=${{ env.RCHUNK_INFO_LABEL }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ${{ env.LABLE_KEY }}=${{ env.RCHUNK_INFO_LABEL }} | |
| ${{ env.LABEL_KEY }}=${{ env.RCHUNK_INFO_LABEL }} |
| # Old image (if present): <image>:<tag> | ||
| if [ -n "${IMG_PREV:-}" ] && [ -n "${TAG_PREV:-}" ]; then | ||
| docker pull --platform "${plat}" "${IMG_PREV}:${TAG_PREV}" >/dev/null 2>&1 || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to run the previous image and extract the list of packages again, now that it's attached as a label you could just get it from there. If you use crane, you can even get the label without having to pull the image!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll switch to using crane.
It seems that crane isn’t included in the default ubuntu-latest runner image, so I’ll add installation steps for it as well.
https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
| done | ||
| # Compress and encode JSON into a single-line lable payload | ||
| RCHUNK_INFO_LABEL=$(gzip -c "rechunk_${VMJ}_${IMT}.json" | base64 -w0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand wanting to reduce the size of this data, but making it binary makes it a bit less useful. It adds an extra couple of steps to be able to read and use it. There's no limit to the value size (as far as I can tell), so why not just store the json directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ll change it to store the JSON directly in the label instead of encoding it.
…ing old image ci: read previous RPM list from image label via crane instead of running old image ci: read previous RPM list from image label via crane instead of running old image ci: read previous RPM list from image label via crane instead of running old image ci: read previous RPM list from image label via crane instead of running old image
|
This looks great! Are you running it anywhere so we can verify everything works as expected and looks good? |
I'll try it out in my own repository by creating a new branch for testing. |
|
The workflow ran successfully and generated the changelog correctly. |
…d RPM diff output
|
Hi @unixtech-06, please take a look at this conversation: https://chat.almalinux.org/almalinux/pl/yuun4ire5jbibxtid1mfubgzfy Now would be a great opportunity to standardize on the same SBOM format for all AlmaLinux images! |
Sorry, I was mistaken earlier. After thinking about it, the current |
|
@javihernandez, what do you think, good to go with the SBOM? |
Hey, currently, the sbom tools are not part of the cloud images pipelines, its inclusion in the gcp images pipelines is being finalized as part of AlmaLinux/cloud-images#266. In any case, yes, I think that we can proceed with the SBOM tools approach. For that, @unixtech-06 needs to:
|
Closes #60
Add RPM diff generation and GitHub Release automation to CI
skopeoand compare RPM lists