Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOISSUE - Preload docker images to the vm #42

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions hal/buildroot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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://<ip-address>:${UI_PORT}
```
7 changes: 7 additions & 0 deletions hal/buildroot/linux/systemd/setup-cube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,10 @@ tee /etc/docker/daemon.json > /dev/null <<EOF
EOF

systemctl start docker

# Setup Cube AI
cd /mnt/docker
git clone https://github.com/ultravioletrs/cube.git
cd cube/docker
docker compose pull
docker compose up -d
4 changes: 2 additions & 2 deletions hal/buildroot/qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
34 changes: 2 additions & 32 deletions hal/ubuntu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,8 @@ This directory contains the cloud-init configuration files for Cube AI.

## After the first boot

1. Generate access token from github to be able to pull the docker images and code from github
2. Login to the docker registry
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 login ghcr.io
```

Your username is your github username and your password is the access token you generated in step 1.

3. Clone the repository

```bash
git clone https://github.com/ultravioletrs/cube.git
```

Your username is your github username and your password is the access token you generated in step 1.

4. Pull the docker images

```bash
cd cube/docker/
docker compose pull
```

5. For local development, replace the following IP address entries in `docker/.env` with your local IP address as follows:

```bash
UV_CUBE_NEXTAUTH_URL=http://localhost:${UI_PORT}
```

6. Start the docker containers

```bash
docker compose up -d
UV_CUBE_NEXTAUTH_URL=http://<ip-address>:${UI_PORT}
```
4 changes: 4 additions & 0 deletions hal/ubuntu/qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down