Skip to content

Commit 493337e

Browse files
authored
Merge branch 'main' into hoh-update-vm-connector
2 parents 6b1781f + 467098e commit 493337e

File tree

146 files changed

+8242
-3260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+8242
-3260
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
**/data.tgz
1515
/pydantic/
1616
**/target
17+
/packaging/sevctl/target

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Explain what problem this PR is resolving
2+
3+
Related ClickUp, GitHub or Jira tickets : ALEPH-XXX
4+
5+
## Self proofreading checklist
6+
7+
- [ ] The new code clear, easy to read and well commented.
8+
- [ ] New code does not duplicate the functions of builtin or popular libraries.
9+
- [ ] An LLM was used to review the new code and look for simplifications.
10+
- [ ] New classes and functions contain docstrings explaining what they provide.
11+
- [ ] All new code is covered by relevant tests.
12+
- [ ] Documentation has been updated regarding these changes.
13+
- [ ] Dependencies update in the project.toml have been mirrored in the Debian package build script `packaging/Makefile`
14+
15+
## Changes
16+
17+
Explain the changes that were made. The idea is not to list exhaustively all the changes made (GitHub already provides a full diff), but to help the reviewers better understand:
18+
- which specific file changes go together, e.g: when creating a table in the front-end, there usually is a config file that goes with it
19+
- the reasoning behind some changes, e.g: deleted files because they are now redundant
20+
- the behaviour to expect, e.g: tooltip has purple background color because the client likes it so, changed a key in the API response to be consistent with other endpoints
21+
22+
## How to test
23+
24+
Explain how to test your PR.
25+
If a specific config is required explain it here (account, data entry, ...)
26+
27+
## Print screen / video
28+
29+
Upload here screenshots or videos showing the changes if relevant.
30+
31+
## Notes
32+
33+
Things that the reviewers should know: known bugs that are out of the scope of the PR, other trade-offs that were made.
34+
If the PR depends on a PR in another repo, or merges into another PR (i.o. main), it should also be mentioned here

.github/workflows/build-deb-package.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,49 @@
1+
---
12
name: "Build Packages"
2-
on:
3-
push
3+
on: push
4+
45

56
jobs:
67
build_deb:
78
name: "Build ${{ matrix.os }} Package"
89
runs-on: ubuntu-latest
910
strategy:
11+
fail-fast: false
1012
matrix:
11-
os: ["debian-11", "debian-12", "ubuntu-22.04"]
13+
os: ["debian-12", "ubuntu-22.04", "ubuntu-24.04"]
1214
include:
13-
- os: "debian-11"
14-
make_target: "all-podman-debian-11"
15-
artifact_name: "aleph-vm.debian-11.deb"
1615
- os: "debian-12"
1716
make_target: "all-podman-debian-12"
1817
artifact_name: "aleph-vm.debian-12.deb"
1918
- os: "ubuntu-22.04"
2019
make_target: "all-podman-ubuntu-2204"
2120
artifact_name: "aleph-vm.ubuntu-22.04.deb"
21+
- os: "ubuntu-24.04"
22+
make_target: "all-podman-ubuntu-2404"
23+
artifact_name: "aleph-vm.ubuntu-24.04.deb"
2224
steps:
2325
- name: Checkout repository
2426
uses: actions/checkout@v4
2527
with:
28+
submodules: true
2629
# Fetch the whole history for all tags and branches (required for aleph.__version__)
2730
fetch-depth: 0
2831

32+
- name: Initialize git submodules
33+
run: git submodule init
34+
2935
- run: |
3036
cd packaging && make ${{ matrix.make_target }} && cd ..
3137
ls packaging/target
3238
39+
- name: Ensure that the relevant files are present in the package
40+
run: |
41+
dpkg --contents packaging/target/${{ matrix.artifact_name }} | grep /opt/kubo/ipfs
42+
dpkg --contents packaging/target/${{ matrix.artifact_name }} | grep /opt/firecracker/firecracker
43+
dpkg --contents packaging/target/${{ matrix.artifact_name }} | grep /opt/firecracker/jailer
44+
dpkg --contents packaging/target/${{ matrix.artifact_name }} | grep /opt/firecracker/vmlinux.bin
45+
dpkg --contents packaging/target/${{ matrix.artifact_name }} | grep /opt/sevctl
46+
3347
- uses: actions/upload-artifact@v4
3448
with:
3549
name: ${{ matrix.artifact_name }}
@@ -40,10 +54,8 @@ jobs:
4054
runs-on: ubuntu-latest
4155
strategy:
4256
matrix:
43-
os: ["debian-11", "debian-12"]
57+
os: ["debian-12"]
4458
include:
45-
- os: "debian-11"
46-
artifact_name: "aleph-debian-11-python.squashfs"
4759
- os: "debian-12"
4860
artifact_name: "aleph-debian-12-python.squashfs"
4961
steps:

.github/workflows/codeql-analysis.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# For most projects, this workflow file will not need changing; you simply need
23
# to commit it to your repository.
34
#
@@ -11,15 +12,17 @@
1112
#
1213
name: "CodeQL"
1314

15+
1416
on:
1517
push:
16-
branches: [ main ]
18+
branches: [main]
1719
pull_request:
1820
# The branches below must be a subset of the branches above
19-
branches: [ main ]
21+
branches: [main]
2022
schedule:
2123
- cron: '15 16 * * 0'
2224

25+
2326
jobs:
2427
analyze:
2528
name: Analyze
@@ -32,29 +35,29 @@ jobs:
3235
strategy:
3336
fail-fast: false
3437
matrix:
35-
language: [ 'python' ]
38+
language: ['python']
3639
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
3740
# Learn more:
3841
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
3942

4043
steps:
41-
- name: Checkout repository
42-
uses: actions/checkout@v4
44+
- name: Checkout repository
45+
uses: actions/checkout@v4
4346

4447
# Initializes the CodeQL tools for scanning.
45-
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v3
47-
with:
48-
languages: ${{ matrix.language }}
48+
- name: Initialize CodeQL
49+
uses: github/codeql-action/init@v3
50+
with:
51+
languages: ${{ matrix.language }}
4952
# If you wish to specify custom queries, you can do so here or in a config file.
5053
# By default, queries listed here will override any specified in a config file.
5154
# Prefix the list here with "+" to use these queries and those in the config file.
5255
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5356

5457
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5558
# If this step fails, then you should remove it and run the build manually (see below)
56-
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v3
59+
- name: Autobuild
60+
uses: github/codeql-action/autobuild@v3
5861

5962
# ℹ️ Command-line programs to run using the OS shell.
6063
# 📚 https://git.io/JvXDl
@@ -67,5 +70,5 @@ jobs:
6770
# make bootstrap
6871
# make release
6972

70-
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v3
73+
- name: Perform CodeQL Analysis
74+
uses: github/codeql-action/analyze@v3
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
# This workflow automatically deploys main on staging
3+
name: "Deploy `main` automatically on staging"
4+
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
11+
12+
jobs:
13+
deploy_staging_servers:
14+
name: "Deploying on ${{ matrix.staging_servers.hostname }}"
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
staging_servers:
19+
- hostname: "ovh.staging.aleph.sh"
20+
# Use `ssh-keyscan -H host | base64 --wrap=0` to obtain the host keys
21+
host_keys: "fDF8b3JHVkxyOU83Qnh0QmkvWjd4N0lVTkRDSHFRPXwxZEdZSnNjNlFyejA5QkR6cGROR1BLYjNES009IHNzaC1yc2EgQUFBQUIzTnphQzF5YzJFQUFBQURBUUFCQUFBQmdRRHZwSmNpV2dscTNCbEsxY2xOUmNETnVQeFVCeGF3bE5qVElHZFV2MmoyTVo4KzliVVpDSkI1aXFIKzNvbkc5Vklla1RQdW1ybFlXbFMvZkkvSzM3dTh5UXJuQ3JkNi9XRm9XWWJOaTJ4NWxSOUhzaTViRXQ4MFAwRkFyVVpaSkdzbnRQdVhGeFJGR3dHeFNENTN2emVMbmU4VjRlaUxrQ3BjMDU5YzZVVHBublcvSjdRRnlzZURDUXIwVzFsMzBNcjlnTm1LbmpBd2VLWXdCS0hYaG42VGdSd1RYT1E3VXJCc3c2Q1d0OHI2N2g4QkJ2UHQ5OWt5OHl4dUw2Z25TRlhqeWhyKzVhd1lTY3VhVU5JS3B0Y2JFOWpISHhEY1FLSHN0akZZRHRsM0JWN29rUEkvUWJablpSMDVTdDgvZldoK2p5K3ZtR3BTWmtFckJ2NkUwdFhHMDhmdkdheVRXNWFVcWxRQmlLMzJpNmJlUWordjI3b0pUWndvcndBOVJCY1QramlCWVRNVUFpTTJrblhXMGlqT2ViWDNackpITm5QbXJkbjBTd1JldGlLRzg2SGdRK3d3a0dwd3UxVk01eTFlbTVwZ0VUdnU5SHg1RTFKeEJLcXJ3ZkdhTVVRWFZEWG8yNDg5bW1XZzA1aUFHejZIaXNTVWRESFlRKzhnWnA4PQp8MXxvUzkyc1NEb3RxU1hSb0F6MUpFS1V2RDhVTGM9fDVtSHZBSVdqbk1CN2IwcllRQlo0SXBpaFlqQT0gZWNkc2Etc2hhMi1uaXN0cDI1NiBBQUFBRTJWalpITmhMWE5vWVRJdGJtbHpkSEF5TlRZQUFBQUlibWx6ZEhBeU5UWUFBQUJCQkZNanZFOEFsQmYxbkp1Y0ZlaEJjSUY2RE8wdGJOdU96OEx5QlFUdC82RlEwaWYyWVAxQUJ1TjBmYXVIT3R4WEx6b25vSGVhTDZaV0JoakhmRGV4NlY4PQp8MXxMc2lPc3RhVGk5bEhYSlFsWDJYQ3c3Q0lTU1k9fGk1RzlFTHJydHpaYkUrR2JjbWF1SDIxOG1ZND0gc3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUp1QVNEMWY1d2dXM3pnd3FGalBXYzhPRi9BZ1pmSFFVa3lRMDE2c1MrRmoK"
22+
os: "debian-12"
23+
make_target: "all-podman-debian-12"
24+
artifact_name: "aleph-vm.debian-12.deb"
25+
26+
- hostname: "hetzner.staging.aleph.sh"
27+
# Use `ssh-keyscan -H host | base64 --wrap=0` to obtain the host keys
28+
host_keys: "fDF8WUlKd0FYWnYxZ24vNkRCU0tkYjg0TC9sUngwPXwrRk96RzdoSTJ5Y3JzUW1uSEwrdEFBQkR4YUU9IHNzaC1yc2EgQUFBQUIzT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cktMeUg4ZnJJR0lRV05RS3hiUnArNlIvTT0gc3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUl5ZGNhTXF1dkZFTEpNUDBlRmhNUGJWZVBSVjlSUEhVRzhIZGZIQmRvaTEK"
29+
os: "debian-12"
30+
make_target: "all-podman-debian-12"
31+
artifact_name: "aleph-vm.debian-12.deb"
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v4
36+
with:
37+
# Fetch the whole history for all tags and branches (required for aleph.__version__)
38+
fetch-depth: 0
39+
40+
- run: |
41+
cd packaging && make ${{ matrix.staging_servers.make_target }} && cd ..
42+
ls packaging/target
43+
44+
- name: Setup SSH private key
45+
run: |
46+
mkdir ~/.ssh
47+
echo $STAGING_SSH_PRIVATE_KEY | base64 --decode > ~/.ssh/id_ed25519
48+
chmod 0700 ~/.ssh
49+
chmod 0600 ~/.ssh/id_ed25519
50+
env:
51+
# Create using:
52+
# ssh-keygen -t ed25519 -f ./id_ed25519
53+
# cat ./id_ed25519 | base64 --wrap=0
54+
STAGING_SSH_PRIVATE_KEY: ${{ secrets.STAGING_SSH_PRIVATE_KEY }}
55+
56+
- name: Install Aleph-VM on the Staging servers
57+
run: |-
58+
echo ${{ matrix.staging_servers.host_keys }} | base64 --decode > ~/.ssh/known_hosts
59+
60+
# Wait for /var/lib/apt/lists/lock to be unlocked on the remote host via SSH.
61+
while ssh root@${{ matrix.staging_servers.hostname }} lsof /var/lib/apt/lists/lock; do sleep 1; done
62+
63+
scp packaging/target/${{ matrix.staging_servers.artifact_name }} root@${{ matrix.staging_servers.hostname }}:/opt
64+
ssh root@${{ matrix.staging_servers.hostname }} DEBIAN_FRONTEND=noninteractive "apt-get -o DPkg::Lock::Timeout=60 install -y --allow-downgrades /opt/${{ matrix.staging_servers.artifact_name }}"

.github/workflows/pr-rating.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
---
12
name: Test PR Difficulty Rating Action
23

4+
35
permissions:
46
pull-requests: write
57

8+
69
on:
710
pull_request:
811
types: [opened, reopened, ready_for_review]
912

13+
1014
jobs:
1115
difficulty-rating:
1216
runs-on: ubuntu-latest

.github/workflows/test-build-examples.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
1+
---
22

33
name: "Build Examples"
4-
on:
5-
push
4+
on: push
5+
66

77
jobs:
88
build_pip:

.github/workflows/test-new-runtime-examples.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
---
12
name: "Test new runtime and examples"
2-
on:
3-
push
3+
on: push
4+
45

56
jobs:
67
run_debian_12:
@@ -74,12 +75,12 @@ jobs:
7475
run: |
7576
export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-runtime --output json | ./.github/scripts/extract_droplet_ipv4.py)"
7677
ssh-keyscan -H ${DROPLET_IPV4} > ~/.ssh/known_hosts
77-
78+
7879
ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get -o DPkg::Lock::Timeout=60 update"
7980
ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get -o DPkg::Lock::Timeout=60 upgrade -y"
8081
ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get -o DPkg::Lock::Timeout=60 install -y docker.io apparmor-profiles"
8182
ssh root@${DROPLET_IPV4} "docker run -d -p 127.0.0.1:4021:4021/tcp --restart=always --name vm-connector alephim/vm-connector:alpha"
82-
83+
8384
scp packaging/target/aleph-vm.debian-12.deb root@${DROPLET_IPV4}:/opt
8485
scp -pr ./examples root@${DROPLET_IPV4}:/opt/
8586
ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt -o DPkg::Lock::Timeout=60 install -y /opt/aleph-vm.debian-12.deb"
@@ -91,7 +92,7 @@ jobs:
9192
- name: Test Aleph-VM on the Droplet
9293
run: |
9394
export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-runtime --output json | ./.github/scripts/extract_droplet_ipv4.py)"
94-
95+
9596
sleep 3
9697
curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/about/usage/system"
9798
curl --retry 5 --max-time 10 --fail "http://${DROPLET_IPV4}:4020/status/check/fastapi"
@@ -104,5 +105,5 @@ jobs:
104105
105106
- name: Cleanup
106107
if: always()
107-
run: |
108+
run: |-
108109
doctl compute droplet delete -f aleph-vm-ci-runtime

0 commit comments

Comments
 (0)