Skip to content

Commit 4066e09

Browse files
committed
new README.md
1 parent 2237cd4 commit 4066e09

File tree

3 files changed

+71
-37
lines changed

3 files changed

+71
-37
lines changed

ARCHITECTURE.md

-6
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,3 @@ The `install.sh` has to be implemented for every OS. Between `install.sh` and th
4343
cmdline:
4444
kernel:
4545
```
46-
47-
## CI-Process to build our OS images
48-
49-
1. build a docker image locally
50-
1. export it to a tarball
51-
1. compress the tarball and store the compressed upload it to a blobstore

IMAGE_STORE.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Image store
2+
3+
The metal-images tarballs are stored on <https://images.metal-stack.io/>. The tarball must be compressed using lz4 and a md5 checksum must be provided as well. To be able to have an insight what packages are included in this image a `packages.txt` with the output of `dpkg -l`.
4+
The actual directory layout should look like:
5+
6+
```bash
7+
<imagesdir>/<os>/<major.minor>/<patch>/img.tar.lz4
8+
<imagesdir>/<os>/<major.minor>/<patch>/img.tar.lz4.md5
9+
<imagesdir>/<os>/<major.minor>/<patch>/packages.txt
10+
```
11+
12+
Where `<imagesdir>` is `/` for the master branch and `/${CI_COMMIT_REF_SLUG}/` for branches and merge requests.
13+
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.
15+
16+
`<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.
17+
18+
`<patch>` must follow the semantic version requirements for `patch`, we defined that patch is always in the form of "YYYYMMDD` for example 20191018.
19+
20+
To specify the image for machine creation the full qualified image must be in the form of:
21+
`<os-major.minor.patch>`, e.g. `ubuntu-19.10.20191018`.
22+
23+
From the metal-api perspective, there are two possibilities to specify a image to create a machine:
24+
25+
1. specify major.minor without patch, e.g. `--image ubuntu-19.10`
26+
1. specify major.minor.patch `--image ubuntu-19.10.20191018`
27+
28+
In the first case a most recent version resolution is taken place in the metal-api to resolve to the most recent available image for ubuntu-19.10, which will be then for example ubuntu-19.10.20191018, this image is the stored in the machine allocation.
29+
The second form guarantees the machine creation of this exact image.
30+
31+
Images which are no longer in use by any allocated machine and are older than the specified usage period will be deleted from the metal-api and the image store.

README.md

+40-31
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,62 @@
11
# metal-images
22

3-
CI builds for metal-images. Every OS image is build from a Dockerfile. The generated docker image is then exported to a tarball. This tarball is then stored in [GCS](https://images.metal-stack.io/). The tarball must be compressed using lz4 and a md5 checksum must be provided as well. To be able to have an insight what packages are included in this image a `packages.txt` with the output of `dpkg -l`.
4-
The actual directory layout should look like:
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/>.
55

6-
```bash
7-
<imagesdir>/<os>/<major.minor>/<patch>/img.tar.lz4
8-
<imagesdir>/<os>/<major.minor>/<patch>/img.tar.lz4.md5
9-
<imagesdir>/<os>/<major.minor>/<patch>/packages.txt
10-
```
6+
For security scanning those images are also pushed to [quay.io/metalstack](https://quay.io/user/metalstack).
117

12-
Where `<imagesdir>` is `/` for the master branch and `/${CI_COMMIT_REF_SLUG}/` for branches and merge requests.
8+
Further information about the image store is available at [IMAGE_STORE.md](./IMAGE_STORE.md).
139

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.
10+
Information about our initial architectural decisions may be found in [ARCHITECTURE.md](./ARCHITECTURE.md).
1511

16-
`<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.
12+
## Local development and integration testing
1713

18-
`<patch>` must follow the semantic version requirements for `patch`, we defined that patch is always in the form of "YYYYMMDD` for example 20191018.
14+
Before you can start developing changes for metal-images or even introduce new operating systems, you have to install the following tools:
1915

20-
To specify the image for machine creation the full qualified image must be in the form of:
21-
`<os-major.minor.patch>`, e.g. `ubuntu-19.10.20191018`.
16+
- **docker**: for sure
17+
- **kvm**: hypervisor used for integration tests
18+
- **lz4**: to compress tarballs
19+
- **[docker-make](https://github.com/fi-ts/docker-make)**: this is a helper tool to define docker builds declaratively with YAML
20+
- **[weaveworks/ignite](https://github.com/weaveworks/ignite)**: handles [firecracker vms](https://firecracker-microvm.github.io/) to spin up a metal-image virtually as VM
2221

23-
From the metal-api perspective, there are two possibilities to specify a image to create a machine:
22+
You can build metal-images like that:
2423

25-
1. specify major.minor without patch, e.g. `--image ubuntu-19.10`
26-
1. specify major.minor.patch `--image ubuntu-19.10.20191018`
24+
```bash
25+
# for debian images
26+
cd debian && docker-make -nNL -f docker-make.debian.yaml
2727

28-
In the first case a most recent version resolution is taken place in the metal-api to resolve to the most recent available image for ubuntu-19.10, which will be then for example ubuntu-19.10.20191018, this image is the stored in the machine allocation.
29-
The second form guarantees the machine creation of this exact image.
28+
# for ubuntu images
29+
cd debian && docker-make -nNL -f docker-make.ubuntu.yaml
30+
31+
# for firewall images
32+
cd firewall && docker-make -nNL docker-make.yaml
33+
```
3034

31-
Images which are no longer in use by any allocated machine and are older than the specified usage period will be deleted from the metal-api and the blobstore.
35+
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.
3236

3337
## Supported Images
3438

3539
Currently these images are supported:
3640

3741
1. Debian 10
38-
1. Ubuntu 19.10
39-
1. Firewall 2.0
42+
1. Ubuntu 20.04
43+
1. Firewall 2.0 (based on Debian 10)
44+
1. Firewall 2.0-ubuntu (based on Ubuntu 20.04)
45+
46+
## Schedule
47+
48+
Builds from the master branch are scheduled on every sunday night at 1:10 o'clock to get fresh metal-images every week.
49+
50+
## How new images get usable in a metal-stack partition
51+
52+
Images are synced to partitions with a service that mirrors the public bucket and which runs on the management servers of partitions.
53+
54+
Images built from the master branch are accessible with an image URL like this:
4055

41-
## Build, Test and Release process
56+
`http://images.metal-stack.io/ubuntu/20.04/20200728/img.tar.lz4`
4257

43-
We start testing these images __only__ on the metal level to narrow the test scope and make failure debugging easier.
58+
For other branches, the URL pattern is this:
4459

45-
### CI
60+
`http://images.metal-stack.io/${CI_COMMIT_REF_SLUG}/ubuntu/20.04/20200728/img.tar.lz4`
4661

47-
- build on push and daily scheduled ci job to build the images for machines and firewalls
48-
- images are pushed to Google Bucket and accessible under [images.metal-stack.io](https://images.metal-stack.io)
49-
- images are synced to partitions with a synchronization service that runs on management servers
50-
- pipelines running from the master branch yield an image URL like that is useable in the partition:
51-
- `https://images.metal-pod.io/ubuntu/19.10/20191017/img.tar.lz4`
52-
- pipelines running from other branches yield an image URL like that is useable in the partition:
53-
- `https://images.metal-pod.io/${CI_COMMIT_REF_SLUG}/ubuntu/19.10/20191017/img.tar.lz4`
62+
Those URLs can be used to define an image at the metal-api.

0 commit comments

Comments
 (0)