From ca6baa93f2396f16ca36fb5598f643be192b893a Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Fri, 6 Oct 2023 10:57:51 +0200 Subject: [PATCH 01/42] Fix: CI used wrong project and keys Switch CI workflows back to the original project with a new SSH key. --- .github/workflows/test-new-runtime-examples.yml | 8 ++++---- .github/workflows/test-on-droplet-debian-11.yml | 8 ++++---- .github/workflows/test-on-droplet-debian-12.yml | 8 ++++---- .github/workflows/test-on-droplet-ubuntu-22.04.yml | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test-new-runtime-examples.yml b/.github/workflows/test-new-runtime-examples.yml index 3b2982577..cd0df6978 100644 --- a/.github/workflows/test-new-runtime-examples.yml +++ b/.github/workflows/test-new-runtime-examples.yml @@ -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" diff --git a/.github/workflows/test-on-droplet-debian-11.yml b/.github/workflows/test-on-droplet-debian-11.yml index 3dc052c84..4ce50b5bf 100644 --- a/.github/workflows/test-on-droplet-debian-11.yml +++ b/.github/workflows/test-on-droplet-debian-11.yml @@ -33,11 +33,11 @@ jobs: run: | doctl compute droplet create \ --image debian-11-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-debian-11 - name: Build Debian Package diff --git a/.github/workflows/test-on-droplet-debian-12.yml b/.github/workflows/test-on-droplet-debian-12.yml index 0d59003b9..ab5920f51 100644 --- a/.github/workflows/test-on-droplet-debian-12.yml +++ b/.github/workflows/test-on-droplet-debian-12.yml @@ -33,11 +33,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-debian-12 - name: Build Debian Package diff --git a/.github/workflows/test-on-droplet-ubuntu-22.04.yml b/.github/workflows/test-on-droplet-ubuntu-22.04.yml index 622b1db10..fb1883947 100644 --- a/.github/workflows/test-on-droplet-ubuntu-22.04.yml +++ b/.github/workflows/test-on-droplet-ubuntu-22.04.yml @@ -34,10 +34,10 @@ jobs: doctl compute droplet create \ --image ubuntu-22-04-x64 \ --size c-4 \ - --region fra1 \ - --vpc-uuid 992896c8-c089-4da3-9288-f81e28c095a4 \ + --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-ubuntu-22-04 - name: Build Ubuntu Package From 1339097faf22452828bd4355eb472b31ede071ac Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Fri, 6 Oct 2023 12:13:13 +0200 Subject: [PATCH 02/42] WIP: Add SSH key --- .github/workflows/test-on-droplet-debian-11.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-on-droplet-debian-11.yml b/.github/workflows/test-on-droplet-debian-11.yml index 4ce50b5bf..822401e7c 100644 --- a/.github/workflows/test-on-droplet-debian-11.yml +++ b/.github/workflows/test-on-droplet-debian-11.yml @@ -37,7 +37,7 @@ jobs: --region ams3 \ --vpc-uuid 5976b7bd-4417-49e8-8522-672aaa920c30 \ --enable-ipv6 \ - --ssh-keys ab:2b:25:16:46:6f:25:d0:80:63:e5:be:67:04:cb:64 \ + --ssh-keys ab:2b:25:16:46:6f:25:d0:80:63:e5:be:67:04:cb:64,9e:8b:06:53:e3:fc:6f:42:64:57:bf:1f:aa:54:11:55 \ aleph-vm-ci-debian-11 - name: Build Debian Package From fb7f4247db2ebe23f3bbc0bd8d2237e5417719d3 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Fri, 6 Oct 2023 12:21:25 +0200 Subject: [PATCH 03/42] Fix: CI had no timeout on `until ssh-keyscan` This could cause the droplets to run forever. --- .github/workflows/test-on-droplet-debian-11.yml | 2 ++ .github/workflows/test-on-droplet-debian-12.yml | 2 ++ .github/workflows/test-on-droplet-ubuntu-22.04.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/.github/workflows/test-on-droplet-debian-11.yml b/.github/workflows/test-on-droplet-debian-11.yml index 822401e7c..d7ccdc6a9 100644 --- a/.github/workflows/test-on-droplet-debian-11.yml +++ b/.github/workflows/test-on-droplet-debian-11.yml @@ -7,6 +7,7 @@ jobs: name: "Run in DigitalOcean Droplet with Debian 11" runs-on: ubuntu-latest concurrency: droplet-aleph-vm-debian-11 + timeout-minutes: 10 steps: - name: Checkout repository @@ -49,6 +50,7 @@ jobs: run: | export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-debian-11 --output json | ./.github/scripts/extract_droplet_ipv4.py)" until ssh-keyscan -H ${DROPLET_IPV4}; do sleep 1; done + timeout-minutes: 3 - name: Install Aleph-VM on the Droplet run: | diff --git a/.github/workflows/test-on-droplet-debian-12.yml b/.github/workflows/test-on-droplet-debian-12.yml index ab5920f51..196cc8e53 100644 --- a/.github/workflows/test-on-droplet-debian-12.yml +++ b/.github/workflows/test-on-droplet-debian-12.yml @@ -7,6 +7,7 @@ jobs: name: "Run in DigitalOcean Droplet with Debian 12" runs-on: ubuntu-latest concurrency: droplet-aleph-vm-debian-12 + timeout-minutes: 10 steps: - name: Checkout repository @@ -49,6 +50,7 @@ jobs: run: | export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-debian-12 --output json | ./.github/scripts/extract_droplet_ipv4.py)" until ssh-keyscan -H ${DROPLET_IPV4}; do sleep 1; done + timeout-minutes: 3 - name: Install Aleph-VM on the Droplet run: | diff --git a/.github/workflows/test-on-droplet-ubuntu-22.04.yml b/.github/workflows/test-on-droplet-ubuntu-22.04.yml index fb1883947..6932c2d93 100644 --- a/.github/workflows/test-on-droplet-ubuntu-22.04.yml +++ b/.github/workflows/test-on-droplet-ubuntu-22.04.yml @@ -7,6 +7,7 @@ jobs: name: "Run in DigitalOcean Droplet with Ubuntu 22.04" runs-on: ubuntu-latest concurrency: droplet-aleph-vm-ubuntu-22-04 + timeout-minutes: 10 steps: - name: Checkout repository @@ -49,6 +50,7 @@ jobs: run: | export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-ubuntu-22-04 --output json | ./.github/scripts/extract_droplet_ipv4.py)" until ssh-keyscan -H ${DROPLET_IPV4}; do sleep 1; done + timeout-minutes: 3 - name: Install Aleph-VM on the Droplet run: | From 626bdf6dcdb683de51e19269fe4ac5da7196396d Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Fri, 6 Oct 2023 12:39:18 +0200 Subject: [PATCH 04/42] fixup! Disable teardown --- .github/workflows/test-on-droplet-debian-11.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-on-droplet-debian-11.yml b/.github/workflows/test-on-droplet-debian-11.yml index d7ccdc6a9..46c039a03 100644 --- a/.github/workflows/test-on-droplet-debian-11.yml +++ b/.github/workflows/test-on-droplet-debian-11.yml @@ -87,4 +87,5 @@ jobs: - name: Cleanup if: always() run: | - doctl compute droplet delete -f aleph-vm-ci-debian-11 + ls +# doctl compute droplet delete -f aleph-vm-ci-debian-11 From 2b39a9809786242c851a40d1e63307b74e7421a6 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Fri, 6 Oct 2023 12:47:08 +0200 Subject: [PATCH 05/42] fix: wait longer --- .github/workflows/test-on-droplet-debian-11.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-on-droplet-debian-11.yml b/.github/workflows/test-on-droplet-debian-11.yml index 46c039a03..38375a107 100644 --- a/.github/workflows/test-on-droplet-debian-11.yml +++ b/.github/workflows/test-on-droplet-debian-11.yml @@ -73,7 +73,7 @@ jobs: export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-debian-11 --output json | ./.github/scripts/extract_droplet_ipv4.py)" sleep 3 - curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" + curl --retry 20 --max-time 6 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi" - name: Schedule an instance on the Droplet by faking a call from the scheduler @@ -87,5 +87,4 @@ jobs: - name: Cleanup if: always() run: | - ls -# doctl compute droplet delete -f aleph-vm-ci-debian-11 + doctl compute droplet delete -f aleph-vm-ci-debian-11 From 1a518d5583498050847fa438a1676f3143db188c Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Fri, 6 Oct 2023 12:54:17 +0200 Subject: [PATCH 06/42] keep vm again --- .github/workflows/test-on-droplet-debian-11.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-on-droplet-debian-11.yml b/.github/workflows/test-on-droplet-debian-11.yml index 38375a107..3dd2d4c00 100644 --- a/.github/workflows/test-on-droplet-debian-11.yml +++ b/.github/workflows/test-on-droplet-debian-11.yml @@ -87,4 +87,5 @@ jobs: - name: Cleanup if: always() run: | - doctl compute droplet delete -f aleph-vm-ci-debian-11 + ls +# doctl compute droplet delete -f aleph-vm-ci-debian-11 From 5a50989b045873b24c38d99ebf3bb408aadccd7c Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Fri, 6 Oct 2023 13:28:11 +0200 Subject: [PATCH 07/42] Try using older runtime --- .github/workflows/test-on-droplet-debian-11.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-on-droplet-debian-11.yml b/.github/workflows/test-on-droplet-debian-11.yml index 3dd2d4c00..00d8a552b 100644 --- a/.github/workflows/test-on-droplet-debian-11.yml +++ b/.github/workflows/test-on-droplet-debian-11.yml @@ -66,6 +66,7 @@ jobs: ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt install -y /opt/aleph-vm.debian-11.deb" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_ALLOCATION_TOKEN_HASH=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 >> /etc/aleph-vm/supervisor.env" + ssh root@${DROPLET_IPV4} "echo ALEPH_VM_CHECK_FASTAPI_VM_ID=67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8 >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" - name: Test Aleph-VM on the Droplet From 1c4aba41a7b9194bf74396180b6b03c4e9110ef3 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 9 Oct 2023 17:12:17 +0200 Subject: [PATCH 08/42] Fix: Errors from CI did not appear on Sentry Solution: Add Sentry DSN in GitHub Actions Droplets. --- .github/workflows/test-on-droplet-debian-11.yml | 1 + .github/workflows/test-on-droplet-debian-12.yml | 1 + .github/workflows/test-on-droplet-ubuntu-22.04.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/test-on-droplet-debian-11.yml b/.github/workflows/test-on-droplet-debian-11.yml index 00d8a552b..dcab62820 100644 --- a/.github/workflows/test-on-droplet-debian-11.yml +++ b/.github/workflows/test-on-droplet-debian-11.yml @@ -67,6 +67,7 @@ jobs: ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_ALLOCATION_TOKEN_HASH=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_CHECK_FASTAPI_VM_ID=67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8 >> /etc/aleph-vm/supervisor.env" + ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" - name: Test Aleph-VM on the Droplet diff --git a/.github/workflows/test-on-droplet-debian-12.yml b/.github/workflows/test-on-droplet-debian-12.yml index 196cc8e53..52064fcec 100644 --- a/.github/workflows/test-on-droplet-debian-12.yml +++ b/.github/workflows/test-on-droplet-debian-12.yml @@ -66,6 +66,7 @@ jobs: ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt install -y /opt/aleph-vm.debian-12.deb" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_ALLOCATION_TOKEN_HASH=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 >> /etc/aleph-vm/supervisor.env" + ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" - name: Test Aleph-VM on the Droplet diff --git a/.github/workflows/test-on-droplet-ubuntu-22.04.yml b/.github/workflows/test-on-droplet-ubuntu-22.04.yml index 6932c2d93..51e5dc71e 100644 --- a/.github/workflows/test-on-droplet-ubuntu-22.04.yml +++ b/.github/workflows/test-on-droplet-ubuntu-22.04.yml @@ -68,6 +68,7 @@ jobs: ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt install -y /opt/aleph-vm.ubuntu-22.04.deb" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_ALLOCATION_TOKEN_HASH=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 >> /etc/aleph-vm/supervisor.env" + ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" - name: Test Aleph-VM on the Droplet From edab218cb722eed224497ece69c481d35f27993a Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 9 Oct 2023 17:44:43 +0200 Subject: [PATCH 09/42] fixup! Fix: Errors from CI did not appear on Sentry --- .github/workflows/test-on-droplet-debian-11.yml | 4 ++-- .github/workflows/test-on-droplet-debian-12.yml | 2 +- .github/workflows/test-on-droplet-ubuntu-22.04.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-on-droplet-debian-11.yml b/.github/workflows/test-on-droplet-debian-11.yml index dcab62820..b60afd2d8 100644 --- a/.github/workflows/test-on-droplet-debian-11.yml +++ b/.github/workflows/test-on-droplet-debian-11.yml @@ -66,8 +66,8 @@ jobs: ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt install -y /opt/aleph-vm.debian-11.deb" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_ALLOCATION_TOKEN_HASH=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_CHECK_FASTAPI_VM_ID=67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8 >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> /etc/aleph-vm/supervisor.env" + ssh root@${DROPLET_IPV4} "echo ALEPH_VM_CHECK_FASTAPI_VM_ID=3fc0aa9569da840c43e7bd2033c3c580abb46b007527d6d20f2d4e98e867f7af >> /etc/aleph-vm/supervisor.env" + ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" - name: Test Aleph-VM on the Droplet diff --git a/.github/workflows/test-on-droplet-debian-12.yml b/.github/workflows/test-on-droplet-debian-12.yml index 52064fcec..d06561596 100644 --- a/.github/workflows/test-on-droplet-debian-12.yml +++ b/.github/workflows/test-on-droplet-debian-12.yml @@ -66,7 +66,7 @@ jobs: ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt install -y /opt/aleph-vm.debian-12.deb" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_ALLOCATION_TOKEN_HASH=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> /etc/aleph-vm/supervisor.env" + ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" - name: Test Aleph-VM on the Droplet diff --git a/.github/workflows/test-on-droplet-ubuntu-22.04.yml b/.github/workflows/test-on-droplet-ubuntu-22.04.yml index 51e5dc71e..db683a8ab 100644 --- a/.github/workflows/test-on-droplet-ubuntu-22.04.yml +++ b/.github/workflows/test-on-droplet-ubuntu-22.04.yml @@ -68,7 +68,7 @@ jobs: ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt install -y /opt/aleph-vm.ubuntu-22.04.deb" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_ALLOCATION_TOKEN_HASH=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> /etc/aleph-vm/supervisor.env" + ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" - name: Test Aleph-VM on the Droplet From e548aca926d70ef871c424a527a271ba45c2b3d7 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 10 Oct 2023 10:33:07 +0200 Subject: [PATCH 10/42] Fix: Increase timeout on VM startup. --- .github/workflows/test-on-droplet-debian-11.yml | 10 +++++----- .gitignore | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-on-droplet-debian-11.yml b/.github/workflows/test-on-droplet-debian-11.yml index b60afd2d8..2af29fbc5 100644 --- a/.github/workflows/test-on-droplet-debian-11.yml +++ b/.github/workflows/test-on-droplet-debian-11.yml @@ -56,12 +56,12 @@ jobs: run: | export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-debian-11 --output json | ./.github/scripts/extract_droplet_ipv4.py)" ssh-keyscan -H ${DROPLET_IPV4} > ~/.ssh/known_hosts - + ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get update" ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get upgrade -y" ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get install -y docker.io apparmor-profiles" ssh root@${DROPLET_IPV4} "docker run -d -p 127.0.0.1:4021:4021/tcp --restart=always --name vm-connector alephim/vm-connector:alpha" - + scp packaging/target/aleph-vm.debian-11.deb root@${DROPLET_IPV4}:/opt ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt install -y /opt/aleph-vm.debian-11.deb" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env" @@ -73,10 +73,10 @@ jobs: - name: Test Aleph-VM on the Droplet run: | export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-debian-11 --output json | ./.github/scripts/extract_droplet_ipv4.py)" - + sleep 3 - curl --retry 20 --max-time 6 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" - curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi" + curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" + curl --retry 5 --max-time 20 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi" - name: Schedule an instance on the Droplet by faking a call from the scheduler run: | diff --git a/.gitignore b/.gitignore index cb2fd28d8..7f4b9cf74 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ node_modules /examples/example_http_rust/target/ /examples/example_django/static/admin/ /runtimes/aleph-debian-11-python/rootfs/ +/runtimes/aleph-debian-12-python/rootfs/ /packaging/aleph-vm/opt/ /packaging/target/ /packaging/repositories/*/db/ From 6476b95b51358a5b2f2e1e7e6acc7af671f23863 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Tue, 10 Oct 2023 11:46:43 +0200 Subject: [PATCH 11/42] WIP: Use a Matrix for CI --- .../workflows/test-on-droplet-debian-11.yml | 93 ------------------- .../test-on-droplet-ubuntu-22.04.yml | 93 ------------------- ...ian-12.yml => test-on-droplets-matrix.yml} | 73 +++++++++++---- 3 files changed, 56 insertions(+), 203 deletions(-) delete mode 100644 .github/workflows/test-on-droplet-debian-11.yml delete mode 100644 .github/workflows/test-on-droplet-ubuntu-22.04.yml rename .github/workflows/{test-on-droplet-debian-12.yml => test-on-droplets-matrix.yml} (50%) diff --git a/.github/workflows/test-on-droplet-debian-11.yml b/.github/workflows/test-on-droplet-debian-11.yml deleted file mode 100644 index 2af29fbc5..000000000 --- a/.github/workflows/test-on-droplet-debian-11.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: "Test DigitalOcean Droplet Bullseye" -on: - push - -jobs: - run_debian_11: - name: "Run in DigitalOcean Droplet with Debian 11" - runs-on: ubuntu-latest - concurrency: droplet-aleph-vm-debian-11 - timeout-minutes: 10 - - 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 - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Setup SSH private key - run: | - mkdir ~/.ssh - echo $DIGITALOCEAN_SSH_PRIVATE_KEY | base64 --decode > ~/.ssh/id_ed25519 - chmod 0700 ~/.ssh - chmod 0600 ~/.ssh/id_ed25519 - env: - DIGITALOCEAN_SSH_PRIVATE_KEY: ${{ secrets.DIGITALOCEAN_SSH_PRIVATE_KEY }} - - - name: Create the Droplet - run: | - doctl compute droplet create \ - --image debian-11-x64 \ - --size c-4 \ - --region ams3 \ - --vpc-uuid 5976b7bd-4417-49e8-8522-672aaa920c30 \ - --enable-ipv6 \ - --ssh-keys ab:2b:25:16:46:6f:25:d0:80:63:e5:be:67:04:cb:64,9e:8b:06:53:e3:fc:6f:42:64:57:bf:1f:aa:54:11:55 \ - aleph-vm-ci-debian-11 - - - name: Build Debian Package - run: | - cd packaging && make all-podman-debian-11 && cd .. - ls packaging/target - - - name: Wait for the system to setup and boot - run: | - export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-debian-11 --output json | ./.github/scripts/extract_droplet_ipv4.py)" - until ssh-keyscan -H ${DROPLET_IPV4}; do sleep 1; done - timeout-minutes: 3 - - - name: Install Aleph-VM on the Droplet - run: | - export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-debian-11 --output json | ./.github/scripts/extract_droplet_ipv4.py)" - ssh-keyscan -H ${DROPLET_IPV4} > ~/.ssh/known_hosts - - ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get update" - ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get upgrade -y" - ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get install -y docker.io apparmor-profiles" - ssh root@${DROPLET_IPV4} "docker run -d -p 127.0.0.1:4021:4021/tcp --restart=always --name vm-connector alephim/vm-connector:alpha" - - scp packaging/target/aleph-vm.debian-11.deb root@${DROPLET_IPV4}:/opt - ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt install -y /opt/aleph-vm.debian-11.deb" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_ALLOCATION_TOKEN_HASH=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_CHECK_FASTAPI_VM_ID=3fc0aa9569da840c43e7bd2033c3c580abb46b007527d6d20f2d4e98e867f7af >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" - - - name: Test Aleph-VM on the Droplet - run: | - export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-debian-11 --output json | ./.github/scripts/extract_droplet_ipv4.py)" - - sleep 3 - curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" - curl --retry 5 --max-time 20 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi" - - - name: Schedule an instance on the Droplet by faking a call from the scheduler - run: | - export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-debian-11 --output json | ./.github/scripts/extract_droplet_ipv4.py)" - curl --retry 5 --max-time 10 --fail -X POST -H "Content-Type: application/json" \ - -H "X-Auth-Signature: test" \ - -d '{"persistent_vms": [], "instances": ["67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8"]}' \ - "http://${DROPLET_IPV4}:4020/control/allocations" - - - name: Cleanup - if: always() - run: | - ls -# doctl compute droplet delete -f aleph-vm-ci-debian-11 diff --git a/.github/workflows/test-on-droplet-ubuntu-22.04.yml b/.github/workflows/test-on-droplet-ubuntu-22.04.yml deleted file mode 100644 index db683a8ab..000000000 --- a/.github/workflows/test-on-droplet-ubuntu-22.04.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: "Test on DigitalOcean Droplet Jammy" -on: - push - -jobs: - run_ubuntu_22_04: - name: "Run in DigitalOcean Droplet with Ubuntu 22.04" - runs-on: ubuntu-latest - concurrency: droplet-aleph-vm-ubuntu-22-04 - timeout-minutes: 10 - - 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 - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Setup SSH private key - run: | - mkdir ~/.ssh - echo $DIGITALOCEAN_SSH_PRIVATE_KEY | base64 --decode > ~/.ssh/id_ed25519 - chmod 0700 ~/.ssh - chmod 0600 ~/.ssh/id_ed25519 - env: - DIGITALOCEAN_SSH_PRIVATE_KEY: ${{ secrets.DIGITALOCEAN_SSH_PRIVATE_KEY }} - - - name: Create the Droplet - run: | - doctl compute droplet create \ - --image ubuntu-22-04-x64 \ - --size c-4 \ - --region ams3 \ - --vpc-uuid 5976b7bd-4417-49e8-8522-672aaa920c30 \ - --enable-ipv6 \ - --ssh-keys ab:2b:25:16:46:6f:25:d0:80:63:e5:be:67:04:cb:64 \ - aleph-vm-ci-ubuntu-22-04 - - - name: Build Ubuntu Package - run: | - cd packaging && make all-podman-ubuntu-2204 && cd .. - ls packaging/target - - - name: Wait for the system to setup and boot - run: | - export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-ubuntu-22-04 --output json | ./.github/scripts/extract_droplet_ipv4.py)" - until ssh-keyscan -H ${DROPLET_IPV4}; do sleep 1; done - timeout-minutes: 3 - - - name: Install Aleph-VM on the Droplet - run: | - export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-ubuntu-22-04 --output json | ./.github/scripts/extract_droplet_ipv4.py)" - ssh-keyscan -H ${DROPLET_IPV4} > ~/.ssh/known_hosts - - # Ubuntu droplets run upgrades at boot, which locks apt-get - sleep 30 - until ssh root@${DROPLET_IPV4} "apt-get update" > /dev/null; do sleep 1; echo "Waiting for apt/dpkg lock..."; done - until ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get upgrade -y" > /dev/null; do sleep 1; echo "Waiting for apt/dpkg lock..."; done - until ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get install -y docker.io apparmor-profiles" > /dev/null; do sleep 1; echo "Waiting for apt/dpkg lock..."; done - ssh root@${DROPLET_IPV4} "docker run -d -p 127.0.0.1:4021:4021/tcp --restart=always --name vm-connector alephim/vm-connector:alpha" - - scp packaging/target/aleph-vm.ubuntu-22.04.deb root@${DROPLET_IPV4}:/opt - ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt install -y /opt/aleph-vm.ubuntu-22.04.deb" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_ALLOCATION_TOKEN_HASH=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" - - - name: Test Aleph-VM on the Droplet - run: | - export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-ubuntu-22-04 --output json | ./.github/scripts/extract_droplet_ipv4.py)" - - sleep 3 - curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" - curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi" - - - name: Schedule an instance on the Droplet by faking a call from the scheduler - run: | - export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-ubuntu-22-04 --output json | ./.github/scripts/extract_droplet_ipv4.py)" - curl --retry 5 --max-time 10 --fail -X POST -H "Content-Type: application/json" \ - -H "X-Auth-Signature: test" \ - -d '{"persistent_vms": [], "instances": ["67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8"]}' \ - "http://${DROPLET_IPV4}:4020/control/allocations" - - - name: Cleanup - if: always() - run: | - doctl compute droplet delete -f aleph-vm-ci-ubuntu-22-04 diff --git a/.github/workflows/test-on-droplet-debian-12.yml b/.github/workflows/test-on-droplets-matrix.yml similarity index 50% rename from .github/workflows/test-on-droplet-debian-12.yml rename to .github/workflows/test-on-droplets-matrix.yml index d06561596..0fdceeb42 100644 --- a/.github/workflows/test-on-droplet-debian-12.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -1,19 +1,52 @@ -name: "Test on DigitalOcean Droplet Bookworm" +name: "Test on DigitalOcean Droplet" + on: push jobs: - run_debian_12: - name: "Run in DigitalOcean Droplet with Debian 12" + run_on_droplet: + name: "Run in DigitalOcean Droplet with ${{ matrix.os_name }}" runs-on: ubuntu-latest - concurrency: droplet-aleph-vm-debian-12 + concurrency: "${{ matrix.concurrency_group }}-${{ matrix.check_vm_alias }}"; timeout-minutes: 10 + strategy: + matrix: + + # Check compatibility with all supported OSes. + os_config: + - os_name: "Debian 11" + os_image: "debian-11-x64" + droplet_prefix: "aleph-vm-ci-debian-11" + package_build_command: "all-podman-debian-11" + package_name: "aleph-vm.debian-11.deb" + concurrency_group: "droplet-aleph-vm-debian-11" + + - os_name: "Debian 12" + os_image: "debian-12-x64" + droplet_prefix: "aleph-vm-ci-debian-12" + package_build_command: "all-podman-debian-12" + package_name: "aleph-vm.debian-12.deb" + concurrency_group: "droplet-aleph-vm-debian-12" + + - os_name: "Ubuntu 22.04" + os_image: "ubuntu-22-04-x64" + droplet_prefix: "aleph-vm-ci-ubuntu-22-04" + package_build_command: "all-podman-ubuntu-2204" + package_name: "aleph-vm.ubuntu-22.04.deb" + concurrency_group: "droplet-aleph-vm-ubuntu-22-04" + + # Check compatibility with all supported runtimes. + check_vm: + - check_vm_alias: "runtime-6770" # Old runtime, using Debian 11 + check_vm_id: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" + - check_vm_alias: "runtime-3fc0" # New runtime, using Debian 12 + check_vm_id: "3fc0aa9569da840c43e7bd2033c3c580abb46b007527d6d20f2d4e98e867f7af" + 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 - name: Install doctl @@ -33,28 +66,29 @@ jobs: - name: Create the Droplet run: | doctl compute droplet create \ - --image debian-12-x64 \ + --image ${{ matrix.os_image }} \ --size c-4 \ --region ams3 \ --vpc-uuid 5976b7bd-4417-49e8-8522-672aaa920c30 \ --enable-ipv6 \ - --ssh-keys ab:2b:25:16:46:6f:25:d0:80:63:e5:be:67:04:cb:64 \ - aleph-vm-ci-debian-12 + --ssh-keys b3:ff:08:7f:57:00:fd:7a:14:00:f2:35:0a:f6:e8:55 \ + aleph-vm-ci-${{ matrix.os_name }}-${{ matrix.check_vm_alias }} - - name: Build Debian Package + - name: Build Package run: | - cd packaging && make all-podman-debian-12 && cd .. + cd packaging && make ${{ matrix.package_build_command }} && cd .. ls packaging/target + - name: Wait for the system to setup and boot run: | - export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-debian-12 --output json | ./.github/scripts/extract_droplet_ipv4.py)" + export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" until ssh-keyscan -H ${DROPLET_IPV4}; do sleep 1; done timeout-minutes: 3 - name: Install Aleph-VM on the Droplet run: | - export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-debian-12 --output json | ./.github/scripts/extract_droplet_ipv4.py)" + export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" ssh-keyscan -H ${DROPLET_IPV4} > ~/.ssh/known_hosts ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get update" @@ -62,16 +96,21 @@ jobs: ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get install -y docker.io apparmor-profiles" ssh root@${DROPLET_IPV4} "docker run -d -p 127.0.0.1:4021:4021/tcp --restart=always --name vm-connector alephim/vm-connector:alpha" - scp packaging/target/aleph-vm.debian-12.deb root@${DROPLET_IPV4}:/opt - ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt install -y /opt/aleph-vm.debian-12.deb" + scp packaging/target/${{ matrix.package_name }} root@${DROPLET_IPV4}:/opt + ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt install -y /opt/${{ matrix.package_name }}" + + # Allow some time for IPFS Kubo to start + sleep 5 + ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_ALLOCATION_TOKEN_HASH=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 >> /etc/aleph-vm/supervisor.env" + ssh root@${DROPLET_IPV4} "echo ALEPH_VM_CHECK_FASTAPI_VM_ID=${{ matrix.check_vm_id }} >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" - name: Test Aleph-VM on the Droplet run: | - export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-debian-12 --output json | ./.github/scripts/extract_droplet_ipv4.py)" + export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" sleep 3 curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" @@ -79,7 +118,7 @@ jobs: - name: Schedule an instance on the Droplet by faking a call from the scheduler run: | - export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-debian-12 --output json | ./.github/scripts/extract_droplet_ipv4.py)" + export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" curl --retry 5 --max-time 10 --fail -X POST -H "Content-Type: application/json" \ -H "X-Auth-Signature: test" \ -d '{"persistent_vms": [], "instances": ["67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8"]}' \ @@ -88,4 +127,4 @@ jobs: - name: Cleanup if: always() run: | - doctl compute droplet delete -f aleph-vm-ci-debian-12 + doctl compute droplet delete -f ${{ matrix.droplet_prefix }} From 361b55424cddb5703b1f8a44d9dade932a0c049b Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Tue, 10 Oct 2023 12:00:01 +0200 Subject: [PATCH 12/42] fixup! WIP: Use a Matrix for CI --- .github/workflows/test-on-droplets-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index 0fdceeb42..f190d8893 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -7,7 +7,7 @@ jobs: run_on_droplet: name: "Run in DigitalOcean Droplet with ${{ matrix.os_name }}" runs-on: ubuntu-latest - concurrency: "${{ matrix.concurrency_group }}-${{ matrix.check_vm_alias }}"; + concurrency: "${{ matrix.concurrency_group }}-${{ matrix.check_vm_alias }}" timeout-minutes: 10 strategy: From 9073f9eb9744bfe8e14f2366a8ae944ebc01c626 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Tue, 10 Oct 2023 12:02:09 +0200 Subject: [PATCH 13/42] fixup! WIP: Use a Matrix for CI --- .github/workflows/test-on-droplets-matrix.yml | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index f190d8893..6592d973d 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -5,9 +5,9 @@ on: jobs: run_on_droplet: - name: "Run in DigitalOcean Droplet with ${{ matrix.os_name }}" + name: "Run in DigitalOcean Droplet with ${{ matrix.os_config.os_name }}" runs-on: ubuntu-latest - concurrency: "${{ matrix.concurrency_group }}-${{ matrix.check_vm_alias }}" + concurrency: "${{ matrix.os_config.concurrency_group }}-${{ matrix.check_vm.alias }}" timeout-minutes: 10 strategy: @@ -38,10 +38,10 @@ jobs: # Check compatibility with all supported runtimes. check_vm: - - check_vm_alias: "runtime-6770" # Old runtime, using Debian 11 - check_vm_id: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" - - check_vm_alias: "runtime-3fc0" # New runtime, using Debian 12 - check_vm_id: "3fc0aa9569da840c43e7bd2033c3c580abb46b007527d6d20f2d4e98e867f7af" + - alias: "runtime-6770" # Old runtime, using Debian 11 + item_hash: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" + - alias: "runtime-3fc0" # New runtime, using Debian 12 + item_hash: "3fc0aa9569da840c43e7bd2033c3c580abb46b007527d6d20f2d4e98e867f7af" steps: - name: Checkout repository @@ -66,29 +66,29 @@ jobs: - name: Create the Droplet run: | doctl compute droplet create \ - --image ${{ matrix.os_image }} \ + --image ${{ matrix.os_config.os_image }} \ --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 \ - aleph-vm-ci-${{ matrix.os_name }}-${{ matrix.check_vm_alias }} + aleph-vm-ci-${{ matrix.os_config.os_name }}-${{ matrix.check_vm.alias }} - name: Build Package run: | - cd packaging && make ${{ matrix.package_build_command }} && cd .. + cd packaging && make ${{ matrix.os_config.package_build_command }} && cd .. ls packaging/target - name: Wait for the system to setup and boot run: | - export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" + export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.os_config.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" until ssh-keyscan -H ${DROPLET_IPV4}; do sleep 1; done timeout-minutes: 3 - name: Install Aleph-VM on the Droplet run: | - export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" + export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.os_config.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" ssh-keyscan -H ${DROPLET_IPV4} > ~/.ssh/known_hosts ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get update" @@ -96,21 +96,21 @@ jobs: ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get install -y docker.io apparmor-profiles" ssh root@${DROPLET_IPV4} "docker run -d -p 127.0.0.1:4021:4021/tcp --restart=always --name vm-connector alephim/vm-connector:alpha" - scp packaging/target/${{ matrix.package_name }} root@${DROPLET_IPV4}:/opt - ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt install -y /opt/${{ matrix.package_name }}" + scp packaging/target/${{ matrix.os_config.package_name }} root@${DROPLET_IPV4}:/opt + ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt install -y /opt/${{ matrix.os_config.package_name }}" # Allow some time for IPFS Kubo to start sleep 5 ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_ALLOCATION_TOKEN_HASH=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_CHECK_FASTAPI_VM_ID=${{ matrix.check_vm_id }} >> /etc/aleph-vm/supervisor.env" + ssh root@${DROPLET_IPV4} "echo ALEPH_VM_CHECK_FASTAPI_VM_ID=${{ matrix.check_vm.item_hash }} >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" - name: Test Aleph-VM on the Droplet run: | - export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" + export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.os_config.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" sleep 3 curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" @@ -118,7 +118,7 @@ jobs: - name: Schedule an instance on the Droplet by faking a call from the scheduler run: | - export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" + export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.os_config.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" curl --retry 5 --max-time 10 --fail -X POST -H "Content-Type: application/json" \ -H "X-Auth-Signature: test" \ -d '{"persistent_vms": [], "instances": ["67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8"]}' \ @@ -127,4 +127,4 @@ jobs: - name: Cleanup if: always() run: | - doctl compute droplet delete -f ${{ matrix.droplet_prefix }} + doctl compute droplet delete -f ${{ matrix.os_config.droplet_prefix }} From 8c6d2e2c2a20ca9e5ce99d3bf504be45e29b72d3 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Tue, 10 Oct 2023 12:09:18 +0200 Subject: [PATCH 14/42] fixup! WIP: Use a Matrix for CI --- .github/workflows/test-on-droplets-matrix.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index 6592d973d..2b6de6d3d 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -1,11 +1,11 @@ -name: "Test on DigitalOcean Droplet" +name: "Test on DigitalOcean Droplets" on: push jobs: run_on_droplet: - name: "Run in DigitalOcean Droplet with ${{ matrix.os_config.os_name }}" + name: "Test Droplet with ${{ matrix.os_config.os_name }}-${{ matrix.check_vm.alias }}" runs-on: ubuntu-latest concurrency: "${{ matrix.os_config.concurrency_group }}-${{ matrix.check_vm.alias }}" timeout-minutes: 10 From 2c79877701c76645482b877333fe461b074f1341 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Tue, 10 Oct 2023 12:09:55 +0200 Subject: [PATCH 15/42] fixup! WIP: Use a Matrix for CI --- .github/workflows/test-on-droplets-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index 2b6de6d3d..b493c5975 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -127,4 +127,4 @@ jobs: - name: Cleanup if: always() run: | - doctl compute droplet delete -f ${{ matrix.os_config.droplet_prefix }} + doctl compute droplet delete -f aleph-vm-ci-${{ matrix.os_config.os_name }}-${{ matrix.check_vm.alias }} From 772a7f255b65f11cdf48461577916e5ee10c8888 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Tue, 10 Oct 2023 12:11:51 +0200 Subject: [PATCH 16/42] CI: Build packages using CI matrix --- .github/workflows/build-deb-package.yml | 105 +++++++----------------- 1 file changed, 31 insertions(+), 74 deletions(-) diff --git a/.github/workflows/build-deb-package.yml b/.github/workflows/build-deb-package.yml index 57ee24a71..aaac94502 100644 --- a/.github/workflows/build-deb-package.yml +++ b/.github/workflows/build-deb-package.yml @@ -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 @@ -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 @@ -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 From acd2017b77e46078b7735e249259f14e1df5b432 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Tue, 10 Oct 2023 12:16:53 +0200 Subject: [PATCH 17/42] fixup! fixup! WIP: Use a Matrix for CI --- .github/workflows/test-on-droplets-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index b493c5975..da63e4b19 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -71,7 +71,7 @@ jobs: --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-${{ matrix.os_config.os_name }}-${{ matrix.check_vm.alias }} - name: Build Package From 57007725bd81064f711c1d17b1fce8964bbcfa17 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 10 Oct 2023 12:32:09 +0200 Subject: [PATCH 18/42] Fix: Fixed droplet name to use an os alias. --- .github/workflows/test-on-droplets-matrix.yml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index da63e4b19..28a6b82ac 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -17,21 +17,21 @@ jobs: os_config: - os_name: "Debian 11" os_image: "debian-11-x64" - droplet_prefix: "aleph-vm-ci-debian-11" + alias: "debian-11" package_build_command: "all-podman-debian-11" package_name: "aleph-vm.debian-11.deb" concurrency_group: "droplet-aleph-vm-debian-11" - os_name: "Debian 12" os_image: "debian-12-x64" - droplet_prefix: "aleph-vm-ci-debian-12" + alias: "debian-12" package_build_command: "all-podman-debian-12" package_name: "aleph-vm.debian-12.deb" concurrency_group: "droplet-aleph-vm-debian-12" - os_name: "Ubuntu 22.04" os_image: "ubuntu-22-04-x64" - droplet_prefix: "aleph-vm-ci-ubuntu-22-04" + alias: "ubuntu-22-04" package_build_command: "all-podman-ubuntu-2204" package_name: "aleph-vm.ubuntu-22.04.deb" concurrency_group: "droplet-aleph-vm-ubuntu-22-04" @@ -72,7 +72,7 @@ jobs: --vpc-uuid 5976b7bd-4417-49e8-8522-672aaa920c30 \ --enable-ipv6 \ --ssh-keys ab:2b:25:16:46:6f:25:d0:80:63:e5:be:67:04:cb:64 \ - aleph-vm-ci-${{ matrix.os_config.os_name }}-${{ matrix.check_vm.alias }} + aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} - name: Build Package run: | @@ -82,26 +82,26 @@ jobs: - name: Wait for the system to setup and boot run: | - export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.os_config.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" + export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" until ssh-keyscan -H ${DROPLET_IPV4}; do sleep 1; done timeout-minutes: 3 - name: Install Aleph-VM on the Droplet run: | - export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.os_config.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" + export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" ssh-keyscan -H ${DROPLET_IPV4} > ~/.ssh/known_hosts - + ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get update" ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get upgrade -y" ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get install -y docker.io apparmor-profiles" ssh root@${DROPLET_IPV4} "docker run -d -p 127.0.0.1:4021:4021/tcp --restart=always --name vm-connector alephim/vm-connector:alpha" - + scp packaging/target/${{ matrix.os_config.package_name }} root@${DROPLET_IPV4}:/opt ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt install -y /opt/${{ matrix.os_config.package_name }}" - + # Allow some time for IPFS Kubo to start sleep 5 - + ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_ALLOCATION_TOKEN_HASH=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "echo ALEPH_VM_CHECK_FASTAPI_VM_ID=${{ matrix.check_vm.item_hash }} >> /etc/aleph-vm/supervisor.env" @@ -110,15 +110,15 @@ jobs: - name: Test Aleph-VM on the Droplet run: | - export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.os_config.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" - + export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" + sleep 3 curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi" - name: Schedule an instance on the Droplet by faking a call from the scheduler run: | - export DROPLET_IPV4="$(doctl compute droplet get ${{ matrix.os_config.droplet_prefix }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" + export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" curl --retry 5 --max-time 10 --fail -X POST -H "Content-Type: application/json" \ -H "X-Auth-Signature: test" \ -d '{"persistent_vms": [], "instances": ["67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8"]}' \ @@ -127,4 +127,4 @@ jobs: - name: Cleanup if: always() run: | - doctl compute droplet delete -f aleph-vm-ci-${{ matrix.os_config.os_name }}-${{ matrix.check_vm.alias }} + doctl compute droplet delete -f aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} From 7718db5f8bd39bc41f4867203887b2b55697517e Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 10 Oct 2023 12:55:16 +0200 Subject: [PATCH 19/42] keep vm working --- .github/workflows/test-on-droplets-matrix.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index 28a6b82ac..b5279bc5b 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -127,4 +127,5 @@ jobs: - name: Cleanup if: always() run: | - doctl compute droplet delete -f aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} + ls +# doctl compute droplet delete -f aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} From 0779ac67c33b61e42843e494059498e0f443b537 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 10 Oct 2023 13:13:47 +0200 Subject: [PATCH 20/42] Fix: Don't check lifespan field to maintain retro-compatibility with old diagnostic VM. --- vm_supervisor/views/__init__.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/vm_supervisor/views/__init__.py b/vm_supervisor/views/__init__.py index fd60df618..6faadb9cd 100644 --- a/vm_supervisor/views/__init__.py +++ b/vm_supervisor/views/__init__.py @@ -149,8 +149,8 @@ async def status_check_fastapi(request: web.Request): async with aiohttp.ClientSession() as session: result = { "index": await status.check_index(session), - # TODO: lifespan is a new feature that requires a new runtime to be deployed - "lifespan": await status.check_lifespan(session), + # Retro-compatibility with old diagnostic VM + # "lifespan": await status.check_lifespan(session), "environ": await status.check_environ(session), "messages": await status.check_messages(session), "dns": await status.check_dns(session), @@ -161,7 +161,14 @@ async def status_check_fastapi(request: web.Request): "persistent_storage": await status.check_persistent_storage(session), "error_handling": await status.check_error_raised(session), } - return web.json_response(result, status=200 if all(result.values()) else 503) + + if not all(result.values()): + return web.json_response(result, status=503) + + # Retro-compatibility with old diagnostic VM + result["lifespan"] = await status.check_lifespan(session) + + return web.json_response(result, status=200) async def status_check_version(request: web.Request): From 58a139f13495e11c7e7c9abfe10a4a32160f559c Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Tue, 10 Oct 2023 15:52:10 +0200 Subject: [PATCH 21/42] fixup! Fix: Don't check lifespan field to maintain retro-compatibility with old diagnostic VM. --- vm_supervisor/views/__init__.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/vm_supervisor/views/__init__.py b/vm_supervisor/views/__init__.py index 6faadb9cd..784258972 100644 --- a/vm_supervisor/views/__init__.py +++ b/vm_supervisor/views/__init__.py @@ -146,29 +146,29 @@ async def index(request: web.Request): async def status_check_fastapi(request: web.Request): + retro_compatibility: bool = request.rel_url.query.get('retro-compatibility', 'false') == 'true' + async with aiohttp.ClientSession() as session: result = { "index": await status.check_index(session), - # Retro-compatibility with old diagnostic VM - # "lifespan": await status.check_lifespan(session), "environ": await status.check_environ(session), "messages": await status.check_messages(session), "dns": await status.check_dns(session), "ipv4": await status.check_ipv4(session), - # "ipv6": await status.check_ipv6(session), "internet": await status.check_internet(session), "cache": await status.check_cache(session), "persistent_storage": await status.check_persistent_storage(session), "error_handling": await status.check_error_raised(session), } - - if not all(result.values()): - return web.json_response(result, status=503) - - # Retro-compatibility with old diagnostic VM - result["lifespan"] = await status.check_lifespan(session) - - return web.json_response(result, status=200) + if not retro_compatibility: + # These fields were added in the runtime running Debian 12. + result = result | { + "lifespan": await status.check_lifespan(session), + # IPv6 requires extra work from node operators and is not required yet. + # "ipv6": await status.check_ipv6(session), + } + + return web.json_response(result, status=200 if all(result.values()) else 503) async def status_check_version(request: web.Request): From 812abb137ddf64a2231d4a6aac18fd56a4f9de37 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Tue, 10 Oct 2023 16:03:34 +0200 Subject: [PATCH 22/42] fixup! fixup! Fix: Don't check lifespan field to maintain retro-compatibility with old diagnostic VM. --- .github/workflows/test-on-droplets-matrix.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index b5279bc5b..2a393ecd5 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -40,8 +40,10 @@ jobs: check_vm: - alias: "runtime-6770" # Old runtime, using Debian 11 item_hash: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" + query_params: "?retro-compatibility=false" - alias: "runtime-3fc0" # New runtime, using Debian 12 item_hash: "3fc0aa9569da840c43e7bd2033c3c580abb46b007527d6d20f2d4e98e867f7af" + query_params: "" steps: - name: Checkout repository @@ -109,12 +111,13 @@ jobs: ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" - name: Test Aleph-VM on the Droplet + if: always() run: | export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" sleep 3 curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" - curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi" + curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi${{ matrix.check_vm.query_params }}" - name: Schedule an instance on the Droplet by faking a call from the scheduler run: | From d0017b9f58e34f9f21dd4545c9791f956160f58e Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 10 Oct 2023 16:37:22 +0200 Subject: [PATCH 23/42] Fix: Check distributions one by one. --- .github/workflows/test-on-droplets-matrix.yml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index 2a393ecd5..a82b07e76 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -22,25 +22,25 @@ jobs: package_name: "aleph-vm.debian-11.deb" concurrency_group: "droplet-aleph-vm-debian-11" - - os_name: "Debian 12" - os_image: "debian-12-x64" - alias: "debian-12" - package_build_command: "all-podman-debian-12" - package_name: "aleph-vm.debian-12.deb" - concurrency_group: "droplet-aleph-vm-debian-12" - - - os_name: "Ubuntu 22.04" - os_image: "ubuntu-22-04-x64" - alias: "ubuntu-22-04" - package_build_command: "all-podman-ubuntu-2204" - package_name: "aleph-vm.ubuntu-22.04.deb" - concurrency_group: "droplet-aleph-vm-ubuntu-22-04" +# - os_name: "Debian 12" +# os_image: "debian-12-x64" +# alias: "debian-12" +# package_build_command: "all-podman-debian-12" +# package_name: "aleph-vm.debian-12.deb" +# concurrency_group: "droplet-aleph-vm-debian-12" + +# - os_name: "Ubuntu 22.04" +# os_image: "ubuntu-22-04-x64" +# alias: "ubuntu-22-04" +# package_build_command: "all-podman-ubuntu-2204" +# package_name: "aleph-vm.ubuntu-22.04.deb" +# concurrency_group: "droplet-aleph-vm-ubuntu-22-04" # Check compatibility with all supported runtimes. check_vm: - alias: "runtime-6770" # Old runtime, using Debian 11 item_hash: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" - query_params: "?retro-compatibility=false" + query_params: "?retro-compatibility=true" - alias: "runtime-3fc0" # New runtime, using Debian 12 item_hash: "3fc0aa9569da840c43e7bd2033c3c580abb46b007527d6d20f2d4e98e867f7af" query_params: "" From e13ebc96f8889e512839512b867fbecea79f92eb Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 10 Oct 2023 17:42:59 +0200 Subject: [PATCH 24/42] Fix: Add a bit of delay to supervisor restart. --- .github/workflows/test-on-droplets-matrix.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index a82b07e76..eaff367b7 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -40,10 +40,10 @@ jobs: check_vm: - alias: "runtime-6770" # Old runtime, using Debian 11 item_hash: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" - query_params: "?retro-compatibility=true" + query_params: "" - alias: "runtime-3fc0" # New runtime, using Debian 12 item_hash: "3fc0aa9569da840c43e7bd2033c3c580abb46b007527d6d20f2d4e98e867f7af" - query_params: "" + query_params: "?retro-compatibility=false" steps: - name: Checkout repository @@ -110,12 +110,14 @@ jobs: ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> /etc/aleph-vm/supervisor.env" ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" + # Allow some time for Aleph Supervisor to restart + sleep 5 + - name: Test Aleph-VM on the Droplet if: always() run: | export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" - sleep 3 curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi${{ matrix.check_vm.query_params }}" From cb80c5237493c9c1d1003b78f34486b2f63c0d9a Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 10 Oct 2023 17:58:44 +0200 Subject: [PATCH 25/42] Fix: Move configuration to build step to avoid restart the supervisor later --- .github/workflows/test-on-droplets-matrix.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index eaff367b7..4a3ebb8f5 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -78,6 +78,10 @@ jobs: - name: Build Package run: | + echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> packaging/aleph-vm/etc/aleph-vm/supervisor.env + echo ALEPH_VM_ALLOCATION_TOKEN_HASH=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 >> packaging/aleph-vm/etc/aleph-vm/supervisor.env + echo ALEPH_VM_CHECK_FASTAPI_VM_ID=${{ matrix.check_vm.item_hash }} >> packaging/aleph-vm/etc/aleph-vm/supervisor.env + echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> packaging/aleph-vm/etc/aleph-vm/supervisor.env cd packaging && make ${{ matrix.os_config.package_build_command }} && cd .. ls packaging/target @@ -104,15 +108,6 @@ jobs: # Allow some time for IPFS Kubo to start sleep 5 - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_ALLOCATION_TOKEN_HASH=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_CHECK_FASTAPI_VM_ID=${{ matrix.check_vm.item_hash }} >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> /etc/aleph-vm/supervisor.env" - ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" - - # Allow some time for Aleph Supervisor to restart - sleep 5 - - name: Test Aleph-VM on the Droplet if: always() run: | From df7810033341a9d24dd0982f72e2520c24b8276c Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 10 Oct 2023 18:13:17 +0200 Subject: [PATCH 26/42] Fix Test first with Ubuntu 22.04 --- .github/workflows/test-on-droplets-matrix.yml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index 4a3ebb8f5..d83746e3d 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -15,12 +15,12 @@ jobs: # Check compatibility with all supported OSes. os_config: - - os_name: "Debian 11" - os_image: "debian-11-x64" - alias: "debian-11" - package_build_command: "all-podman-debian-11" - package_name: "aleph-vm.debian-11.deb" - concurrency_group: "droplet-aleph-vm-debian-11" +# - os_name: "Debian 11" +# os_image: "debian-11-x64" +# alias: "debian-11" +# package_build_command: "all-podman-debian-11" +# package_name: "aleph-vm.debian-11.deb" +# concurrency_group: "droplet-aleph-vm-debian-11" # - os_name: "Debian 12" # os_image: "debian-12-x64" @@ -29,21 +29,21 @@ jobs: # package_name: "aleph-vm.debian-12.deb" # concurrency_group: "droplet-aleph-vm-debian-12" -# - os_name: "Ubuntu 22.04" -# os_image: "ubuntu-22-04-x64" -# alias: "ubuntu-22-04" -# package_build_command: "all-podman-ubuntu-2204" -# package_name: "aleph-vm.ubuntu-22.04.deb" -# concurrency_group: "droplet-aleph-vm-ubuntu-22-04" + - os_name: "Ubuntu 22.04" + os_image: "ubuntu-22-04-x64" + alias: "ubuntu-22-04" + package_build_command: "all-podman-ubuntu-2204" + package_name: "aleph-vm.ubuntu-22.04.deb" + concurrency_group: "droplet-aleph-vm-ubuntu-22-04" # Check compatibility with all supported runtimes. check_vm: - alias: "runtime-6770" # Old runtime, using Debian 11 item_hash: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" - query_params: "" + query_params: "?retro-compatibility=true" - alias: "runtime-3fc0" # New runtime, using Debian 12 item_hash: "3fc0aa9569da840c43e7bd2033c3c580abb46b007527d6d20f2d4e98e867f7af" - query_params: "?retro-compatibility=false" + query_params: "" steps: - name: Checkout repository From 834af8fed941fa67eb5d626186d1153c9be078c4 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 10 Oct 2023 20:59:20 +0200 Subject: [PATCH 27/42] Fix: Trying with another diagnostic vm based on Debian 12. --- .github/workflows/test-on-droplets-matrix.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index d83746e3d..62495f37a 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -42,7 +42,7 @@ jobs: item_hash: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" query_params: "?retro-compatibility=true" - alias: "runtime-3fc0" # New runtime, using Debian 12 - item_hash: "3fc0aa9569da840c43e7bd2033c3c580abb46b007527d6d20f2d4e98e867f7af" + item_hash: "14c92c9db5820068a1a0232e523209c007a15ed07720bf08867819a13a4ab900" query_params: "" steps: @@ -85,7 +85,6 @@ jobs: cd packaging && make ${{ matrix.os_config.package_build_command }} && cd .. ls packaging/target - - name: Wait for the system to setup and boot run: | export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" From fb34e40fbfb8c1eda6ea7c6858730ddb17246096 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 10 Oct 2023 21:47:46 +0200 Subject: [PATCH 28/42] Fix: Trying again another diagnostic vm based on Debian 12 with new runtime. --- .github/workflows/test-on-droplets-matrix.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index 62495f37a..d16b1a0fd 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -41,8 +41,8 @@ jobs: - alias: "runtime-6770" # Old runtime, using Debian 11 item_hash: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" query_params: "?retro-compatibility=true" - - alias: "runtime-3fc0" # New runtime, using Debian 12 - item_hash: "14c92c9db5820068a1a0232e523209c007a15ed07720bf08867819a13a4ab900" + - alias: "runtime-3e39" # New runtime, using Debian 12 + item_hash: "3e39ead937d6490647b1fb28db7d9ae4522af8da4349a210c06591cc53d6199b" query_params: "" steps: From 9abfd5c78acb29ca1a0906fe082503e6ea4ff830 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 10 Oct 2023 22:32:03 +0200 Subject: [PATCH 29/42] Fix: Return to original runtime. --- .github/workflows/test-on-droplets-matrix.yml | 4 ++-- vm_supervisor/views/__init__.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index d16b1a0fd..c929403ba 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -41,8 +41,8 @@ jobs: - alias: "runtime-6770" # Old runtime, using Debian 11 item_hash: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" query_params: "?retro-compatibility=true" - - alias: "runtime-3e39" # New runtime, using Debian 12 - item_hash: "3e39ead937d6490647b1fb28db7d9ae4522af8da4349a210c06591cc53d6199b" + - alias: "runtime-3fc0" # New runtime, using Debian 12 + item_hash: "3fc0aa9569da840c43e7bd2033c3c580abb46b007527d6d20f2d4e98e867f7af" query_params: "" steps: diff --git a/vm_supervisor/views/__init__.py b/vm_supervisor/views/__init__.py index 784258972..a60327d95 100644 --- a/vm_supervisor/views/__init__.py +++ b/vm_supervisor/views/__init__.py @@ -146,7 +146,9 @@ async def index(request: web.Request): async def status_check_fastapi(request: web.Request): - retro_compatibility: bool = request.rel_url.query.get('retro-compatibility', 'false') == 'true' + retro_compatibility: bool = ( + request.rel_url.query.get("retro-compatibility", "false") == "true" + ) async with aiohttp.ClientSession() as session: result = { From be8cf6670bfbf58aa7603bc4c6ccd86f3b356fe1 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 10 Oct 2023 23:00:28 +0200 Subject: [PATCH 30/42] Fix: Test with new way to use lifespan. --- .github/workflows/test-on-droplets-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index c929403ba..b78fccc5f 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -42,7 +42,7 @@ jobs: item_hash: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" query_params: "?retro-compatibility=true" - alias: "runtime-3fc0" # New runtime, using Debian 12 - item_hash: "3fc0aa9569da840c43e7bd2033c3c580abb46b007527d6d20f2d4e98e867f7af" + item_hash: "0ef47fb406c06e9f1f896f5a41d8e80bcb2c2d5ac19d53e4e2e35938bba1578b" query_params: "" steps: From dac4837f2555cdd003a5a68484b31345755d60a9 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 10 Oct 2023 23:53:00 +0200 Subject: [PATCH 31/42] Fix: Change again diagnosis vm. --- .github/workflows/test-on-droplets-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index b78fccc5f..77fb7c299 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -42,7 +42,7 @@ jobs: item_hash: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" query_params: "?retro-compatibility=true" - alias: "runtime-3fc0" # New runtime, using Debian 12 - item_hash: "0ef47fb406c06e9f1f896f5a41d8e80bcb2c2d5ac19d53e4e2e35938bba1578b" + item_hash: "d5fb1c0818d4e978892032d2d7929b7c62ed0b32aa4c83643ba96659dd5b23d6" query_params: "" steps: From dd8edfb556c36d4b699a5efb0e739b5a9b92147e Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Wed, 11 Oct 2023 20:09:15 +0200 Subject: [PATCH 32/42] Fix: Try with runtime fixing issue with the middleware. --- .github/workflows/test-on-droplets-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index 77fb7c299..f5c5ba68a 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -42,7 +42,7 @@ jobs: item_hash: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" query_params: "?retro-compatibility=true" - alias: "runtime-3fc0" # New runtime, using Debian 12 - item_hash: "d5fb1c0818d4e978892032d2d7929b7c62ed0b32aa4c83643ba96659dd5b23d6" + item_hash: "7436c69f59309c8ac8ceeac00b7eb0fcc36da3c07930609e99c31a2d4499460a" query_params: "" steps: From cc8317277a5611ecb3f853883ded11b1b6d53b74 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Wed, 11 Oct 2023 20:31:52 +0200 Subject: [PATCH 33/42] Fix: Disable lifespan feature. --- .github/workflows/test-on-droplets-matrix.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index f5c5ba68a..8948fbe4f 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -41,8 +41,8 @@ jobs: - alias: "runtime-6770" # Old runtime, using Debian 11 item_hash: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" query_params: "?retro-compatibility=true" - - alias: "runtime-3fc0" # New runtime, using Debian 12 - item_hash: "7436c69f59309c8ac8ceeac00b7eb0fcc36da3c07930609e99c31a2d4499460a" + - alias: "runtime-a3ff" # New runtime, using Debian 12 + item_hash: "a3ffb10261c7ba167c752508694c45aa6b7b9b404bffd5372ce4f9ac0752c8d0" query_params: "" steps: From c808e7fc7ce31bd55bc9e0f8312d54e945d801d7 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Wed, 11 Oct 2023 20:56:57 +0200 Subject: [PATCH 34/42] Fix: Try with last version of firecracker. --- .github/workflows/test-on-droplets-matrix.yml | 4 ++-- packaging/Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index 8948fbe4f..c929403ba 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -41,8 +41,8 @@ jobs: - alias: "runtime-6770" # Old runtime, using Debian 11 item_hash: "67705389842a0a1b95eaa408b009741027964edc805997475e95c505d642edd8" query_params: "?retro-compatibility=true" - - alias: "runtime-a3ff" # New runtime, using Debian 12 - item_hash: "a3ffb10261c7ba167c752508694c45aa6b7b9b404bffd5372ce4f9ac0752c8d0" + - alias: "runtime-3fc0" # New runtime, using Debian 12 + item_hash: "3fc0aa9569da840c43e7bd2033c3c580abb46b007527d6d20f2d4e98e867f7af" query_params: "" steps: diff --git a/packaging/Makefile b/packaging/Makefile index 48a156a74..93ca9136b 100644 --- a/packaging/Makefile +++ b/packaging/Makefile @@ -31,7 +31,7 @@ debian-package-resources: firecracker-bins vmlinux download-ipfs-kubo firecracker-bins: target-dir build-dir mkdir -p ./build/firecracker-release # Download latest release - curl -fsSL https://github.com/firecracker-microvm/firecracker/releases/download/v1.3.3/firecracker-v1.3.3-x86_64.tgz | tar -xz --no-same-owner --directory ./build/firecracker-release + curl -fsSL https://github.com/firecracker-microvm/firecracker/releases/download/v1.4.1/firecracker-v1.4.1-x86_64.tgz | tar -xz --no-same-owner --directory ./build/firecracker-release # Copy binaries: cp ./build/firecracker-release/release-v*/firecracker-v*[!.debug] ./target/firecracker cp ./build/firecracker-release/release-v*/jailer-v*[!.debug] ./target/jailer From 3c4ca962c355d5e42d1c53e26139cb910747ac5b Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Thu, 12 Oct 2023 13:42:49 +0200 Subject: [PATCH 35/42] Fix: If fails restart the supervisor and try again. --- .github/workflows/test-on-droplets-matrix.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index c929403ba..e7e7f5d17 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -111,9 +111,19 @@ jobs: if: always() run: | export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" + export FASTAPI_URL="http://${DROPLET_IPV4}:4020/status/check/fastapi${{ matrix.check_vm.query_params }}" curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" - curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi${{ matrix.check_vm.query_params }}" + if curl --retry 5 --max-time 10 --fail ${FASTAPI_URL} + else + # If the first execution fails, restart supervisor and try again + ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" + sleep 5 + + curl --retry 5 --max-time 10 --fail ${FASTAPI_URL} + fi + + - name: Schedule an instance on the Droplet by faking a call from the scheduler run: | From 9aa395e01365704ee8b0ffd00cc668ce25aced6c Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Thu, 12 Oct 2023 14:02:00 +0200 Subject: [PATCH 36/42] Fix: fix if condition. --- .github/workflows/test-on-droplets-matrix.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index e7e7f5d17..b76e55817 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -114,7 +114,7 @@ jobs: export FASTAPI_URL="http://${DROPLET_IPV4}:4020/status/check/fastapi${{ matrix.check_vm.query_params }}" curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" - if curl --retry 5 --max-time 10 --fail ${FASTAPI_URL} + if $(curl --retry 5 --max-time 10 --fail ${FASTAPI_URL}); then else # If the first execution fails, restart supervisor and try again ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" @@ -122,8 +122,6 @@ jobs: curl --retry 5 --max-time 10 --fail ${FASTAPI_URL} fi - - - name: Schedule an instance on the Droplet by faking a call from the scheduler run: | From 6308fe2527c598a6fdb5ff6337f3ee80124057cd Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Thu, 12 Oct 2023 14:16:28 +0200 Subject: [PATCH 37/42] Fix: Try with a second job for the test. --- .github/workflows/test-on-droplets-matrix.yml | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index b76e55817..7ed98f07b 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -109,19 +109,21 @@ jobs: - name: Test Aleph-VM on the Droplet if: always() + continue-on-error: true run: | export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" - export FASTAPI_URL="http://${DROPLET_IPV4}:4020/status/check/fastapi${{ matrix.check_vm.query_params }}" curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" - if $(curl --retry 5 --max-time 10 --fail ${FASTAPI_URL}); then - else - # If the first execution fails, restart supervisor and try again - ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" - sleep 5 - - curl --retry 5 --max-time 10 --fail ${FASTAPI_URL} - fi + curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi${{ matrix.check_vm.query_params }}" + + - name: Test Aleph-VM on the Droplet again + if: failure() + run: | + # If the first execution fails, restart supervisor and try again + ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" + sleep 5 + + curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi${{ matrix.check_vm.query_params }}" - name: Schedule an instance on the Droplet by faking a call from the scheduler run: | From e10fdd79ec0d2586332d3d2457457c8e5085e1a2 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Thu, 12 Oct 2023 14:31:05 +0200 Subject: [PATCH 38/42] Fix: Improve this second step to execute only if first fails. --- .github/workflows/test-on-droplets-matrix.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index 7ed98f07b..633f10ce3 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -108,6 +108,7 @@ jobs: sleep 5 - name: Test Aleph-VM on the Droplet + id: test-aleph-vm if: always() continue-on-error: true run: | @@ -116,8 +117,8 @@ jobs: curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/about/usage/system" curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi${{ matrix.check_vm.query_params }}" - - name: Test Aleph-VM on the Droplet again - if: failure() + - name: Test Aleph-VM on the Droplet again restarting the server first + if: steps.test-aleph-vm.conclusion == 'failure' run: | # If the first execution fails, restart supervisor and try again ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" From 37a74eaca69a619a4489998957a19220aa8e9ef1 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Thu, 12 Oct 2023 14:55:41 +0200 Subject: [PATCH 39/42] Fix: Fix step launch state. --- .github/workflows/test-on-droplets-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index 633f10ce3..4901e3b6f 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -118,7 +118,7 @@ jobs: curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi${{ matrix.check_vm.query_params }}" - name: Test Aleph-VM on the Droplet again restarting the server first - if: steps.test-aleph-vm.conclusion == 'failure' + if: steps.test-aleph-vm.outcome == 'failure' run: | # If the first execution fails, restart supervisor and try again ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" From 1efaebc985bf88f084e8d25eea047c6b43dc127c Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Thu, 12 Oct 2023 15:04:59 +0200 Subject: [PATCH 40/42] Fix: Added missing env variable --- .github/workflows/test-on-droplets-matrix.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index 4901e3b6f..f23db3ac5 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -120,6 +120,8 @@ jobs: - name: Test Aleph-VM on the Droplet again restarting the server first if: steps.test-aleph-vm.outcome == 'failure' run: | + export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} --output json | ./.github/scripts/extract_droplet_ipv4.py)" + # If the first execution fails, restart supervisor and try again ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor" sleep 5 From a459c3d91189712982a68ed37658e3b28f7dc1f7 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Thu, 12 Oct 2023 15:15:09 +0200 Subject: [PATCH 41/42] Fix: Delete droplet when finishes --- .github/workflows/test-on-droplets-matrix.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index f23db3ac5..283b5c7f9 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -139,5 +139,4 @@ jobs: - name: Cleanup if: always() run: | - ls -# doctl compute droplet delete -f aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} + doctl compute droplet delete -f aleph-vm-ci-${{ matrix.os_config.alias }}-${{ matrix.check_vm.alias }} From 6e7d9a55b35d2ede00d43c88ef3fe62153051139 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Thu, 12 Oct 2023 16:15:30 +0200 Subject: [PATCH 42/42] Fix: Enable all the platform tests. --- .github/workflows/test-on-droplets-matrix.yml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-on-droplets-matrix.yml b/.github/workflows/test-on-droplets-matrix.yml index 283b5c7f9..353c47dc4 100644 --- a/.github/workflows/test-on-droplets-matrix.yml +++ b/.github/workflows/test-on-droplets-matrix.yml @@ -15,19 +15,19 @@ jobs: # Check compatibility with all supported OSes. os_config: -# - os_name: "Debian 11" -# os_image: "debian-11-x64" -# alias: "debian-11" -# package_build_command: "all-podman-debian-11" -# package_name: "aleph-vm.debian-11.deb" -# concurrency_group: "droplet-aleph-vm-debian-11" - -# - os_name: "Debian 12" -# os_image: "debian-12-x64" -# alias: "debian-12" -# package_build_command: "all-podman-debian-12" -# package_name: "aleph-vm.debian-12.deb" -# concurrency_group: "droplet-aleph-vm-debian-12" + - os_name: "Debian 11" + os_image: "debian-11-x64" + alias: "debian-11" + package_build_command: "all-podman-debian-11" + package_name: "aleph-vm.debian-11.deb" + concurrency_group: "droplet-aleph-vm-debian-11" + + - os_name: "Debian 12" + os_image: "debian-12-x64" + alias: "debian-12" + package_build_command: "all-podman-debian-12" + package_name: "aleph-vm.debian-12.deb" + concurrency_group: "droplet-aleph-vm-debian-12" - os_name: "Ubuntu 22.04" os_image: "ubuntu-22-04-x64"