-
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
Native multi-arch ClusterBuildStrategy #1634
Merged
openshift-merge-bot
merged 3 commits into
shipwright-io:main
from
aleskandro:multiarch-native-builds
Aug 4, 2024
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
545 changes: 545 additions & 0 deletions
545
...ta1/buildstrategy/multiarch-native-buildah/buildstrategy_multiarch_native_buildah_cr.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
samples/v1beta1/buildstrategy/multiarch-native-buildah/role_multiarch_native_buildah_cr.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: multiarch-native-buildah-pipeline | ||
rules: | ||
- verbs: | ||
- get | ||
- list | ||
- watch | ||
resources: | ||
- pods | ||
apiGroups: | ||
- "" | ||
- verbs: | ||
- create | ||
resources: | ||
- pods/exec | ||
apiGroups: | ||
- "" | ||
- verbs: | ||
- get | ||
- list | ||
- create | ||
- watch | ||
resources: | ||
- jobs | ||
apiGroups: | ||
- batch |
11 changes: 11 additions & 0 deletions
11
...beta1/buildstrategy/multiarch-native-buildah/rolebinding_multiarch_native_buildah_cr.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: multiarch-native-buildah-pipeline | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: multiarch-native-buildah-pipeline | ||
subjects: | ||
- kind: ServiceAccount | ||
name: pipeline |
14 changes: 14 additions & 0 deletions
14
...ildstrategy/multiarch-native-buildah/rolebinding_multiarch_native_buildah_scc_okd_cr.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# NOTE: This is needed secifically in OKD/OpenShift environments. | ||
# The pipeline service account should be allowed running pods that require | ||
# the privileged SecurityContextConstraint. | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: multiarch-native-buildah-pipeline-scc-privileged | ||
subjects: | ||
- kind: ServiceAccount | ||
name: pipeline | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: 'system:openshift:scc:privileged' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
apiVersion: shipwright.io/v1beta1 | ||
kind: Build | ||
metadata: | ||
name: multiarch-native-buildah-ex | ||
spec: | ||
source: | ||
type: Git | ||
git: | ||
url: https://github.com/shipwright-io/sample-go | ||
contextDir: docker-build | ||
strategy: | ||
name: multiarch-native-buildah | ||
kind: ClusterBuildStrategy | ||
paramValues: | ||
- name: architectures | ||
values: | ||
# Setting only to amd64 for the tests to run on amd64 only clusters | ||
- value: "amd64" | ||
- name: build-contexts | ||
values: | ||
- value: "ghcr.io/shipwright-io/shipwright-samples/golang:1.18=docker://ghcr.io/shipwright-io/shipwright-samples/golang:1.18" | ||
# The buildah `--from` replaces the first FROM statement | ||
- name: from | ||
value: "" # Using the build-contexts for this example | ||
# The runtime-stage-from implements the logic to replace the last stage FROM image of a Dockerfile | ||
- name: runtime-stage-from | ||
value: docker://gcr.io/distroless/static:nonroot | ||
- name: dockerfile | ||
value: Dockerfile | ||
output: | ||
image: image-registry.openshift-image-registry.svc:5000/build-examples/taxi-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
apiVersion: shipwright.io/v1beta1 | ||
kind: BuildRun | ||
metadata: | ||
name: multiarch-native-buildah-ex | ||
spec: | ||
build: | ||
name: multiarch-native-buildah-ex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
/cc @adambkaplan
Thanks @dorzel