Skip to content

Commit

Permalink
build bootconfig for both amd and arm using batch build (#2574)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxesn authored Oct 18, 2023
1 parent 10c908c commit 5e707eb
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 13 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ generate-project-list: | ensure-locale
build/lib/generate_projects_list.sh $(BASE_DIRECTORY)

.PHONY: generate-staging-buildspec
generate-staging-buildspec: export BINARY_PLATFORMS=linux/amd64 linux/arm64
generate-staging-buildspec: | ensure-locale
build/lib/generate_staging_buildspec.sh $(BASE_DIRECTORY) "$(ALL_PROJECTS)" "$(BASE_DIRECTORY)/release/staging-build.yml"
build/lib/generate_staging_buildspec.sh $(BASE_DIRECTORY) "$(ALL_PROJECTS)" "$(BASE_DIRECTORY)/release/checksums-build.yml" true EXCLUDE_FROM_CHECKSUMS_BUILDSPEC CHECKSUMS_BUILDSPECS false buildspecs/checksums-pr-buildspec.yml
Expand All @@ -97,6 +98,7 @@ generate-staging-buildspec: | ensure-locale
build/lib/generate_staging_buildspec.sh $(BASE_DIRECTORY) "kubernetes-sigs_kind" "$(BASE_DIRECTORY)/projects/kubernetes-sigs/kind/buildspecs/batch-build.yml" true
build/lib/generate_staging_buildspec.sh $(BASE_DIRECTORY) "containerd_containerd" "$(BASE_DIRECTORY)/projects/containerd/containerd/buildspecs/batch-build.yml" true
build/lib/generate_staging_buildspec.sh $(BASE_DIRECTORY) "opencontainers_runc" "$(BASE_DIRECTORY)/projects/opencontainers/runc/buildspecs/batch-build.yml" true
build/lib/generate_staging_buildspec.sh $(BASE_DIRECTORY) "torvalds_linux" "$(BASE_DIRECTORY)/projects/torvalds/linux/buildspecs/batch-build.yml" true

.PHONY: generate
generate: generate-project-list generate-staging-buildspec
Expand Down
15 changes: 12 additions & 3 deletions projects/torvalds/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SIMPLE_CREATE_BINARIES=false
# ensure we are building to a directory based on the current
# host platform to avoid ever creating a different arch'd
# binary in the wrong folder
BINARY_PLATFORMS=$(BUILDER_PLATFORM)
BINARY_PLATFORMS?=$(BUILDER_PLATFORM)
BINARY_TARGETS=$(OUTPUT_BIN_DIR)/$(subst /,-,$(BINARY_PLATFORMS))/tools/bootconfig

HAS_LICENSES=false
Expand All @@ -25,8 +25,17 @@ IMAGE_NAMES=
# this project never builds arm, dont fake it in presubmits
FAKE_ARM_BINARIES_FOR_VALIDATION=false

# we cant cross build this so must build on an amd instance
BUILDSPEC_PLATFORM=LINUX_CONTAINER
EXCLUDE_FROM_CHECKSUMS_BUILDSPEC=true

BUILDSPEC_VARS_KEYS=BINARY_PLATFORMS
BUILDSPEC_VARS_VALUES=BINARY_PLATFORMS
BUILDSPEC_ARCH_TYPES=LINUX_CONTAINER ARM_CONTAINER

# Since we build the arm and amd binaries on difference instances in codebuild
# we do not want to delete missing files when s3 sync-ing from local to the bucket
# since this would clobber the other build's artifacts
UPLOAD_DO_NOT_DELETE=true


include $(BASE_DIRECTORY)/Common.mk

Expand Down
33 changes: 33 additions & 0 deletions projects/torvalds/linux/buildspecs/batch-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This file was generated by running `make generate`. DO NOT EDIT

batch:
fast-fail: true
build-graph:
- identifier: torvalds_linux_linux_amd64
buildspec: buildspec.yml
env:
type: LINUX_CONTAINER
compute-type: BUILD_GENERAL1_SMALL
variables:
BINARY_PLATFORMS: linux/amd64
- identifier: torvalds_linux_linux_arm64
buildspec: buildspec.yml
env:
type: ARM_CONTAINER
compute-type: BUILD_GENERAL1_SMALL
variables:
BINARY_PLATFORMS: linux/arm64
9 changes: 0 additions & 9 deletions release/checksums-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,14 +550,6 @@ batch:
compute-type: BUILD_GENERAL1_SMALL
variables:
PROJECT_PATH: projects/tinkerbell/tinkerbell-chart
- identifier: torvalds_linux
buildspec: buildspecs/checksums-buildspec.yml
env:
type: LINUX_CONTAINER
compute-type: BUILD_GENERAL1_SMALL
variables:
PROJECT_PATH: projects/torvalds/linux
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/torvalds.linux
- identifier: vmware_govmomi
buildspec: buildspecs/checksums-buildspec.yml
env:
Expand Down Expand Up @@ -637,5 +629,4 @@ batch:
- tinkerbell_rufio
- tinkerbell_tink
- tinkerbell_tinkerbell_chart
- torvalds_linux
- vmware_govmomi
12 changes: 11 additions & 1 deletion release/staging-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -689,14 +689,24 @@ batch:
compute-type: BUILD_GENERAL1_SMALL
variables:
PROJECT_PATH: projects/tinkerbell/tinkerbell-chart
- identifier: torvalds_linux
- identifier: torvalds_linux_linux_amd64
buildspec: buildspec.yml
env:
type: LINUX_CONTAINER
compute-type: BUILD_GENERAL1_SMALL
variables:
PROJECT_PATH: projects/torvalds/linux
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/torvalds.linux
BINARY_PLATFORMS: linux/amd64
- identifier: torvalds_linux_linux_arm64
buildspec: buildspec.yml
env:
type: ARM_CONTAINER
compute-type: BUILD_GENERAL1_SMALL
variables:
PROJECT_PATH: projects/torvalds/linux
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/torvalds.linux
BINARY_PLATFORMS: linux/arm64
- identifier: vmware_govmomi
buildspec: buildspec.yml
env:
Expand Down

0 comments on commit 5e707eb

Please sign in to comment.