Skip to content

Commit a23441f

Browse files
committed
Feature: Implement 2 new release workflows that will allow us to release new runtimes and diagnostic VMs easily.
1 parent 07d943d commit a23441f

4 files changed

Lines changed: 183 additions & 12 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 'Build Aleph Runtime Rootfs'
2+
description: 'Builds the Aleph runtime rootfs for a specified OS'
3+
inputs:
4+
os:
5+
description: 'Operating system to build (e.g., debian-12)'
6+
required: true
7+
default: 'debian-12'
8+
artifact-name:
9+
description: 'Name of the artifact to upload'
10+
required: true
11+
outputs:
12+
artifact-name:
13+
description: 'Name of the artifact'
14+
value: ${{ inputs.artifact-name }}
15+
artifact-path:
16+
description: 'Path to the built rootfs'
17+
value: runtimes/aleph-${{ inputs.os }}-python/rootfs.squashfs
18+
runs:
19+
using: 'composite'
20+
steps:
21+
- name: Workaround github issue https://github.com/actions/runner-images/issues/7192
22+
shell: bash
23+
run: sudo echo RESET grub-efi/install_devices | sudo debconf-communicate grub-pc
24+
25+
- name: Install dependencies and build rootfs
26+
shell: bash
27+
run: |
28+
sudo apt update
29+
sudo apt install -y debootstrap
30+
cd runtimes/aleph-${{ inputs.os }}-python && sudo ./create_disk_image.sh && cd ../..
31+
32+
- name: Upload rootfs artifact
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: ${{ inputs.artifact-name }}
36+
path: runtimes/aleph-${{ inputs.os }}-python/rootfs.squashfs

.github/workflows/build-deb-package-and-integration-tests.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,11 @@ jobs:
6363
- name: Checkout repository
6464
uses: actions/checkout@v4
6565

66-
- name: Workaround github issue https://github.com/actions/runner-images/issues/7192
67-
run: sudo echo RESET grub-efi/install_devices | sudo debconf-communicate grub-pc
68-
69-
- name: Install dep and build
70-
run: |
71-
sudo apt update
72-
sudo apt install -y debootstrap
73-
cd runtimes/aleph-${{ matrix.os }}-python && sudo ./create_disk_image.sh && cd ../..
74-
75-
- uses: actions/upload-artifact@v4
66+
- name: Build rootfs
67+
uses: ./.github/actions/build-rootfs
7668
with:
77-
name: ${{ matrix.artifact_name }}
78-
path: runtimes/aleph-${{ matrix.os }}-python/rootfs.squashfs
69+
os: ${{ matrix.os }}
70+
artifact-name: ${{ matrix.artifact_name }}
7971

8072
build_example_venv_volume:
8173
name: "Build example squashfs volume using Docker"
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
name: "Release Diagnostic VM"
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
channel:
7+
description: 'ALEPH channel to deploy to'
8+
required: false
9+
default: 'aleph-vm-ci'
10+
type: string
11+
runtime_hash:
12+
description: 'Runtime hash to use (leave empty for default)'
13+
required: false
14+
type: string
15+
16+
jobs:
17+
build_and_deploy_diagnostic_vm:
18+
name: "Build and Deploy Diagnostic VM"
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Build rootfs
25+
uses: ./.github/actions/build-rootfs
26+
with:
27+
os: debian-12
28+
artifact-name: aleph-debian-12-python.squashfs
29+
30+
- name: Build diagnostic VM package
31+
run: |
32+
cd examples
33+
zip -r diagnostic_vm.zip example_fastapi
34+
ls -lh diagnostic_vm.zip
35+
36+
- name: Setup Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: '3.11'
40+
41+
- name: Install aleph-client
42+
run: |
43+
pip install aleph-client
44+
45+
- name: Extract diagnostic VM
46+
run: |
47+
cd examples
48+
unzip diagnostic_vm.zip -d ../artifacts
49+
ls -la ../artifacts
50+
51+
- name: Upload diagnostic VM to ALEPH network
52+
env:
53+
PRIVATE_KEY: ${{ secrets.ALEPH_WALLET_PRIVATE_KEY }}
54+
run: |
55+
# Build the command
56+
CMD="aleph program upload ./artifacts/example_fastapi main:app --private-key $PRIVATE_KEY --channel ${{ inputs.channel }} --print-messages"
57+
58+
# Add runtime hash if provided
59+
if [ -n "${{ inputs.runtime_hash }}" ]; then
60+
CMD="$CMD --runtime ${{ inputs.runtime_hash }}"
61+
fi
62+
63+
echo "Deploying diagnostic VM..."
64+
eval $CMD
65+
66+
echo "✅ Diagnostic VM deployed successfully to channel: ${{ inputs.channel }}"
67+
68+
- name: Upload artifacts
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: diagnostic-vm-release
72+
path: |
73+
examples/diagnostic_vm.zip
74+
runtimes/aleph-debian-12-python/rootfs.squashfs
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
name: "Release Runtime"
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
os:
7+
description: 'Operating system to build'
8+
required: true
9+
default: 'debian-12'
10+
type: choice
11+
options:
12+
- debian-12
13+
channel:
14+
description: 'ALEPH channel to deploy to'
15+
required: false
16+
default: 'aleph-vm-ci'
17+
type: string
18+
description:
19+
description: 'Description for the runtime release'
20+
required: false
21+
default: 'Aleph VM Runtime'
22+
type: string
23+
24+
jobs:
25+
build_and_release_runtime:
26+
name: "Build and Release Runtime"
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
- name: Build rootfs
33+
uses: ./.github/actions/build-rootfs
34+
with:
35+
os: ${{ inputs.os }}
36+
artifact-name: aleph-${{ inputs.os }}-python.squashfs
37+
38+
- name: Setup Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: '3.11'
42+
43+
- name: Install aleph-client
44+
run: |
45+
pip install aleph-client
46+
47+
- name: Upload runtime to ALEPH network
48+
env:
49+
PRIVATE_KEY: ${{ secrets.ALEPH_WALLET_PRIVATE_KEY }}
50+
run: |
51+
# Upload the runtime squashfs to ALEPH
52+
echo "Uploading runtime to ALEPH network..."
53+
54+
aleph file upload runtimes/aleph-${{ inputs.os }}-python/rootfs.squashfs \
55+
--private-key $PRIVATE_KEY \
56+
--channel ${{ inputs.channel }}
57+
58+
echo "✅ Runtime uploaded successfully to channel: ${{ inputs.channel }}"
59+
echo "Description: ${{ inputs.description }}"
60+
61+
- name: Create release summary
62+
run: |
63+
echo "# Runtime Release Summary" >> $GITHUB_STEP_SUMMARY
64+
echo "" >> $GITHUB_STEP_SUMMARY
65+
echo "- **OS**: ${{ inputs.os }}" >> $GITHUB_STEP_SUMMARY
66+
echo "- **Channel**: ${{ inputs.channel }}" >> $GITHUB_STEP_SUMMARY
67+
echo "- **Description**: ${{ inputs.description }}" >> $GITHUB_STEP_SUMMARY
68+
echo "" >> $GITHUB_STEP_SUMMARY
69+
echo "Runtime has been successfully uploaded to the ALEPH network." >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)