Skip to content

Commit dbbb535

Browse files
authored
Almalinux 9 (#162)
1 parent 1bb4111 commit dbbb535

39 files changed

+741
-122
lines changed

.github/workflows/master.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,43 @@ jobs:
9696

9797
- name: Upload image tarballs to GCS
9898
run: cd images && gsutil -m -h "Cache-Control:no-store" cp -r . gs://$GCS_BUCKET/metal-os
99+
100+
almalinux:
101+
name: Build Almalinux based OS image
102+
runs-on: self-hosted
103+
steps:
104+
- name: Checkout
105+
uses: actions/checkout@v4
106+
107+
- uses: google-github-actions/auth@v2
108+
with:
109+
credentials_json: '${{ secrets.GCP_SA_KEY }}'
110+
111+
- name: Set up Cloud SDK
112+
uses: google-github-actions/setup-gcloud@v2
113+
114+
- name: Set up Go 1.22
115+
uses: actions/setup-go@v5
116+
with:
117+
go-version: '1.22.x'
118+
cache: false
119+
120+
- name: build install
121+
run: make
122+
- name: Prepare build environment
123+
shell: bash
124+
run: ./prepare.sh almalinux
125+
- name: Build docker image for almalinux based workers and export tarball
126+
run: |
127+
DOCKER_MAKE_REGISTRY_LOGIN_USER="metalstack+ci" \
128+
DOCKER_MAKE_REGISTRY_LOGIN_PASSWORD="${{ secrets.QUAY_IO_TOKEN }}" \
129+
TMPDIR=/var/tmp \
130+
docker-make \
131+
--work-dir almalinux \
132+
--file docker-make.yaml \
133+
--no-cache \
134+
--summary \
135+
--no-lint \
136+
--no-push
137+
- name: Upload image tarballs to GCS
138+
run: cd images && gsutil -m -h "Cache-Control:no-store" cp -r . gs://$GCS_BUCKET/metal-os

.github/workflows/pr.yaml

+47
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,50 @@ jobs:
9898

9999
- name: Upload image tarballs to GCS
100100
run: cd images && gsutil -m -h "Cache-Control:no-store" cp -r . gs://$GCS_BUCKET/metal-os/pull_requests/
101+
102+
almalinux:
103+
name: Build Almalinux based OS image
104+
runs-on: self-hosted
105+
steps:
106+
- name: Checkout
107+
uses: actions/checkout@v4
108+
109+
- uses: google-github-actions/auth@v2
110+
with:
111+
credentials_json: '${{ secrets.GCP_SA_KEY }}'
112+
113+
- name: Set up Cloud SDK
114+
uses: google-github-actions/setup-gcloud@v2
115+
116+
- name: Set up Go 1.22
117+
uses: actions/setup-go@v5
118+
with:
119+
go-version: '1.22.x'
120+
cache: false
121+
122+
- name: build install
123+
run: make
124+
- name: Prepare build environment
125+
shell: bash
126+
run: ./prepare.sh almalinux
127+
- name: Build docker image for almalinux based workers and export tarball
128+
run: |
129+
DOCKER_MAKE_REGISTRY_LOGIN_USER="metalstack+ci" \
130+
DOCKER_MAKE_REGISTRY_LOGIN_PASSWORD="${{ secrets.QUAY_IO_TOKEN }}" \
131+
TMPDIR=/var/tmp \
132+
docker-make \
133+
--work-dir almalinux \
134+
--file docker-make.yaml \
135+
--no-cache \
136+
--no-push \
137+
--summary \
138+
--no-lint \
139+
--no-push
140+
141+
- uses: google-github-actions/setup-gcloud@v0
142+
with:
143+
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
144+
service_account_key: ${{ secrets.GCP_SA_KEY }}
145+
146+
- name: Upload image tarballs to GCS
147+
run: cd images && gsutil -m -h "Cache-Control:no-store" cp -r . gs://$GCS_BUCKET/metal-os/pull_requests/

.github/workflows/release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333

3434
- run: |
3535
# copy supported images (entire stable folder cannot be copied as a whole because it contains obsolete images as well)
36+
gsutil -m cp -r gs://$GCS_BUCKET/metal-os/stable/almalinux/9 gs://$GCS_BUCKET/metal-os/${GITHUB_REF##*/}/almalinux/9
3637
gsutil -m cp -r gs://$GCS_BUCKET/metal-os/stable/debian/12 gs://$GCS_BUCKET/metal-os/${GITHUB_REF##*/}/debian/12
3738
gsutil -m cp -r gs://$GCS_BUCKET/metal-os/stable/debian-nvidia/12 gs://$GCS_BUCKET/metal-os/${GITHUB_REF##*/}/debian-nvidia/12
3839
gsutil -m cp -r gs://$GCS_BUCKET/metal-os/stable/firewall/3.0-ubuntu gs://$GCS_BUCKET/metal-os/${GITHUB_REF##*/}/firewall/3.0-ubuntu
39-
gsutil -m cp -r gs://$GCS_BUCKET/metal-os/stable/ubuntu/22.04 gs://$GCS_BUCKET/metal-os/${GITHUB_REF##*/}/ubuntu/22.04
4040
gsutil -m cp -r gs://$GCS_BUCKET/metal-os/stable/ubuntu/24.04 gs://$GCS_BUCKET/metal-os/${GITHUB_REF##*/}/ubuntu/24.04
4141
4242
PREFIX=metal-os/${GITHUB_REF##*/} go run ./cmd/tools/generate-table > downloads.md

IMAGE_STORE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The actual directory layout should look like:
1111

1212
Where `<imagesdir>` is `/` for the master branch and `/${CI_COMMIT_REF_SLUG}/` for branches and merge requests.
1313

14-
`<os>` is the name of the os in use, we currently only have `ubuntu` and `firewall`, where `firewall` is derived from the `ubuntu` image.
14+
`<os>` is the name of the os in use, some images like `firewall` are derived from another os image (in this case the `ubuntu` image).
1515

1616
`<major.minor>` specifies the major and minor number of the OS, which is case of ubuntu "19.10", "19.10", "20.04" and so on. This version must follow the semantic versioning specification, whereas we tolerate a leading zero for the minor version which is quite common for some OSes.
1717

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ all: clean binary
1818
clean:
1919
rm -f debian/context/install-go
2020
rm -f centos/context/install-go
21+
rm -f almalinux/context/install-go
2122

2223
.PHONY: binary
2324
binary: test
@@ -31,6 +32,7 @@ binary: test
3132
strip bin/$(BINARY)
3233
cp bin/$(BINARY) debian/context/install-go
3334
cp bin/$(BINARY) centos/context/install-go
35+
cp bin/$(BINARY) almalinux/context/install-go
3436

3537
.PHONY: test
3638
test:
@@ -55,3 +57,7 @@ firewall: ubuntu
5557
.PHONY: centos
5658
centos: binary
5759
docker-make -nNL -w centos -f docker-make.yaml
60+
61+
.PHONY: almalinux
62+
almalinux: binary
63+
docker-make -nNL -w almalinux -f docker-make.yaml

README.md

+70-63
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,55 @@
11
# metal-images
22

3-
This project builds operating system images usable for bare metal server provisioning with [metal-stack](https://metal-stack.io).
4-
Every OS image is build from a Dockerfile, exported to a lz4 compressed tarball, and uploaded to <https://images.metal-stack.io/>.
3+
This project builds operating system images that can be used for bare metal server deployments with [metal-stack](https://metal-stack.io).
4+
Every OS image is built from a Dockerfile, exported to a lz4 compressed tarball, and uploaded to <https://images.metal-stack.io/>.
55

6-
For security scanning those images are also pushed to [quay.io/metalstack](https://quay.io/user/metalstack).
6+
More information about the image store is available in [IMAGE_STORE.md](./IMAGE_STORE.md).
77

8-
Further information about the image store is available at [IMAGE_STORE.md](./IMAGE_STORE.md).
8+
Information about our initial architectural decisions can be found in [ARCHITECTURE.md](./ARCHITECTURE.md).
99

10-
Information about our initial architectural decisions may be found in [ARCHITECTURE.md](./ARCHITECTURE.md).
10+
## Supported Images
11+
12+
Currently these images are supported:
13+
14+
1. Debian 12
15+
1. Ubuntu 22.04
16+
1. Firewall 3.0-ubuntu (based on Ubuntu 22.04)
17+
1. Nvidia (based on Debian 12)
18+
19+
## Unsupported Images
20+
21+
We also publish images that we need for special purposes but do not officially support. Use at your own risk.
22+
23+
1. CentOS 7
24+
1. Almalinux 9
25+
26+
### GPU Support
27+
28+
With the nvidia image a worker has GPU support. Please check our official documentation on [docs.metal-stack.io](https://docs.metal-stack.io/stable/overview/gpu-support/) on how to get this running on Kubernetes.
29+
30+
## How new images become usable in a metal-stack partition
31+
32+
Images are synchronized to partitions using a service called [metal-image-cache-sync](https://github.com/metal-stack/metal-image-cache-sync). The service mirrors the public operating system images to the management servers and transparently serves the metal images within a partition.
33+
34+
Released images are tagged with the release date and can be accessed using the following image URL pattern:
35+
36+
`https://images.metal-stack.io/metal-os/20230710/debian/12/img.tar.lz4`
37+
38+
Images built from the master branch are accessible at an image URL like this:
39+
40+
`https://images.metal-stack.io/metal-os/stable/debian/12/img.tar.lz4`
41+
42+
For other branches, the URL pattern is as follows:
43+
44+
`https://images.metal-stack.io/metal-os/pull_requests/${CI_COMMIT_REF_SLUG}/debian/12/img.tar.lz4`
45+
46+
These URLs can be used to define an image at the metal-api.
1147

1248
## Local development and integration testing
1349

14-
Before you can start developing changes for metal-images or even introduce new operating systems, you have to install the following tools:
50+
Please also refer to our documentation on docs.metal-stack.io on [Build Your Own Images](https://docs.metal-stack.io/stable/overview/os/#Building-Your-Own-Images) to check for the contract an OS image is expected to fulfill.
51+
52+
Before you can start developing changes for metal-images or even introduce new operating systems, you should install the following tools:
1553

1654
- **docker**: for sure
1755
- **kvm**: hypervisor used for integration tests
@@ -36,76 +74,45 @@ make centos
3674

3775
# for nvidia images
3876
make nvidia
77+
78+
# for almalinux images
79+
make almalinux
3980
```
4081

4182
For integration testing the images are started as [firecracker vm](https://firecracker-microvm.github.io/) with [weaveworks/ignite](https://github.com/weaveworks/ignite) and basic properties like interfaces to other metal-stack components, kernel parameters, internet reachability, DNS resolution etc. are checked with [goss](https://github.com/aelsabbahy/goss) in a GitHub action workflow. The integration tests are also executed when you build an image locally with.
4283

43-
## Supported Images
44-
45-
Currently these images are supported:
84+
### Debugging Image Provisioning
4685

47-
1. Debian 12
48-
1. Ubuntu 22.04
49-
1. Firewall 3.0-ubuntu (based on Ubuntu 22.04)
50-
1. Nvidia (based on Debian 12)
86+
In some cases it may be necessary to manually figure out the commands for provisioning a machine image. To do this in a real server environment, it is possible to hook into the metal-hammer through the machine's serial console.
5187

52-
### GPU Support
88+
You can interrupt the metal-hammer at any time by sending a keyboard interrupt. The metal-hammer takes a short pause before booting into the operating system kernel, which is a good time to send the interrupt.
5389

54-
With the nvidia image a worker has GPU support. The cluster user must execute the following commands to get GPU support in Kubernetes:
90+
To prevent the machine from rebooting, you should immediately issue the following command:
5591

5692
```bash
57-
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
58-
helm repo update
59-
60-
kubectl create ns gpu-operator
61-
kubectl label --overwrite ns gpu-operator pod-security.kubernetes.io/enforce=privileged
62-
63-
helm install --wait \
64-
--generate-name \
65-
--namespace gpu-operator \
66-
--create-namespace \
67-
nvidia/gpu-operator \
68-
--set driver.enabled=false \
69-
--set toolkit.enabled=false
70-
```
71-
72-
After that `kubectl describe node` must show the gpu in the capacity like so:
73-
74-
```plain
75-
...
76-
Capacity:
77-
cpu: 64
78-
ephemeral-storage: 100205640Ki
79-
hugepages-1Gi: 0
80-
hugepages-2Mi: 0
81-
memory: 263802860Ki
82-
nvidia.com/gpu: 1
83-
pods: 510
84-
...
93+
while true; do echo "1" > /dev/watchdog && sleep 55; done &
8594
```
8695

87-
Unsupported images:
96+
If you want to enter the operating system through `chroot`, you need to remount some file systems that were mounted by the metal-hammer during provisioning:
8897

89-
1. Centos 7.0
90-
91-
## Schedule
92-
93-
Builds from the master branch are scheduled on every sunday night at 1:10 o'clock to get fresh metal-images every week.
94-
95-
## How new images get usable in a metal-stack partition
96-
97-
Images are synced to partitions with a service that mirrors the public bucket and which runs on the management servers of partitions.
98-
99-
Released Images are accessible with under this image URL, where `20230710` here is the tag of this repository.
100-
101-
`http://images.metal-stack.io/metal-os/20230710/debian/12/img.tar.lz4`
102-
103-
Images built from the master branch are accessible with an image URL like this:
98+
```bash
99+
# the mount points also depend on the file system layout of the machine, so please only take this as an example:
100+
mount /dev/sda2 /rootfs
101+
mount -t vfat /dev/sda1 /rootfs/boot/efi
102+
mount -t proc /proc /rootfs/proc
103+
mount -t sysfs /sys /rootfs/sys
104+
mount -t efivarfs /sys/firmware/efi/efivars /rootfs/sys/firmware/efi/efivars
105+
mount -t devtmpfs /dev /rootfs/dev
106+
```
104107

105-
`http://images.metal-stack.io/metal-os/stable/debian/12/img.tar.lz4`
108+
Finally, you can then enter the provisioned OS image.
106109

107-
For other branches, the URL pattern is this:
110+
```bash
111+
chroot /rootfs
108112

109-
`http://images.metal-stack.io/metal-os/pull_requests/${CI_COMMIT_REF_SLUG}/debian/12/img.tar.lz4`
113+
# maybe you can mount further file systems here, which was not possible in the u-root environment of the metal-hammer
114+
vgchange -ay
115+
mount /dev/csi-lvm/varlib /var/lib/
116+
```
110117

111-
Those URLs can be used to define an image at the metal-api.
118+
Keep in mind that you are still running on the metal-hammer kernel, which is different from the kernel that will be run in the operating system after provisioning. For further information on the metal-stack machine provisioning sequence, check out documentation on [docs.metal-stack.io](https://docs.metal-stack.io/stable/overview/architecture/#Machine-Provisioning-Sequence). The kernel used by the metal-hammer is built on our own inside the [kernel repository](https://github.com/metal-stack/kernel).

0 commit comments

Comments
 (0)