|
1 | 1 | # metal-images
|
2 | 2 |
|
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/>. |
5 | 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 |
| -``` |
| 6 | +For security scanning those images are also pushed to [quay.io/metalstack](https://quay.io/user/metalstack). |
11 | 7 |
|
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). |
13 | 9 |
|
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). |
15 | 11 |
|
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 |
17 | 13 |
|
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: |
19 | 15 |
|
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 |
22 | 21 |
|
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: |
24 | 23 |
|
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 |
27 | 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. |
| 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 | +``` |
30 | 34 |
|
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. |
32 | 36 |
|
33 | 37 | ## Supported Images
|
34 | 38 |
|
35 | 39 | Currently these images are supported:
|
36 | 40 |
|
37 | 41 | 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: |
40 | 55 |
|
41 |
| -## Build, Test and Release process |
| 56 | +`http://images.metal-stack.io/ubuntu/20.04/20200728/img.tar.lz4` |
42 | 57 |
|
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: |
44 | 59 |
|
45 |
| -### CI |
| 60 | +`http://images.metal-stack.io/${CI_COMMIT_REF_SLUG}/ubuntu/20.04/20200728/img.tar.lz4` |
46 | 61 |
|
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