Skip to content

Commit

Permalink
🐛 Fix arch name in arm artifacts (#2011)
Browse files Browse the repository at this point in the history
* Fix arch name in arm artifacts

Signed-off-by: Mauro Morales <[email protected]>

* Update test to use new artifact names

Signed-off-by: Mauro Morales <[email protected]>

* Fix name of security results

Fix test when calling without ISO

Signed-off-by: Mauro Morales <[email protected]>

---------

Signed-off-by: Mauro Morales <[email protected]>
  • Loading branch information
mauromorales authored Nov 18, 2023
1 parent a658a3f commit cb38c88
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ jobs:
mkdir reports
mv release/*.json reports/
cd reports
sudo tar cvf "kairos-core-${{matrix.flavor}}-amd64-generic-${VERSION}-scan-reports.tar.gz" *.json
filename=$(ls *-grype.json | head -n 1) && filename=${filename%%-grype.json}
sudo tar cvf "${filename}-scan-reports.tar.gz" *.json
mv *.tar.gz ../release/
cd ..
sudo rm -rf release/IMAGE release/VERSION release/versions.yaml
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/reusable-upgrade-latest-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ jobs:
# A flag to set the download target as latest release
# The default value is 'false'
latest: true
# TODO: v2.4.2 Enable once we have a release with the new naming
# fileName: 'kairos-${{ inputs.flavor }}-${{ inputs.flavor_release }}*core-amd64-generic*.iso'
fileName: 'kairos-core-${{ inputs.flavor }}*-amd64-generic*.iso'
fileName: 'kairos-${{ inputs.flavor }}-${{ inputs.flavor_release }}*core-amd64-generic*.iso'
out-file-path: ""
- name: Display structure of downloaded files
run: ls -las .
Expand All @@ -75,9 +73,7 @@ jobs:
- run: |
# release-downloader globing matches more than one iso. Make sure
# we use the right one.
# TODO: v2.4.2 Enable once we have a release with the new naming
# ISO=$(ls kairos-${{ inputs.family }}-${{ inputs.flavor_release }}*core-amd64-generic-v*.iso | grep -v ipxe | head -n 1)
ISO=$(ls kairos-core-${{ inputs.family }}*-amd64-generic-v*.iso | grep -v ipxe | head -n 1)
ISO=$(ls kairos-${{ inputs.family }}-${{ inputs.flavor_release }}*core-amd64-generic-v*.iso | grep -v ipxe | head -n 1)
earthly +run-qemu-test --PREBUILT_ISO=$ISO \
--CONTAINER_IMAGE=ttl.sh/kairos-${{ inputs.flavor }}-${{ inputs.flavor_release }}-${{ github.sha }}:24h \
--TEST_SUITE=upgrade-latest-with-cli
Expand Down
35 changes: 29 additions & 6 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -788,15 +788,32 @@ netboot:
SAVE ARTIFACT /build/$ISO_NAME-initrd initrd AS LOCAL build/$ISO_NAME-initrd
SAVE ARTIFACT /build/$ISO_NAME.ipxe ipxe AS LOCAL build/$ISO_NAME.ipxe

artifact-name:
ARG TARGETARCH
ARG --required FAMILY
ARG --required FLAVOR
ARG --required FLAVOR_RELEASE
ARG --required VARIANT
ARG --required MODEL
ARG --required BASE_IMAGE
ARG --required NAMING_FUNC
ARG --required NAMING_EXT
ARG --required KAIROS_VERSION
FROM ubuntu

COPY ./naming.sh /usr/bin/local/naming.sh
RUN echo $(/usr/bin/local/naming.sh ${NAMING_FUNC})${NAMING_EXT} > /ARTIFACT_NAME
SAVE ARTIFACT /ARTIFACT_NAME ARTIFACT_NAME

arm-image:
ARG OSBUILDER_IMAGE
ARG COMPRESS_IMG=true
ARG IMG_COMPRESSION=xz
FROM $OSBUILDER_IMAGE

COPY +version/VERSION ./
RUN echo "version ${VERSION}"
ARG KAIROS_VERSION=$(cat VERSION)
RUN echo "version ${KAIROS_VERSION}"

ARG TARGETARCH
ARG --required FAMILY
Expand All @@ -806,9 +823,9 @@ arm-image:
ARG --required MODEL
ARG --required BASE_IMAGE

COPY ./naming.sh .
ARG IMAGE_NAME=$(./naming.sh bootable_artifact_name).img
RUN echo $IMAGE_NAME
COPY --platform=linux/arm64 (+artifact-name/ARTIFACT_NAME --KAIROS_VERSION=${KAIROS_VERSION} --NAMING_FUNC=bootable_artifact_name --NAMING_EXT=".img") /ARTIFACT_NAME
ARG IMAGE_NAME=$(cat /ARTIFACT_NAME)
RUN rm /ARTIFACT_NAME
WORKDIR /build
# These sizes are in MB
ENV SIZE="15200"
Expand Down Expand Up @@ -861,8 +878,8 @@ prepare-arm-image:
ARG --required BASE_IMAGE
ARG --required MODEL

COPY ./naming.sh .
ARG IMAGE_NAME=$(./naming.sh bootable_artifact_name).img
COPY --platform=linux/arm64 (+artifact-name/ARTIFACT_NAME --KAIROS_VERSION=${KAIROS_VERSION} --NAMING_FUNC=bootable_artifact_name --NAMING_EXT=".img") /ARTIFACT_NAME
ARG IMAGE_NAME=$(cat /ARTIFACT_NAME)
WORKDIR /build
# These sizes are in MB

Expand Down Expand Up @@ -1131,6 +1148,12 @@ run-qemu-test:
IF [ -n "$PREBUILT_ISO" ]
ENV ISO=/test/$PREBUILT_ISO
ELSE
ARG --required FLAVOR
ARG --required FLAVOR_RELEASE
ARG --required FAMILY
ARG --required BASE_IMAGE
ARG --required MODEL
ARG --required VARIANT
COPY +iso/kairos.iso kairos.iso
ENV ISO=/test/kairos.iso
END
Expand Down

0 comments on commit cb38c88

Please sign in to comment.