From a237c63e16143bd5b99e7780e30b8ad7adef18b3 Mon Sep 17 00:00:00 2001 From: Rodney Osodo Date: Fri, 29 Nov 2024 12:38:55 +0300 Subject: [PATCH 1/2] fix: preload docker images on cube Signed-off-by: Rodney Osodo --- hal/buildroot/README.md | 25 +++-------------- hal/buildroot/linux/systemd/setup-cube.sh | 7 +++++ hal/ubuntu/README.md | 34 ++--------------------- hal/ubuntu/qemu.sh | 4 +++ 4 files changed, 17 insertions(+), 53 deletions(-) diff --git a/hal/buildroot/README.md b/hal/buildroot/README.md index 81e98f9..72347c7 100644 --- a/hal/buildroot/README.md +++ b/hal/buildroot/README.md @@ -50,31 +50,14 @@ VEK signed the Attestation Report! Measurement from SNP Attestation Report: daa2e216eafd8c6404b72157a130500ab0c0944064c8e1009ebf5e910371caf57a6711654108a01a69baaa1a05759cf0 ``` -Clone the repository. Since this is a private repository, you need to create a classic personal access token with `repo` and `read:packages` permissions. +By default the docker images have been pulled from docker registry and the the docker composition has been started. The folder which contains the docker compose file is at `/mnt/docker/cube/docker`. To see the running containers, run the following command: ```bash -git clone https://github.com/ultravioletrs/cube.git +docker ps -a ``` -Your username is your github username and your password is the access token you generated in step above. - -Login to the docker registry - -```bash -docker login ghcr.io -``` - -Your username is your github username and your password is the access token you generated in step above. - -Pull the docker images - -```bash -cd cube/docker/ -docker compose pull -``` - -Start the docker composition +For local development, replace the following IP address entries in `docker/.env` with the IP address of the qemu virtual machine as follows: ```bash -docker compose up -d + UV_CUBE_NEXTAUTH_URL=http://:${UI_PORT} ``` diff --git a/hal/buildroot/linux/systemd/setup-cube.sh b/hal/buildroot/linux/systemd/setup-cube.sh index 185767a..012c556 100755 --- a/hal/buildroot/linux/systemd/setup-cube.sh +++ b/hal/buildroot/linux/systemd/setup-cube.sh @@ -44,3 +44,10 @@ tee /etc/docker/daemon.json > /dev/null <:${UI_PORT} ``` diff --git a/hal/ubuntu/qemu.sh b/hal/ubuntu/qemu.sh index c813465..307a307 100644 --- a/hal/ubuntu/qemu.sh +++ b/hal/ubuntu/qemu.sh @@ -78,6 +78,10 @@ runcmd: - groupadd docker - usermod -aG docker $USER - newgrp docker + - git clone https://github.com/ultravioletrs/cube.git + - cd cube/docker + - docker compose pull + - docker compose up -d final_message: "Docker installation complete." EOF From 752618bf1401a755c2e47b9f44fa5c9e5ea2710d Mon Sep 17 00:00:00 2001 From: Rodney Osodo Date: Mon, 2 Dec 2024 13:35:04 +0300 Subject: [PATCH 2/2] fix: UI host forwarding Signed-off-by: Rodney Osodo --- hal/buildroot/qemu.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hal/buildroot/qemu.sh b/hal/buildroot/qemu.sh index 22f426a..becf8f9 100644 --- a/hal/buildroot/qemu.sh +++ b/hal/buildroot/qemu.sh @@ -47,7 +47,7 @@ function start_qemu(){ -cpu $CPU_TYPE \ -machine q35 \ -enable-kvm \ - -netdev user,id=vmnic,hostfwd=tcp::6190-:22,hostfwd=tcp::6191-:80,hostfwd=tcp::6192-:443,hostfwd=tcp::6193-:3001,dns=8.8.8.8 \ + -netdev user,id=vmnic,hostfwd=tcp::6190-:22,hostfwd=tcp::6191-:80,hostfwd=tcp::6192-:443,hostfwd=tcp::6193-:6193,dns=8.8.8.8 \ -device virtio-net-pci,disable-legacy=on,iommu_platform=true,netdev=vmnic,romfile= \ -nographic \ -no-reboot \ @@ -74,7 +74,7 @@ function start_cvm(){ -cpu $CPU_TYPE \ -machine q35 \ -enable-kvm \ - -netdev user,id=vmnic,hostfwd=tcp::6190-:22,hostfwd=tcp::6191-:80,hostfwd=tcp::6192-:443,hostfwd=tcp::6193-:3001,dns=8.8.8.8 \ + -netdev user,id=vmnic,hostfwd=tcp::6190-:22,hostfwd=tcp::6191-:80,hostfwd=tcp::6192-:443,hostfwd=tcp::6193-:6193,dns=8.8.8.8 \ -device virtio-net-pci,disable-legacy=on,iommu_platform=true,netdev=vmnic,romfile= \ -nographic \ -no-reboot \