-
Notifications
You must be signed in to change notification settings - Fork 319
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
Arm runner #1262
base: main
Are you sure you want to change the base?
Arm runner #1262
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ on: | |
branches: | ||
- "pull-request/[0-9]+" | ||
- main | ||
- ARM_Runner | ||
- release-* | ||
|
||
jobs: | ||
|
@@ -114,9 +115,9 @@ jobs: | |
- run: make docker-build | ||
|
||
### Image builds ### | ||
build-gpu-operator: | ||
build-gpu-operator-arm: | ||
needs: [go-check, go-test, go-build] | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04-arm | ||
strategy: | ||
matrix: | ||
dist: [ubi9] | ||
|
@@ -133,6 +134,7 @@ jobs: | |
echo "LABEL_IMAGE_SOURCE=https://github.com/${REPO_FULL_NAME}" >> $GITHUB_ENV | ||
|
||
GENERATE_ARTIFACTS="false" | ||
cdesiniotis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#NOT_USING_ARM="false" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this. |
||
if [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then | ||
GENERATE_ARTIFACTS="false" | ||
elif [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.repository }}" ]]; then | ||
|
@@ -141,11 +143,7 @@ jobs: | |
GENERATE_ARTIFACTS="true" | ||
fi | ||
echo "PUSH_ON_BUILD=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV | ||
echo "BUILD_MULTI_ARCH_IMAGES=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
image: tonistiigi/binfmt:master | ||
echo "DOCKER_BUILD_PLATFORM_OPTIONS=--platform=linux/arm64" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
|
@@ -157,11 +155,57 @@ jobs: | |
- name: Build image | ||
env: | ||
IMAGE_NAME: ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator | ||
VERSION: ${COMMIT_SHORT_SHA} | ||
VERSION: ${COMMIT_SHORT_SHA}-arm | ||
run: | | ||
echo "${VERSION}" | ||
make build-${{ matrix.dist }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question -- do we need to invoke the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the push target gets invoked in the Makefile via its inclusion in native-only.mk. |
||
build-gpu-operator-validator-arm: | ||
needs: [go-check, go-test, go-build] | ||
runs-on: ubuntu-24.04-arm | ||
strategy: | ||
matrix: | ||
dist: [ubi9] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Check out code | ||
- name: Calculate build vars | ||
id: vars | ||
run: | | ||
echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV | ||
echo "LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')" >> $GITHUB_ENV | ||
REPO_FULL_NAME="${{ github.event.pull_request.head.repo.full_name }}" | ||
echo "${REPO_FULL_NAME}" | ||
echo "LABEL_IMAGE_SOURCE=https://github.com/${REPO_FULL_NAME}" >> $GITHUB_ENV | ||
|
||
GENERATE_ARTIFACTS="false" | ||
if [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then | ||
GENERATE_ARTIFACTS="false" | ||
elif [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.repository }}" ]]; then | ||
GENERATE_ARTIFACTS="true" | ||
elif [[ "${{ github.event_name }}" == "push" ]]; then | ||
GENERATE_ARTIFACTS="true" | ||
fi | ||
echo "PUSH_ON_BUILD=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV | ||
echo "DOCKER_BUILD_PLATFORM_OPTIONS=--platform=linux/arm64" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build image | ||
env: | ||
IMAGE_NAME: ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator/gpu-operator-validator | ||
VERSION: ${COMMIT_SHORT_SHA}-arm | ||
SUBCOMPONENT: validator | ||
run: | | ||
echo "${VERSION}" | ||
make build-${{ matrix.dist }} | ||
build-gpu-operator-validator: | ||
|
||
### Image builds ### | ||
build-gpu-operator-amd: | ||
needs: [go-check, go-test, go-build] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
|
@@ -188,11 +232,51 @@ jobs: | |
GENERATE_ARTIFACTS="true" | ||
fi | ||
echo "PUSH_ON_BUILD=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV | ||
echo "BUILD_MULTI_ARCH_IMAGES=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
echo "DOCKER_BUILD_PLATFORM_OPTIONS=--platform=linux/amd64" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
image: tonistiigi/binfmt:master | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build image | ||
env: | ||
IMAGE_NAME: ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator | ||
VERSION: ${COMMIT_SHORT_SHA}-amd | ||
run: | | ||
echo "${VERSION}" | ||
make build-${{ matrix.dist }} | ||
|
||
build-gpu-operator-validator-amd: | ||
needs: [go-check, go-test, go-build] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
dist: [ubi9] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Check out code | ||
- name: Calculate build vars | ||
id: vars | ||
run: | | ||
echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV | ||
echo "LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')" >> $GITHUB_ENV | ||
REPO_FULL_NAME="${{ github.event.pull_request.head.repo.full_name }}" | ||
echo "${REPO_FULL_NAME}" | ||
echo "LABEL_IMAGE_SOURCE=https://github.com/${REPO_FULL_NAME}" >> $GITHUB_ENV | ||
|
||
GENERATE_ARTIFACTS="false" | ||
if [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then | ||
GENERATE_ARTIFACTS="false" | ||
elif [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.repository }}" ]]; then | ||
GENERATE_ARTIFACTS="true" | ||
elif [[ "${{ github.event_name }}" == "push" ]]; then | ||
GENERATE_ARTIFACTS="true" | ||
fi | ||
echo "PUSH_ON_BUILD=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV | ||
echo "DOCKER_BUILD_PLATFORM_OPTIONS=--platform=linux/amd64" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
|
@@ -204,15 +288,64 @@ jobs: | |
- name: Build image | ||
env: | ||
IMAGE_NAME: ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator/gpu-operator-validator | ||
VERSION: ${COMMIT_SHORT_SHA} | ||
VERSION: ${COMMIT_SHORT_SHA}-amd | ||
SUBCOMPONENT: validator | ||
run: | | ||
echo "${VERSION}" | ||
make build-${{ matrix.dist }} | ||
|
||
|
||
### MULTI-ARCH-IMAGES test ### | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: update the comment or remove it. |
||
build-multi-arch-image: | ||
needs: [build-gpu-operator-arm, build-gpu-operator-validator-arm, build-gpu-operator-amd, build-gpu-operator-validator-amd] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
dist: [ubi9] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Check out code | ||
- name: Calculate build vars | ||
id: vars | ||
run: | | ||
echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV | ||
echo "LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')" >> $GITHUB_ENV | ||
REPO_FULL_NAME="${{ github.event.pull_request.head.repo.full_name }}" | ||
echo "${REPO_FULL_NAME}" | ||
echo "LABEL_IMAGE_SOURCE=https://github.com/${REPO_FULL_NAME}" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need docker buildx for this job. |
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build Manifest | ||
env: | ||
LOWERCASE_REPO_OWNER: ${{ env.LOWERCASE_REPO_OWNER }} | ||
COMMIT_SHORT_SHA: ${{ env.COMMIT_SHORT_SHA }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these lines needed? It looks like you are already adding this variables to the environment in a prior step. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will remove these lines |
||
IMAGE_ID_ARM: ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/gpu-operator:${{ env.COMMIT_SHORT_SHA }}-arm | ||
IMAGE_ID_AMD: ghcr.io/${{ env.LOWERCASE_REPO_OWNER}}/gpu-operator:${{ env.COMMIT_SHORT_SHA }}-amd | ||
IMAGE_ID_ARM_VAL: ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/gpu-operator/gpu-operator-validator:${{ env.COMMIT_SHORT_SHA }}-arm | ||
IMAGE_ID_AMD_VAL: ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/gpu-operator/gpu-operator-validator:${{ env.COMMIT_SHORT_SHA }}-amd | ||
MANIFEST: ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/gpu-operator:${{ env.COMMIT_SHORT_SHA }} | ||
MANIFEST_VAL: ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/gpu-operator/gpu-operator-validator:${{ env.COMMIT_SHORT_SHA }} | ||
run: | | ||
docker manifest create \ | ||
${MANIFEST} \ | ||
${IMAGE_ID_AMD} \ | ||
${IMAGE_ID_ARM} | ||
docker manifest push ${MANIFEST} | ||
docker manifest create \ | ||
${MANIFEST_VAL} \ | ||
${IMAGE_ID_AMD_VAL} \ | ||
${IMAGE_ID_ARM_VAL} | ||
docker manifest push ${MANIFEST_VAL} | ||
|
||
### e2e tests ### | ||
e2e-tests-containerd: | ||
needs: [build-gpu-operator, build-gpu-operator-validator] | ||
needs: [build-multi-arch-image] | ||
runs-on: linux-amd64-cpu4 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -264,7 +397,7 @@ jobs: | |
retention-days: 15 | ||
|
||
e2e-tests-nvidiadriver: | ||
needs: [build-gpu-operator, build-gpu-operator-validator] | ||
needs: [build-multi-arch-image] | ||
runs-on: linux-amd64-cpu4 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
BUILD_MULTI_ARCH_IMAGES ?= no | ||
BUILD_MULTI_ARCH_IMAGES ?= false | ||
DOCKER ?= docker | ||
GO_CMD ?= go | ||
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
|
@@ -256,6 +256,8 @@ coverage: unit-test | |
cat $(COVERAGE_FILE) | grep -v "_mock.go" > $(COVERAGE_FILE).no-mocks | ||
go tool cover -func=$(COVERAGE_FILE).no-mocks | ||
|
||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: unneeded newlines. |
||
##### Public rules ##### | ||
DISTRIBUTIONS := ubi9 | ||
DEFAULT_PUSH_TARGET := ubi9 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,7 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64 | ||
|
||
DOCKER_BUILD_OPTIONS = --output=type=image,push=$(PUSH_ON_BUILD) --provenance=$(ATTACH_ATTESTATIONS) --sbom=$(ATTACH_ATTESTATIONS) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the rationale behind this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So I commented out the DOCKER_BUILD_PLATFORM_OPTIONS because we were already specifying it in the workflow in ci.yaml. I added the DOCKER_BUILD_OPTIONS to store the image so we can build the Manifest in the next job. |
||
$(PUSH_TARGETS): OUT_IMAGE ?= $(IMAGE_NAME):$(IMAGE_TAG) | ||
$(PUSH_TARGETS): push-%: | ||
$(DOCKER) tag "$(IMAGE_NAME):$(VERSION)-$(DEFAULT_PUSH_TARGET)" "$(OUT_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.
This should not be needed. Our GitHub actions run on PRs, so the changes you are making we can test via this PR.
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.
@JunAr7112 let's remove this.