Skip to content

Commit

Permalink
Fix: Workflow duplication made updates difficult
Browse files Browse the repository at this point in the history
This replaces the workflows with a "Matrix Strategy" to test a matrix of combinations in parallel.

A new query argument can be used when using old runtimes in order to maintain retro-compatibility: `/status/check/fastapi?retro-compatibility=true`.

Co-authored-by: Andres D. Molins <[email protected]>
  • Loading branch information
hoh and Andres D. Molins committed Oct 13, 2023
1 parent 4b4260b commit 75289ae
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 347 deletions.
105 changes: 31 additions & 74 deletions .github/workflows/build-deb-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@ on:
push

jobs:
build_deb_debian_11:
name: "Build Debian Package"
build_deb:
name: "Build ${{ matrix.os }} Package"
runs-on: ubuntu-latest

strategy:
matrix:
os: ["debian-11", "debian-12", "ubuntu-22.04"]
include:
- os: "debian-11"
make_target: "all-podman-debian-11"
artifact_name: "aleph-vm.debian-11.deb"
- os: "debian-12"
make_target: "all-podman-debian-12"
artifact_name: "aleph-vm.debian-12.deb"
- os: "ubuntu-22.04"
make_target: "all-podman-ubuntu-2204"
artifact_name: "aleph-vm.ubuntu-22.04.deb"
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -15,79 +27,25 @@ jobs:
fetch-depth: 0

- run: |
cd packaging && make all-podman-debian-11 && cd ..
cd packaging && make ${{ matrix.make_target }} && cd ..
ls packaging/target
- uses: actions/upload-artifact@v3
with:
name: aleph-vm.debian-11.deb
path: packaging/target/aleph-vm.debian-11.deb
name: ${{ matrix.artifact_name }}
path: packaging/target/${{ matrix.artifact_name }}

build_deb_debian_12:
name: "Build Debian Package"
build_rootfs:
name: "Build runtime aleph-${{ matrix.os }}-python"
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Fetch the whole history for all tags and branches (required for aleph.__version__)
fetch-depth: 0

- run: |
cd packaging && make all-podman-debian-12 && cd ..
ls packaging/target
- uses: actions/upload-artifact@v3
with:
name: aleph-vm.debian-12.deb
path: packaging/target/aleph-vm.debian-12.deb

build_deb_ubuntu_22_04:
name: "Build Ubuntu Package"
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Fetch the whole history for all tags and branches (required for aleph.__version__)
fetch-depth: 0

- run: |
cd packaging && make all-podman-ubuntu-2204 && cd ..
ls packaging/target
- uses: actions/upload-artifact@v3
with:
name: aleph-vm.ubuntu-22.04.deb
path: packaging/target/aleph-vm.ubuntu-22.04.deb

build_rootfs_debian_11:
name: "Build runtime aleph-debian-11-python"
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Workaround github issue https://github.com/actions/runner-images/issues/7192
run: sudo echo RESET grub-efi/install_devices | sudo debconf-communicate grub-pc

- run: |
sudo apt update
sudo apt install -y debootstrap
cd runtimes/aleph-debian-11-python && sudo ./create_disk_image.sh && cd ../..
- uses: actions/upload-artifact@v3
with:
name: aleph-debian-11-python.squashfs
path: runtimes/aleph-debian-11-python/rootfs.squashfs

build_rootfs_debian_12:
name: "Build runtime aleph-debian-12-python"
runs-on: ubuntu-latest

strategy:
matrix:
os: ["debian-11", "debian-12"]
include:
- os: "debian-11"
artifact_name: "aleph-debian-11-python.squashfs"
- os: "debian-12"
artifact_name: "aleph-debian-12-python.squashfs"
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -98,17 +56,16 @@ jobs:
- run: |
sudo apt update
sudo apt install -y debootstrap
cd runtimes/aleph-debian-12-python && sudo ./create_disk_image.sh && cd ../..
cd runtimes/aleph-${{ matrix.os }}-python && sudo ./create_disk_image.sh && cd ../..
- uses: actions/upload-artifact@v3
with:
name: aleph-debian-12-python.squashfs
path: runtimes/aleph-debian-12-python/rootfs.squashfs
name: ${{ matrix.artifact_name }}
path: runtimes/aleph-${{ matrix.os }}-python/rootfs.squashfs

build_example_venv_volume:
name: "Build example squashfs volume using Docker"
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-new-runtime-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
run: |
doctl compute droplet create \
--image debian-12-x64 \
--size c-2 \
--region fra1 \
--vpc-uuid 992896c8-c089-4da3-9288-f81e28c095a4 \
--size c-4 \
--region ams3 \
--vpc-uuid 5976b7bd-4417-49e8-8522-672aaa920c30 \
--enable-ipv6 \
--ssh-keys b3:ff:08:7f:57:00:fd:7a:14:00:f2:35:0a:f6:e8:55 \
--ssh-keys ab:2b:25:16:46:6f:25:d0:80:63:e5:be:67:04:cb:64 \
aleph-vm-ci-runtime
- name: "Build custom runtime"
Expand Down
88 changes: 0 additions & 88 deletions .github/workflows/test-on-droplet-debian-11.yml

This file was deleted.

88 changes: 0 additions & 88 deletions .github/workflows/test-on-droplet-debian-12.yml

This file was deleted.

Loading

0 comments on commit 75289ae

Please sign in to comment.