Use local CoreOS assembler image instead of ghcr

This commit is contained in:
Malte Poll 2022-08-02 17:14:13 +02:00 committed by Malte Poll
parent cba89c687d
commit 3b0b3f0335
5 changed files with 18 additions and 6 deletions

View File

@ -116,6 +116,7 @@ jobs:
id: build-and-upload id: build-and-upload
shell: bash {0} shell: bash {0}
run: | run: |
make cosa-image
make -j$(nproc) CONTAINER_ENGINE=docker NETRC=/tmp/.netrc \ make -j$(nproc) CONTAINER_ENGINE=docker NETRC=/tmp/.netrc \
COSA_INIT_BRANCH="${{ inputs.coreOSConfigBranch }}" \ COSA_INIT_BRANCH="${{ inputs.coreOSConfigBranch }}" \
GCP_IMAGE_NAME="${{ env.gcpImageName }}" GCP_IMAGE_FAMILY="${{ env.gcpImageFamily }}" \ GCP_IMAGE_NAME="${{ env.gcpImageName }}" GCP_IMAGE_FAMILY="${{ env.gcpImageFamily }}" \

View File

@ -22,6 +22,7 @@ DISK_MAPPER_BINARY ?= $(BASE_PATH)/../build/disk-mapper
DISK_MAPPER_OVERRIDE_PATH ?= $(OVERRIDES_ROOTFS)/usr/sbin/disk-mapper DISK_MAPPER_OVERRIDE_PATH ?= $(OVERRIDES_ROOTFS)/usr/sbin/disk-mapper
IMAGES_PATH ?= $(BASE_PATH)/images IMAGES_PATH ?= $(BASE_PATH)/images
CONTAINER_ENGINE ?= podman CONTAINER_ENGINE ?= podman
COSA_BUILDDIR ?= $(BASE_PATH)/../3rdparty/coreos-assembler
COSA_ENV ?= $(BASE_PATH)/$(CONTAINER_ENGINE).env COSA_ENV ?= $(BASE_PATH)/$(CONTAINER_ENGINE).env
COSA_INIT_REPO ?= "https://github.com/edgelesssys/constellation-fedora-coreos-config" COSA_INIT_REPO ?= "https://github.com/edgelesssys/constellation-fedora-coreos-config"
COSA_INIT_BRANCH ?= "constellation" COSA_INIT_BRANCH ?= "constellation"
@ -78,6 +79,10 @@ $(DISK_MAPPER_OVERRIDE_PATH): $(DISK_MAPPER_BINARY) | cosa-init
cp $(DISK_MAPPER_BINARY) $@ cp $(DISK_MAPPER_BINARY) $@
chmod +x $@ chmod +x $@
cosa-image:
-make -j 1 -C $(COSA_BUILDDIR) clean
make -j 1 -C $(COSA_BUILDDIR)
cosa-init: cosa-init:
-flock $(COSA_LOCKFILE) -c '. $(COSA_ENV) && cd $(COREOS_BUILD_PATH) && NETRC=$(NETRC) cosa init --branch $(COSA_INIT_BRANCH) $(COSA_INIT_REPO)' -flock $(COSA_LOCKFILE) -c '. $(COSA_ENV) && cd $(COREOS_BUILD_PATH) && NETRC=$(NETRC) cosa init --branch $(COSA_INIT_BRANCH) $(COSA_INIT_REPO)'

View File

@ -62,6 +62,12 @@ Clean up the `build` dir and remove old images (⚠ this will undo any local cha
sudo make clean sudo make clean
``` ```
Ensure you have the modified cosa container image installed:
```shell-session
make cosa-image
```
- Build QEMU image (for local testing only) - Build QEMU image (for local testing only)
```shell-session ```shell-session

View File

@ -1,12 +1,12 @@
cosa() { cosa() {
env | grep COREOS_ASSEMBLER env | grep COREOS_ASSEMBLER
local -r COREOS_ASSEMBLER_CONTAINER_LATEST="ghcr.io/edgelesssys/constellation-coreos-assembler:latest" local -r COREOS_ASSEMBLER_CONTAINER_LATEST="localhost/coreos-assembler-test"
test -t 1 && USE_TTY="-ti" test -t 1 && USE_TTY="-ti"
set -x set -x
docker run --rm ${USE_TTY} --security-opt label=disable --privileged \ docker run --rm ${USE_TTY} --security-opt label=disable --privileged \
-v ${PWD}:/srv/ --device /dev/kvm --device /dev/fuse \ -v ${PWD}:/srv/ --device /dev/kvm --device /dev/fuse \
--tmpfs /tmp -v /var/tmp:/var/tmp --name constellation-cosa --pull always \ --tmpfs /tmp -v /var/tmp:/var/tmp --name constellation-cosa \
${NETRC+-v ${NETRC}:/home/builder/.netrc:ro} \ -v ${NETRC}:/home/builder/.netrc:ro \
${COREOS_ASSEMBLER_CONFIG_GIT:+-v $COREOS_ASSEMBLER_CONFIG_GIT:/srv/src/config/:ro} \ ${COREOS_ASSEMBLER_CONFIG_GIT:+-v $COREOS_ASSEMBLER_CONFIG_GIT:/srv/src/config/:ro} \
${COREOS_ASSEMBLER_GIT:+-v $COREOS_ASSEMBLER_GIT/src/:/usr/lib/coreos-assembler/:ro} \ ${COREOS_ASSEMBLER_GIT:+-v $COREOS_ASSEMBLER_GIT/src/:/usr/lib/coreos-assembler/:ro} \
${COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS} \ ${COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS} \

View File

@ -1,13 +1,13 @@
cosa() { cosa() {
env | grep COREOS_ASSEMBLER env | grep COREOS_ASSEMBLER
local -r COREOS_ASSEMBLER_CONTAINER_LATEST="ghcr.io/edgelesssys/constellation-coreos-assembler:latest" local -r COREOS_ASSEMBLER_CONTAINER_LATEST="localhost/coreos-assembler-test"
test -t 1 && USE_TTY="-ti" test -t 1 && USE_TTY="-ti"
set -x set -x
podman run --rm ${USE_TTY} --security-opt label=disable --privileged \ podman run --rm ${USE_TTY} --security-opt label=disable --privileged \
--uidmap=1000:0:1 --uidmap=0:1:1000 --uidmap 1001:1001:64536 \ --uidmap=1000:0:1 --uidmap=0:1:1000 --uidmap 1001:1001:64536 \
-v ${PWD}:/srv/ --device /dev/kvm --device /dev/fuse \ -v ${PWD}:/srv/ --device /dev/kvm --device /dev/fuse \
--tmpfs /tmp -v /var/tmp:/var/tmp --name constellation-cosa --pull always \ --tmpfs /tmp -v /var/tmp:/var/tmp --name constellation-cosa \
${NETRC+-v ${NETRC}:/home/builder/.netrc:ro} \ -v ${NETRC}:/home/builder/.netrc:ro \
${COREOS_ASSEMBLER_CONFIG_GIT:+-v $COREOS_ASSEMBLER_CONFIG_GIT:/srv/src/config/:ro} \ ${COREOS_ASSEMBLER_CONFIG_GIT:+-v $COREOS_ASSEMBLER_CONFIG_GIT:/srv/src/config/:ro} \
${COREOS_ASSEMBLER_GIT:+-v $COREOS_ASSEMBLER_GIT/src/:/usr/lib/coreos-assembler/:ro} \ ${COREOS_ASSEMBLER_GIT:+-v $COREOS_ASSEMBLER_GIT/src/:/usr/lib/coreos-assembler/:ro} \
${COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS} \ ${COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS} \