Skip to content

Commit fa3242e

Browse files
committed
update readme
1 parent b7e04fa commit fa3242e

File tree

1 file changed

+64
-17
lines changed

1 file changed

+64
-17
lines changed

vm-images/README.md

Lines changed: 64 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,78 @@
1-
# VM Images for OpenStack
1+
# VM Images
22

3-
Creates Ubuntu VM Images with following things installed:
3+
Builds Ubuntu 24.04 images for OpenStack with Docker and NVIDIA drivers (GPU only).
44

5-
- Nvidia drivers (GPU images only)
6-
- Docker
5+
## Quick Start
6+
7+
From the repo root, run:
78

8-
The created image is uploaded to a GCS bucket, which is then retrieved by a self-hosted GHA runner running on our OpenStack instance.
9+
```bash
10+
# Build CPU image (can run anywhere)
11+
make build-cpu
912

10-
## GHA workflows
13+
# Build GPU image (MUST run on GPU server)
14+
make build-gpu
1115

12-
These should automate the creation of the images:
16+
# Upload to OpenStack
17+
make upload-cpu
18+
make upload-gpu
19+
```
1320

14-
- `.github/workflows/build-vm-images.yml` - Github Action to build the image
15-
- `.github/workflows/openstack.yml` - Github Action to upload the VM image to OpenStack
21+
## Requirements
1622

17-
## Building manually on Linux
23+
- `uv` package manager ([install here](https://docs.astral.sh/uv/))
24+
- Linux (builds won't work on Mac)
25+
- Root access (diskimage-builder needs it)
26+
- OpenStack credentials from `/etc/kolla/admin-openrc.sh` on GPU server (for uploads only)
1827

19-
1. Install `diskimage-builder` manually via `pip install -r requirements.txt`. A virtual environment is advised. Check if you have all the system dependencies in `ubuntu24-system-requirements.txt`)
20-
2. Run `scripts/build-image.sh` to build the image. This will create a `.qcow2` file.
21-
- Export `$IMAGE_YAML` to choose a different image to build (e.g. `cpu-image.yaml`, `gpu-image.yaml`).
22-
- Export `$OUTPUT_IMAGE` to change the qcow2 output filename.
28+
## Build Directory
2329

24-
## Add Image to OpenStack
30+
By default images build to `/tmp/vm-images-build-{timestamp}`. Override with:
2531

2632
```bash
27-
openstack image create ubuntu-2404-nvidia-docker \
33+
make build-cpu BUILD_DIR=/path/to/build
34+
```
35+
36+
## Custom UV Path
37+
38+
If uv isn't in your PATH:
39+
40+
```bash
41+
make build-cpu UV=/path/to/uv
42+
```
43+
44+
## Automated Builds
45+
46+
GitHub Actions automatically builds and uploads images on push to `main` or `aktech/*` branches. Check `.github/workflows/build-images-ssh.yml`.
47+
48+
The workflow SSHs into the GPU server to run both CPU and GPU builds. GPU images require actual GPU hardware - they'll fail without it.
49+
50+
## Image Contents
51+
52+
**Both images:**
53+
- Ubuntu 24.04 (Noble)
54+
- Docker
55+
- Node.js
56+
- cloud-init
57+
58+
**GPU images only:**
59+
- NVIDIA drivers
60+
- CUDA
61+
62+
## Manual Upload
63+
64+
If you need to upload manually:
65+
66+
```bash
67+
source /etc/kolla/admin-openrc.sh
68+
openstack image create my-image-name \
2869
--public --disk-format qcow2 \
2970
--container-format bare \
30-
--file <created-image>.qcow2
71+
--file path/to/image.qcow2
72+
```
73+
74+
## Cleanup
75+
76+
```bash
77+
make clean BUILD_DIR=/path/to/build
3178
```

0 commit comments

Comments
 (0)