-
Notifications
You must be signed in to change notification settings - Fork 113
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-platform support #711
Multi-platform support #711
Conversation
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.
Love it! Thanks for adding this! 🎉
/lgtm
docs/buildstrategies.md
Outdated
- [How does Tekton Pipelines handle resources](#how-does-tekton-pipelines-handle-resources) | ||
- [Examples of Tekton resources management](#examples-of-tekton-resources-management) | ||
- [Annotations](#annotations) | ||
- [BuildStrategies](#buildstrategies) |
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.
GitHub generates its own table of contents now, we might consider not writing our own anymore (doesn't have to be in this PR, just something to consider)
7387bed
to
f24d40b
Compare
Rebased to resolve merge conflicts. |
f24d40b
to
2a576a0
Compare
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.
/lgtm
KO_DOCKER_REPO="$IMAGE_HOST/$IMAGE" GOFLAGS="${GO_FLAGS}" ko resolve -t "$TAG" --bare -R -f deploy/ > release.yaml | ||
KO_DOCKER_REPO="$IMAGE_HOST/$IMAGE" GOFLAGS="${GO_FLAGS} -tags=pprof_enabled" ko resolve -t "$TAG-debug" --bare -R -f deploy/ > release-debug.yaml | ||
KO_DOCKER_REPO="$IMAGE_HOST/$IMAGE" GOFLAGS="${GO_FLAGS}" ko resolve -t "$TAG" --bare --platform=all -R -f deploy/ > release.yaml | ||
KO_DOCKER_REPO="$IMAGE_HOST/$IMAGE" GOFLAGS="${GO_FLAGS} -tags=pprof_enabled" ko resolve -t "$TAG-debug" --bare --platform=all -R -f deploy/ > release-debug.yaml |
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.
For reference - ko
inspects the manifest list of the base image, and then does a golang build for each platform in the manifest [1]. I assume this also means ko resolve
will push a manifest list.
[1] https://github.com/google/ko#multi-platform-images
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.
Yep, that's how it looks: https://hub.docker.com/r/saschaschwarze/shipwright-build-controller/tags?page=1&ordering=last_updated
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adambkaplan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
This enables our build to produce multi-platform images. Details:
ko
0.8.1, 0.8.0 probably also works, but I locally worked with the latest version.GOOS
andGOARCH
toGO_OS
andGO_ARCH
. I need to do this to prevent those variable to be present anywhere, especially in therelease
target whereko
is now ran with the--platform=all
argument to produce the multi-platform image. In that case, theGOOS
andGOARCH
environment variables must not be set. For other targets that are invokingko
, I am setting those two environment variables specifically to make sure the image is built for the platform of the user's machine. Otherwise,ko
would always be buildinglinux/amd64
ko
build strategy to be cross-platform, building actually for the platform of the Kube cluster until we can give more control to the Build user once we havespec.params
.Fixes #698
Submitter Checklist
Release Notes