Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitris Karakasilis <[email protected]>
  • Loading branch information
jimmykarily committed Oct 10, 2023
1 parent d8b3a0a commit 0874884
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 66 deletions.
43 changes: 0 additions & 43 deletions .github/flavors-arm.json

This file was deleted.

140 changes: 121 additions & 19 deletions .github/flavors.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,147 @@
[
{
"flavor": "opensuse-leap",
"standard": "true"
"variant": "standard",
"model": "generic",
"baseImage": "opensuse/leap:15.5"
},
{
"flavor": "opensuse-leap",
"variant": "core",
"model": "generic",
"baseImage": "opensuse/leap:15.5"
},
{
"flavor": "opensuse-tumbleweed",
"standard": "true"
"variant": "standard",
"model": "generic",
"baseImage": "opensuse/tumbleweed"
},
{
"flavor": "ubuntu",
"standard": "true"
"flavor": "opensuse-tumbleweed",
"variant": "core",
"model": "generic",
"baseImage": "opensuse/tumbleweed"
},
{
"flavor": "ubuntu-20-lts",
"standard": "true"
"flavor": "ubuntu-20.04",
"variant": "standard",
"model": "generic",
"baseImage": "ubuntu:20.04"
},
{
"flavor": "fips-systemd",
"frameworkonly": "true"
"flavor": "ubuntu-20.04",
"variant": "core",
"model": "generic",
"baseImage": "ubuntu:20.04"
},
{
"flavor": "ubuntu-22-lts",
"standard": "true"
"flavor": "ubuntu-22.04",
"variant": "standard",
"model": "generic",
"baseImage": "ubuntu:22.04"
},
{
"flavor": "ubuntu-22.04",
"variant": "core",
"model": "generic",
"baseImage": "ubuntu:22.04"
},
{
"flavor": "ubuntu-23.04",
"variant": "standard",
"model": "generic",
"baseImage": "ubuntu:23.04"
},
{
"flavor": "ubuntu-23.04",
"variant": "core",
"model": "generic",
"baseImage": "ubuntu:23.04"
},
{
"flavor": "alpine-ubuntu",
"standard": "true"
"variant": "standard",
"model": "generic",
"baseImage": "alpine:3.18"
},
{
"flavor": "alpine-ubuntu",
"variant": "core",
"model": "generic",
"baseImage": "alpine:3.18"
},
{
"flavor": "alpine-opensuse-leap",
"standard": "true"
"variant": "standard",
"model": "generic",
"baseImage": "alpine:3.18"
},
{
"flavor": "fedora",
"standard": "true"
"flavor": "alpine-opensuse-leap",
"variant": "core",
"model": "generic",
"baseImage": "alpine:3.18"
},
{
"flavor": "debian",
"standard": "true"
"flavor": "fedora-38",
"variant": "standard",
"model": "generic",
"baseImage": "fedora:38"
},
{
"flavor": "rockylinux",
"standard": "true"
"flavor": "fedora-38",
"variant": "core",
"model": "generic",
"baseImage": "fedora:38"
},
{
"flavor": "debian-testing",
"variant": "standard",
"model": "generic",
"baseImage": "debian:testing"
},
{
"flavor": "debian-testing",
"variant": "core",
"model": "generic",
"baseImage": "debian:testing"
},
{
"flavor": "almalinux"
"flavor": "debian-bookworm",
"variant": "standard",
"model": "generic",
"baseImage": "debian:bookworm-slim"
},
{
"flavor": "debian-bookworm",
"variant": "core",
"model": "generic",
"baseImage": "debian:bookworm-slim"
},
{
"flavor": "rockylinux-9",
"variant": "standard",
"model": "generic",
"baseImage": "rockylinux:9"
},
{
"flavor": "rockylinux-9",
"variant": "core",
"model": "generic",
"baseImage": "rockylinux:9"
},
{
"flavor": "almalinux-9",
"variant": "standard",
"model": "generic",
"baseImage": "almalinux:9"
},
{
"flavor": "almalinux-9",
"variant": "core",
"model": "generic",
"baseImage": "almalinux:9"
},
{
"flavor": "opensuse-leap",
Expand Down Expand Up @@ -86,5 +183,10 @@
"flavor": "ubuntu-20-lts",
"model": "jetson-agx-orin",
"worker": "fast"
},
{
"TODO": "Remove this, there is only going to be one framwork image",
"flavor": "fips-systemd",
"frameworkonly": "true"
}
]
2 changes: 1 addition & 1 deletion .github/workflows/image-arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
# Construct an array like this from the found versions:
sudo luet --config framework-profile.yaml search -o json k8s/k3s | jq '.packages | map(.version) | unique' > k3s_versions.json
# Create a combination of flavors and k3s versions.
content=$(jq -s '. | [combinations | .[0] + {"k3s_version": .[1]}] | map(select(.frameworkonly != "true")) | map(select(.standard == "true"))' .github/flavors-arm.json k3s_versions.json)
content=$(jq -s '. | [combinations | .[0] + {"k3s_version": .[1]}] | map(select(.frameworkonly != "true")) | map(select(.variant == "standard"))' .github/flavors-arm.json k3s_versions.json)
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
# Construct an array like this from the found versions:
sudo luet --config framework-profile.yaml search -o json k8s/k3s | jq '.packages | map(.version) | unique' > k3s_versions.json
# Create a combination of flavors and k3s versions.
content=$(jq -s '. | [combinations | .[0] + {"k3s_version": .[1]}] | map(select(.frameworkonly != "true")) | map(select(.standard == "true"))' .github/flavors-arm.json k3s_versions.json)
content=$(jq -s '. | [combinations | .[0] + {"k3s_version": .[1]}] | map(select(.frameworkonly != "true")) | map(select(.variant == "standard"))' .github/flavors-arm.json k3s_versions.json)
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
sudo mv luet /usr/bin/luet
# Construct an array like this from the found versions:
sudo luet --config framework-profile.yaml search -o json k8s/k3s | jq '.packages | map(.version) | unique' > k3s_versions.json
content=$(jq -s '. | [combinations | .[0] + {"k3s_version": .[1]}] | map(select(.frameworkonly != "true")) | map(select(.standard == "true"))' .github/flavors.json k3s_versions.json)
content=$(jq -s '. | [combinations | .[0] + {"k3s_version": .[1]}] | map(select(.frameworkonly != "true")) | map(select(.variant == "standard"))' .github/flavors.json k3s_versions.json)
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
Expand Down
64 changes: 63 additions & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ ARG K3S_VERSION

all:
ARG SECURITY_SCANS=true

# args for base-image target
ARG --required FLAVOR
ARG --required BASE_IMAGE
ARG --required MODEL
ARG --required VARIANT

BUILD +base-image
IF [ "$SECURITY_SCANS" = "true" ]
BUILD +image-sbom
Expand All @@ -50,6 +57,13 @@ all:
# For PR building, only image and iso are needed
ci:
ARG SECURITY_SCANS=true

# args for base-image target
ARG --required FLAVOR
ARG --required BASE_IMAGE
ARG --required MODEL
ARG --required VARIANT

BUILD +base-image
IF [ "$SECURITY_SCANS" = "true" ]
BUILD +image-sbom
Expand All @@ -61,6 +75,13 @@ ci:
all-arm:
ARG SECURITY_SCANS=true
ARG MODEL=rpi4

# args for base-image target
ARG --required FLAVOR
ARG --required BASE_IMAGE
ARG --required MODEL
ARG --required VARIANT

BUILD --platform=linux/arm64 +base-image --MODEL=$MODEL
IF [ "$SECURITY_SCANS" = "true" ]
BUILD --platform=linux/arm64 +image-sbom --MODEL=$MODEL
Expand All @@ -76,10 +97,25 @@ all-arm:

arm-container-image:
ARG MODEL

# args for base-image target
ARG --required FLAVOR
ARG --required BASE_IMAGE
ARG --required MODEL
ARG --required VARIANT

BUILD --platform=linux/arm64 +base-image --MODEL=$MODEL

all-arm-generic:
BUILD --platform=linux/arm64 +base-image --MODEL=generic

# args for base-image target
ARG --required FLAVOR
ARG --required BASE_IMAGE
ARG --required MODEL
ARG --required VARIANT

# TODO: Remove this line? +iso calls it eventually
#BUILD --platform=linux/arm64 +base-image --MODEL=generic
BUILD --platform=linux/arm64 +iso --MODEL=generic

build-and-push-golang-testing:
Expand Down Expand Up @@ -861,6 +897,13 @@ trivy:

trivy-scan:
ARG TARGETARCH

# args for base-image target
ARG --required FLAVOR
ARG --required BASE_IMAGE
ARG --required MODEL
ARG --required VARIANT

# Use base-image so it can read original os-release file
FROM +base-image
COPY +trivy/trivy /trivy
Expand Down Expand Up @@ -889,6 +932,13 @@ grype:

grype-scan:
ARG TARGETARCH

# args for base-image target
ARG --required FLAVOR
ARG --required BASE_IMAGE
ARG --required MODEL
ARG --required VARIANT

# Use base-image so it can read original os-release file
FROM +base-image
COPY +grype/grype /grype
Expand Down Expand Up @@ -1146,6 +1196,12 @@ temp-image:

ARG TTL_IMAGE = "ttl.sh/${NAME}:${EXPIRATION}"

# args for base-image target
ARG --required FLAVOR
ARG --required BASE_IMAGE
ARG --required MODEL
ARG --required VARIANT

FROM +base-image
SAVE IMAGE --push $TTL_IMAGE

Expand Down Expand Up @@ -1185,6 +1241,12 @@ bump-repositories:
SAVE ARTIFACT framework-profile.yaml AS LOCAL framework-profile.yaml

luet-versions:
# args for base-image target
ARG --required FLAVOR
ARG --required BASE_IMAGE
ARG --required MODEL
ARG --required VARIANT

FROM +base-image
SAVE ARTIFACT /framework/etc/kairos/versions.yaml versions.yaml AS LOCAL build/versions.yaml

Expand Down

0 comments on commit 0874884

Please sign in to comment.