Merge pull request #2417 from jcvenegas/docker-build-fixes

kata-tarball: Build and test fixes
This commit is contained in:
Carlos Venegas 2021-09-09 14:14:26 -05:00 committed by GitHub
commit 230eae3ff3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 35 deletions

View File

@ -1,6 +1,6 @@
name: kata-deploy-build
name: kata deploy build
on: push
on: [push, pull_request]
jobs:
build-asset:
@ -24,7 +24,7 @@ jobs:
- name: Build ${{ matrix.asset }}
run: |
./tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh --build="${KATA_ASSET}"
make "${KATA_ASSET}-tarball"
build_dir=$(readlink -f build)
# store-artifact does not work with symlink
sudo cp -r --preserve=all "${build_dir}" "kata-build"
@ -47,12 +47,21 @@ jobs:
uses: actions/download-artifact@v2
with:
name: kata-artifacts
path: kata-artifacts
path: build
- name: merge-artifacts
run: |
./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts
make merge-builds
- name: store-artifacts
uses: actions/upload-artifact@v2
with:
name: kata-static-tarball
path: kata-static.tar.xz
make-kata-tarball:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: make kata-tarball
run: |
make kata-tarball
sudo make install-tarball

View File

@ -18,6 +18,7 @@ TOOLS += agent-ctl
STANDARD_TARGETS = build check clean install test vendor
include utils.mk
include ./tools/packaging/kata-deploy/local-build/Makefile
all: build
@ -33,10 +34,4 @@ generate-protocols:
static-checks: build
bash ci/static-checks.sh
binary-tarball:
make -f ./tools/packaging/kata-deploy/local-build/Makefile
install-binary-tarball:
make -f ./tools/packaging/kata-deploy/local-build/Makefile install
.PHONY: all default static-checks binary-tarball install-binary-tarball

View File

@ -7,47 +7,51 @@ MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MK_DIR := $(dir $(MK_PATH))
# Verbose build
V ?=
ifneq ($(V),)
SILENT_BUILD_FLAG =
else
SILENT_BUILD_FLAG = -s
endif
V := 1
define BUILD
$(MK_DIR)/kata-deploy-binaries-in-docker.sh $(SILENT_BUILD_FLAG) --build=$1
$(MK_DIR)/kata-deploy-binaries-in-docker.sh $(if $(V),,-s) --build=$1
endef
kata-tarball: | all-parallel merge-builds
all-parallel:
make -f $(MK_PATH) all -j$$(( $$(nproc) - 1 )) NO_TTY="true"
${MAKE} -f $(MK_PATH) all -j$$(( $$(nproc) - 1 )) NO_TTY="true" V=
all: cloud-hypervisor firecracker kernel qemu rootfs-image rootfs-initrd shim-v2
all: cloud-hypervisor-tarball \
firecracker-tarball \
kernel-tarball \
qemu-tarball \
rootfs-image-tarball \
rootfs-initrd-tarball \
shim-v2-tarball
cloud-hypervisor:
$(call BUILD,$@)
%-tarball-build:
$(call BUILD,$*)
firecracker:
$(call BUILD,$@)
cloud-hypervisor-tarball:
${MAKE} $@-build
kernel:
$(call BUILD,$@)
firecracker-tarball:
${MAKE} $@-build
qemu:
$(call BUILD,$@)
kernel-tarball:
${MAKE} $@-build
rootfs-image:
$(call BUILD,$@)
qemu-tarball:
${MAKE} $@-build
rootfs-initrd:
$(call BUILD,$@)
rootfs-image-tarball:
${MAKE} $@-build
shim-v2:
$(call BUILD,$@)
rootfs-initrd-tarball:
${MAKE} $@-build
shim-v2-tarball:
${MAKE} $@-build
merge-builds:
$(MK_DIR)/kata-deploy-merge-builds.sh build
install:
install-tarball:
tar -xvf ./kata-static.tar.xz -C /