Skip to content

Commit 18b0f88

Browse files
committed
Fix: Binary sevctl was absent from debian packages
Solution: Build `sevctl` using an upstream version of Rust (the version in Debian is not supported), and bundle it in the Debian packages. Add a setting in aleph-vm with the path of the bundled binary.
1 parent 3f978c5 commit 18b0f88

11 files changed

+22
-3
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
**/data.tgz
1515
/pydantic/
1616
**/target
17+
/packaging/sevctl/target

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

+4
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ jobs:
2626
- name: Checkout repository
2727
uses: actions/checkout@v4
2828
with:
29+
submodules: true
2930
# Fetch the whole history for all tags and branches (required for aleph.__version__)
3031
fetch-depth: 0
3132

33+
- name: Initialize git submodules
34+
run: git submodule init
35+
3236
- run: |
3337
cd packaging && make ${{ matrix.make_target }} && cd ..
3438
ls packaging/target

.github/workflows/test-on-droplets-matrix.yml

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868
uses: actions/checkout@v4
6969
with:
7070
fetch-depth: 0
71+
submodules: true
7172

7273
- name: Install doctl
7374
uses: digitalocean/action-doctl@v2

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ node_modules
1818
/runtimes/aleph-debian-11-python/rootfs/
1919
/packaging/aleph-vm/opt/
2020
/packaging/target/
21+
/packaging/sevctl/target/
2122
/packaging/repositories/*/db/
2223
/packaging/repositories/*/dists/
2324
/packaging/repositories/*/pool/

.gitmodules

Whitespace-only changes.

packaging/Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ debian-package-code:
1818
pip3 install --target ./aleph-vm/opt/aleph-vm/ 'aleph-message==0.4.4' 'eth-account==0.10' 'sentry-sdk==1.31.0' 'qmp==1.1.0' 'superfluid==0.2.1' 'sqlalchemy[asyncio]>=2.0' 'aiosqlite==0.19.0' 'alembic==1.13.1' 'aiohttp_cors==0.7.0' 'pyroute2==0.7.12'
1919
python3 -m compileall ./aleph-vm/opt/aleph-vm/
2020

21-
debian-package-resources: firecracker-bins vmlinux download-ipfs-kubo
21+
debian-package-resources: firecracker-bins vmlinux download-ipfs-kubo target/bin/sevctl
2222
rm -fr ./aleph-vm/opt/firecracker
2323
mkdir -p ./aleph-vm/opt/firecracker
2424
cp -pr ./target/vmlinux.bin ./aleph-vm/opt/firecracker/
2525
cp -pr ./target/firecracker ./aleph-vm/opt/firecracker/
2626
cp -pr ./target/jailer ./aleph-vm/opt/firecracker/
2727
cp -pr ./target/kubo/kubo ./aleph-vm/opt/kubo
28+
cp -pr ./target/bin/sevctl ./aleph-vm/opt/sevctl
2829

2930
firecracker-bins: target-dir build-dir
3031
mkdir -p ./build/firecracker-release
@@ -45,6 +46,11 @@ download-ipfs-kubo: target-dir build-dir
4546
mkdir -p ./target/kubo
4647
curl -fsSL https://github.com/ipfs/kubo/releases/download/v0.23.0/kubo_v0.23.0_linux-amd64.tar.gz | tar -xz --directory ./target/kubo
4748

49+
target/bin/sevctl:
50+
# Release 0.4.3 matches revision c41c9172be013d6f10b9e1d7286fcb021805d5a5
51+
cargo install --git https://github.com/virtee/sevctl.git --rev c41c9172be013d6f10b9e1d7286fcb021805d5a5 --target x86_64-unknown-linux-gnu --root ./target
52+
./target/bin/sevctl -V
53+
4854
version:
4955
python3 ./version_from_git.py --inplace deb aleph-vm/DEBIAN/control
5056
python3 ./version_from_git.py --inplace __version__ ../src/aleph/vm/version.py
@@ -62,6 +68,7 @@ clean:
6268
rm -fr ./aleph-vm/opt/firecracker/
6369
rm -fr ./aleph-vm/opt/kubo/
6470
rm -fr ./aleph-vm/opt/aleph-vm/
71+
rm -fr ./sevctl/target/
6572

6673
all-podman-debian-11: version
6774
cd .. && podman build -t localhost/aleph-vm-packaging-debian-11:latest -f ./packaging/debian-11.dockerfile .
@@ -86,6 +93,8 @@ all-podman-debian-12: version
8693
mv target/aleph-vm.deb target/aleph-vm.debian-12.deb
8794

8895
all-podman-ubuntu-2204: version
96+
# Ensure the sevctl submodule is checked out first.
97+
git submodule init
8998
cd .. && podman build -t localhost/aleph-vm-packaging-ubuntu-2204:latest -f ./packaging/ubuntu-22.04.dockerfile .
9099
mkdir -p ./target
91100
podman run --rm -ti \

packaging/debian-11.dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bullseye
1+
FROM rust:1.79.0-bullseye
22

33
RUN apt-get update && apt-get -y upgrade && apt-get install -y \
44
make \

packaging/debian-12.dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bookworm
1+
FROM rust:1.79.0-bookworm
22

33
RUN apt-get update && apt-get -y upgrade && apt-get install -y \
44
make \

packaging/ubuntu-22.04.dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y \
66
curl \
77
sudo \
88
python3-pip \
9+
cargo \
910
&& rm -rf /var/lib/apt/lists/*
1011

1112
WORKDIR /opt

packaging/ubuntu-24.04.dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y \
66
curl \
77
sudo \
88
python3-pip \
9+
cargo \
910
&& rm -rf /var/lib/apt/lists/*
1011

1112
WORKDIR /opt

src/aleph/vm/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ class Settings(BaseSettings):
177177

178178
FIRECRACKER_PATH = Path("/opt/firecracker/firecracker")
179179
JAILER_PATH = Path("/opt/firecracker/jailer")
180+
SEV_CTL_PATH = Path("/opt/sevctl")
180181
LINUX_PATH = Path("/opt/firecracker/vmlinux.bin")
181182
INIT_TIMEOUT: float = 20.0
182183

0 commit comments

Comments
 (0)