Skip to content

Commit 6d58a90

Browse files
Merge pull request #1229 from atheo89/build-arch
chore: add linux/amd64 default build_arch on the Makefile build command
2 parents 041dd48 + dc9b96a commit 6d58a90

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

.github/workflows/build-notebooks-TEMPLATE.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
TRIVY_VULNDB: "/home/runner/.local/share/containers/trivy_db"
4444
# Targets (and their folder) that should be scanned using FS instead of IMAGE scan due to resource constraints
4545
TRIVY_SCAN_FS_JSON: '{}'
46+
BUILD_ARCH: ${{ inputs.platform }}
4647

4748
steps:
4849

@@ -326,8 +327,7 @@ jobs:
326327
fromJson(inputs.github).event_name == 'workflow_dispatch' }}
327328
env:
328329
IMAGE_TAG: "${{ steps.calculated_vars.outputs.IMAGE_TAG }}"
329-
# Configuring `podman build --platform=` through CONTAINER_BUILD_CACHE_ARGS is a venerable hack on this project
330-
CONTAINER_BUILD_CACHE_ARGS: "${{ steps.extra-podman-build-args.outputs.EXTRA_PODMAN_BUILD_ARGS }} --platform=${{ inputs.platform }} --cache-from ${{ env.CACHE }} --cache-to ${{ env.CACHE }}"
330+
CONTAINER_BUILD_CACHE_ARGS: "${{ steps.extra-podman-build-args.outputs.EXTRA_PODMAN_BUILD_ARGS }} --cache-from ${{ env.CACHE }} --cache-to ${{ env.CACHE }}"
331331
- name: "pull_request: make ${{ inputs.target }}"
332332
run: |
333333
# print running stats on disk occupancy
@@ -338,8 +338,7 @@ jobs:
338338
fromJson(inputs.github).event_name == 'pull_request_target' }}"
339339
env:
340340
IMAGE_TAG: "${{ steps.calculated_vars.outputs.IMAGE_TAG }}"
341-
# Configuring `podman build --platform=` through CONTAINER_BUILD_CACHE_ARGS is a venerable hack on this project
342-
CONTAINER_BUILD_CACHE_ARGS: "${{ steps.extra-podman-build-args.outputs.EXTRA_PODMAN_BUILD_ARGS }} --platform=${{ inputs.platform }} --cache-from ${{ env.CACHE }}"
341+
CONTAINER_BUILD_CACHE_ARGS: "${{ steps.extra-podman-build-args.outputs.EXTRA_PODMAN_BUILD_ARGS }} --cache-from ${{ env.CACHE }}"
343342
# We don't have access to image registry, so disable pushing
344343
PUSH_IMAGES: "no"
345344

.github/workflows/create-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Create release
33
permissions:
44
contents: write
5-
on:
5+
on: # yamllint disable-line rule:truthy
66
workflow_dispatch:
77
inputs:
88
release_tag:

.github/workflows/notebooks-release.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,3 @@ jobs:
140140
release_tag: ${{ github.event.inputs.release_tag }}
141141
release_name: ${{ github.event.inputs.release_name }}
142142
branch: ${{ github.event.inputs.branch }}
143-

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ WHERE_WHICH ?= which
3939

4040
# linux/amd64 or darwin/arm64
4141
OS_ARCH=$(shell go env GOOS)/$(shell go env GOARCH)
42+
BUILD_ARCH ?= linux/amd64
4243

4344
IMAGE_TAG ?= $(RELEASE)_$(DATE)
4445
KUBECTL_BIN ?= bin/kubectl
@@ -71,7 +72,7 @@ define build_image
7172
$(info # Building $(IMAGE_NAME) image...)
7273

7374
$(ROOT_DIR)/scripts/sandbox.py --dockerfile '$(2)' -- \
74-
$(CONTAINER_ENGINE) build $(CONTAINER_BUILD_CACHE_ARGS) --label release=${RELEASE} --tag $(IMAGE_NAME) --file '$(2)' $(BUILD_ARGS) {}\;
75+
$(CONTAINER_ENGINE) build $(CONTAINER_BUILD_CACHE_ARGS) --platform=$(BUILD_ARCH) --label release=$(RELEASE) --tag $(IMAGE_NAME) --file '$(2)' $(BUILD_ARGS) {}\;
7576
endef
7677

7778
# Push function for the notebook image:

0 commit comments

Comments
 (0)