Release candidate: 0.2.9-rc1 #631
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
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 fra1 \ | |
--vpc-uuid 992896c8-c089-4da3-9288-f81e28c095a4 \ | |
--enable-ipv6 \ | |
--ssh-keys b3:ff:08:7f:57:00:fd:7a:14:00:f2:35:0a:f6:e8:55 \ | |
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 | |
- 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} "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 |