Skip to content

Commit a74961d

Browse files
Andres D. Molinsnesitor
authored andcommitted
Fix: Disable IPFS service from installation and delete from the current ones, to avoid getting Out-Of-Memory on the CRNs.
1 parent 5e4f6fa commit a74961d

File tree

6 files changed

+21
-99
lines changed

6 files changed

+21
-99
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
4141
- name: Ensure that the relevant files are present in the package
4242
run: |
43-
dpkg --contents packaging/target/${{ matrix.artifact_name }} | grep /opt/kubo/ipfs
4443
dpkg --contents packaging/target/${{ matrix.artifact_name }} | grep /opt/firecracker/firecracker
4544
dpkg --contents packaging/target/${{ matrix.artifact_name }} | grep /opt/firecracker/jailer
4645
dpkg --contents packaging/target/${{ matrix.artifact_name }} | grep /opt/firecracker/vmlinux.bin

packaging/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ debian-package-code:
2222
build_venv/bin/pip install --no-cache-dir --progress-bar off --target ./aleph-vm/opt/aleph-vm/ 'aleph-message~=1.0.1' 'eth-account==0.10' 'sentry-sdk==1.31.0' 'qmp==1.1.0' 'aleph-superfluid~=0.2.1' 'sqlalchemy[asyncio]>=2.0' 'aiosqlite==0.19.0' 'alembic==1.13.1' 'aiohttp_cors==0.7.0' 'pydantic-settings==2.6.1' 'pyroute2==0.7.12' 'python-cpuid==0.1.0' 'solathon==1.0.2' 'protobuf==5.28.3'
2323
build_venv/bin/python3 -m compileall ./aleph-vm/opt/aleph-vm/
2424

25-
debian-package-resources: firecracker-bins vmlinux download-ipfs-kubo target/bin/sevctl
25+
debian-package-resources: firecracker-bins vmlinux target/bin/sevctl
2626
rm -fr ./aleph-vm/opt/firecracker
2727
mkdir -p ./aleph-vm/opt/firecracker
2828
cp -pr ./target/vmlinux.bin ./aleph-vm/opt/firecracker/
2929
cp -pr ./target/firecracker ./aleph-vm/opt/firecracker/
3030
cp -pr ./target/jailer ./aleph-vm/opt/firecracker/
31-
cp -pr ./target/kubo/kubo ./aleph-vm/opt/kubo
31+
# Disable Kubo installation for now
32+
# cp -pr ./target/kubo/kubo ./aleph-vm/opt/kubo
3233
cp -pr ./target/bin/sevctl ./aleph-vm/opt/sevctl
3334

3435
firecracker-bins: target-dir build-dir

packaging/aleph-vm/DEBIAN/postinst

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,27 @@ rm -fr /srv/jailer # Upgrade from < 0.1.11
99
rm -fr /tmp/aleph # Upgrade from < 0.1.11
1010
mkdir -p /var/lib/aleph/vm/jailer
1111

12-
# Create the IPFS directory if it does not exist
13-
if [ ! -d "/var/lib/ipfs" ]; then
14-
mkdir -p /var/lib/ipfs
15-
# Set appropriate permissions if needed
16-
chown ipfs:ipfs /var/lib/ipfs
12+
# Clean the IPFS directory if it does exist
13+
if [ -d "/var/lib/ipfs" ]; then
14+
if ! [[ -v container ]]; then
15+
# Check if service is running to stop it
16+
if systemctl is-active --quiet ipfs.service; then
17+
systemctl stop ipfs.service
18+
fi
19+
20+
# Check if service is enabled to disable it
21+
if systemctl is-enabled --quiet ipfs.service; then
22+
systemctl disable ipfs.service
23+
fi
24+
fi
25+
26+
# Remove existing IPFS files to free some space
27+
rm -rf /var/lib/ipfs
1728
fi
1829

1930
# Systemd is absent from containers
2031
if ! [[ -v container ]]; then
2132
systemctl daemon-reload
22-
systemctl enable ipfs.service
23-
systemctl restart ipfs.service
2433
systemctl enable aleph-vm-supervisor.service
2534
systemctl restart aleph-vm-supervisor.service
2635
fi

packaging/aleph-vm/DEBIAN/preinst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@ fi
1212

1313
set -e
1414

15-
# We will not delete this user on uninstall since there may be files owned by that user in /var/lib/ipfs
16-
addgroup --system ipfs
17-
adduser --system --ingroup ipfs ipfs
15+

packaging/aleph-vm/etc/systemd/system/aleph-vm-supervisor.service

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[Unit]
22
Description=Aleph.im VM execution engine
3-
After=network.target ipfs.service
4-
Wants=ipfs.service
3+
After=network.target
54

65
[Service]
76
User=0

packaging/aleph-vm/etc/systemd/system/ipfs.service

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)