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

Multi arch implementation. #11

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

pacostas
Copy link
Contributor

@pacostas pacostas commented Dec 11, 2024

Merge After (Please merge with the below order)

  1. [optional] Stack: Validating generated build artifacts option on tests github-config#994 (nice to have as it validates the existence of generated artifacts)
  2. Stacks - receipt.sh script - multi arch support github-config#992
  3. Reconcile multi arch support for push-image workflow github-config#984
  4. Enable the update shard github-config workflow
  5. Sync tools, tools.json and tools.sh #9
  6. Updates go mod toolchain version to 1.22.5 #8
  7. Updates github-config #7
  8. Enable the Update Go Version workflow
  9. Follow the below instructions from below section ## Instructions on how to merge
  10. Enable the Create release workflow

Summary

This PR adds support for producing multi-arch artifacts based on the implementation of the jammy-tiny-stack.

Supports:

  • ubuntu, ubi or any other stack that might be introduced in the future. This is feasible due to the poll_images job that iterates over the hash codes.
  • It does not change the default behavior of the create-release workflow.
  • It does not break when a new architecture is introduced.
  • The amd64 keyword is not included in the artifacts. E.g. the jammy-tiny-stack-0.2.53-amd64-run-receipt.cyclonedx.json will be on the artifacts with the name jammy-tiny-stack-0.2.53-run-receipt.cyclonedx.json. This is a choice to support the existing naming convention for the amd64 files so as not to break any backward compatibility.
  • In case of more than one architecture is included on the stack.toml, the release notes are included on the artifacts and not on the release description, similar to what jammy-tiny-stack implementation does.

This PR has been tested various times on multiple repositories, although issues might arise. Therefore, I'm committed to watching for any errors and immediately opening a PR to fix them.

Use Cases

Produces Multi-architecture releases based on what is declared on the stack.toml.

Sample output of the release notes.

Instructions on how to merge

Due to the current tag workflow not producing any arm64 assets, the below instructions have to be followed in order for the workflow to run.

  1. Merge the PR without squashing the commits.

  2. remove the local tag on your machine
    git tag -d v0.0.3

  3. tag the commit where the architecture is only one on the stack.toml . Is the commit with the name removing arm64

git tag v0.0.3 <commit-id>

  1. push the tag on the remote

git push -f origin v0.0.3

This is necessary, as the workflow checks if the arch already exists based on the last tag, and in that case, it will search for the corresponding artifacts. In that case, this repo does not have any arm64 artifacts, and therefore it breaks.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

@pacostas pacostas requested a review from a team as a code owner December 11, 2024 11:10
syncing publish and tools and excluding test.sh

write empty receipts on poll usns

fixing download usn asset pattern

add check if there are new usns

using -c flag on jq

adding if the stack or the arch is new on the json object

using arch_name instead of arch

skipping steps in case of not previous release

removing debug code

fixing getting stacks and arch diffs
@loewenstein-sap
Copy link

Hey @robdimsdale, would be great to get a @paketo-buildpacks/stacks-maintainers review for the mentioned PRs (and this one, once the rest is done) to streamline stack production and prepare everything for multi-arch.

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.

2 participants