Skip to content

Commit

Permalink
chore: Build new k8s version images (#253)
Browse files Browse the repository at this point in the history
* chore: Build new k8s version images

/build-new-image

* debug ci

* Update binary path

* fix os type

* debug

* fix: Update apt repo

* sync os_distro name between build and function jobs

* change os_distro condition

* remove EOL versions

* Update image loader

---------

Co-authored-by: okozachenko1203 <[email protected]>
  • Loading branch information
okozachenko1203 and okozachenko1203 authored Nov 27, 2023
1 parent ff59cbb commit e30560a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
21 changes: 7 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,11 @@ jobs:
fail-fast: false
matrix:
os_distro:
- ubuntu
- ubuntu-2204
- flatcar
kube:
- v1.24.16
- v1.25.12
- v1.26.7
- v1.27.4
- v1.26.11
- v1.27.8
concurrency:
group: build-images-${{ github.ref }}-${{ matrix.kube }}-${{ matrix.os_distro }}
cancel-in-progress: true
Expand All @@ -172,13 +170,10 @@ jobs:
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- name: Build image
timeout-minutes: 30
run: |
magnum-cluster-api-image-builder \
$HOME/.local/bin/magnum-cluster-api-image-builder \
--operating-system ${{ matrix.os_distro }} \
--version ${{ matrix.kube }}
env:
Expand All @@ -196,13 +191,11 @@ jobs:
fail-fast: false
matrix:
os_distro:
- ubuntu
- ubuntu-2204
- flatcar
kube:
- v1.24.16
- v1.25.12
- v1.26.7
- v1.27.4
- v1.26.11
- v1.27.8
concurrency:
group: functional-${{ github.ref }}-${{ matrix.kube }}-${{ matrix.os_distro }}
cancel-in-progress: true
Expand Down
5 changes: 3 additions & 2 deletions hack/run-functional-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ NODE_COUNT=${NODE_COUNT:-2}
SONOBUOY_VERSION=${SONOBUOY_VERSION:-0.56.16}
SONOBUOY_ARCH=${SONOBUOY_ARCH:-amd64}
DNS_NAMESERVER=${DNS_NAMESERVER:-1.1.1.1}
IMAGE_NAME="${OS_DISTRO}-kube-${KUBE_TAG}"

# Determine image name
[[ "${OS_DISTRO}" == "ubuntu" ]] && IMAGE_NAME="ubuntu-2204-kube-${KUBE_TAG}" || IMAGE_NAME="flatcar-kube-${KUBE_TAG}";
# Determine image os_distro
[[ "${OS_DISTRO}" == ubuntu* ]] && OS_DISTRO="ubuntu" || OS_DISTRO="flatcar";

# If `BUILD_NEW_IMAGE` is true, then we use the provided artifact, otherwise
# we download the latest promoted image.
Expand Down
8 changes: 7 additions & 1 deletion magnum_cluster_api/cmd/image_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def validate_version(_, __, value):
@click.option(
"--version",
show_default=True,
default="v1.27.3",
default="v1.27.8",
callback=validate_version,
help="Kubernetes version",
)
Expand All @@ -77,6 +77,12 @@ def main(ctx: click.Context, operating_system, version, image_builder_version):

ctx.fail(message)

click.echo("- Update apt")
subprocess.run(
["sudo", "/usr/bin/apt-get", "update", "-y"],
check=True,
)

click.echo("- Install QEMU packages")
subprocess.run(
["sudo", "/usr/bin/apt", "install", "--no-install-recommends", "-y"]
Expand Down
2 changes: 2 additions & 0 deletions magnum_cluster_api/cmd/image_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
"v1.25.11",
"v1.26.2",
"v1.26.6",
"v1.26.11",
"v1.27.3",
"v1.27.8",
]


Expand Down

0 comments on commit e30560a

Please sign in to comment.