You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow building HookOS from existing kernel image: (#233)
## Description
<!--- Please describe what this PR is going to change -->
When the `kernel-releases.json` is updated, which is pretty frequent, a
new point release will be available and require Users to build the
kernel. With this commit, `USE_LATEST_BUILT_KERNEL` allows a User to
build HookOS without having to build the kernel. This is done by getting
the latest point release from `quay.io/tinkerbell/hook-kernel` image
tags.
## Why is this needed
<!--- Link to issue you have raised -->
Fixes: #
## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
## How are existing users impacted? What migration steps/scripts do we
need?
<!--- Fixes a bug, unblocks installation, removes a component of the
stack etc -->
<!--- Requires a DB migration script, etc. -->
## Checklist:
I have:
- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
Copy file name to clipboardExpand all lines: README.md
+30-37Lines changed: 30 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,11 +18,11 @@ We started this project for the following reasons:
18
18
- The [OSIE] build process was not standardised, which is critical for an open-source project because it causes friction for contributors.
19
19
This project, as highlighted later in this page, uses [LinuxKit].
20
20
It gives us:
21
-
- Documentation about how the building phase works
22
-
- A clear and defined CLI and [specification] (YAML)
23
-
- A shared community that is supportive
24
-
- LinuxKit cross-compiles in many architectures
25
-
- Different output formats: ISO, init ramdisk, aws, docker, rpi3... see [formats].
21
+
- Documentation about how the building phase works
22
+
- A clear and defined CLI and [specification] (YAML)
23
+
- A shared community that is supportive
24
+
- LinuxKit cross-compiles in many architectures
25
+
- Different output formats: ISO, init ramdisk, aws, docker, rpi3... see [formats].
26
26
- It was not easy to explain to the Tinkerbell community how [OSIE] works and the components it is made for.
27
27
A lot of the components were Equinix Metal specific and are not strictly needed in Tinkerbell.
28
28
@@ -67,14 +67,14 @@ It will then speak with the `hook-docker` engine API through the shared `/var/ru
67
67
> This refers to the 0.9.0-alpha version, compared to 0.8.1.
68
68
69
69
- Replaces the emulated Alpine kernel build with a Debian based cross-compiling build
70
-
- Much faster building. Emulating x86_64 on arm64 is very slow and vice-versa.
70
+
- Much faster building. Emulating x86_64 on arm64 is very slow and vice-versa.
71
71
- Replaces kernel .config's with the `defconfig` versions, via Kbuild's `make savedefconfig`
72
72
- Replaces Git-SHA1-based image versioning ("current revision") with content-based hashing.
73
-
- This way, there's much higher cache reuse, and new versions are pushed only when components actually changed (caveat emptor)
73
+
- This way, there's much higher cache reuse, and new versions are pushed only when components actually changed (caveat emptor)
74
74
- Should allow people to develop Hook without having to build a kernel, depending on CI frequency and luck.
75
75
- Introduces multiple "flavors" of hook. Instead of restricted to 2 hardcoded flavors (x86_64 and aarch64, built from source), we can now define multiple flavors, each with an ID and version/configure/build methods.
76
-
- the `hook-default-amd64` and `hook-default-arm64` kernels are equivalent to the two original.
77
-
- the `armbian-` prefixed kernels are actually Armbian kernels for more exotic arm64 SBCs, or Armbian's generic UEFI kernels for both arches. Those are very fast to "build" since Armbian publishes their .deb packages in OCI images, and here we
76
+
- the `hook-default-amd64` and `hook-default-arm64` kernels are equivalent to the two original.
77
+
- the `armbian-` prefixed kernels are actually Armbian kernels for more exotic arm64 SBCs, or Armbian's generic UEFI kernels for both arches. Those are very fast to "build" since Armbian publishes their .deb packages in OCI images, and here we
78
78
just download and massage them into the format required by Linuxkit.
79
79
-`hook.yaml` is replaced with `hook.template.yaml` which is templated via a limited-var invocation of `envsubst`; only the kernel image and the arch is actually different per-flavor.
80
80
- Auto-updating of the kernel via kernel.org's JSON endpoint (ofc only works for LTS or recent-enough stable kernels). Could opt-out/use a fixed version.
@@ -108,14 +108,14 @@ So, just running `./build.sh` will build the default flavor for the host archite
108
108
Other commands are:
109
109
110
110
-`kernel <id>`: builds the kernel for the specified flavor
111
-
- for `default` ids, this will build the kernel from source
112
-
- for other methods, usually this will download & massage the kernels from a distro's packages
111
+
- for `default` ids, this will build the kernel from source
112
+
- for other methods, usually this will download & massage the kernels from a distro's packages
113
113
-`config <id>`: runs kernel configuration for the specified flavor.
114
-
- this only works for the default flavors; Foreign kernels are configured elsewhere;
115
-
- it will open an interactive menuconfig session where you can change kernel config options; after exiting, `savedefconfig` will be run and the resulting file copied back to the host, ready for commit.
114
+
- this only works for the default flavors; Foreign kernels are configured elsewhere;
115
+
- it will open an interactive menuconfig session where you can change kernel config options; after exiting, `savedefconfig` will be run and the resulting file copied back to the host, ready for commit.
116
116
-`build <id>`: builds the Hook flavor. The kernel must be either available for pulling, or have been built locally beforehand.
117
117
-`qemu <id>`: builds the Hook flavor and runs it in QEMU.
118
-
- this accepts `MAC=<mac>` and `TINK_SERVER=<ip>` env vars, see below
118
+
- this accepts `MAC=<mac>` and `TINK_SERVER=<ip>` env vars, see below
119
119
120
120
Other, less common commands are:
121
121
@@ -131,26 +131,27 @@ Of course, you may also set them in the environment before running the script (t
131
131
The most important environment variables are:
132
132
133
133
- general, applies to most commands:
134
-
-`DEBUG=yes`: set this to get lots of debugging messages which can make understanding the build and finding problems easier.
135
-
-`HOOK_VERSION`: The Hook version, ends up in `/etc/os-release` and on the screen at boot.
136
-
-`HOOK_KERNEL_OCI_BASE`: OCI base coordinates for the kernel images.
137
-
-`HOOK_LK_CONTAINERS_OCI_BASE`: OCI base coordinates for the LinuxKit containers.
138
-
-`CACHE_DIR`: directory where the build system will cache downloaded files. Relative to the project root.
134
+
-`DEBUG=yes`: set this to get lots of debugging messages which can make understanding the build and finding problems easier.
135
+
-`HOOK_VERSION`: The Hook version, ends up in `/etc/os-release` and on the screen at boot.
136
+
-`HOOK_KERNEL_OCI_BASE`: OCI base coordinates for the kernel images.
137
+
-`HOOK_LK_CONTAINERS_OCI_BASE`: OCI base coordinates for the LinuxKit containers.
138
+
-`CACHE_DIR`: directory where the build system will cache downloaded files. Relative to the project root.
139
+
-`USE_LATEST_BUILT_KERNEL`: set this to `yes` to use the latest built kernel from `quay.io/tinkerbell/hook-kernel`.
139
140
- exclusively for the `qemu` command:
140
-
-`TINK_SERVER=<ip>`: the IP address of the Tinkerbell GRPC server. No default.
141
-
-`MAC=<mac>`: the MAC address of the machine that will be provisioned. No default.
142
-
- and also
143
-
-`TINK_WORKER_IMAGE`, defaults to `"quay.io/tinkerbell/tink-worker:latest"`
144
-
-`TINK_TLS` defaults to `false`
145
-
-`TINK_GRPC_PORT` defaults to `42113`
141
+
-`TINK_SERVER=<ip>`: the IP address of the Tinkerbell GRPC server. No default.
142
+
-`MAC=<mac>`: the MAC address of the machine that will be provisioned. No default.
143
+
- and also
144
+
-`TINK_WORKER_IMAGE`, defaults to `"quay.io/tinkerbell/tink-worker:latest"`
145
+
-`TINK_TLS` defaults to `false`
146
+
-`TINK_GRPC_PORT` defaults to `42113`
146
147
147
148
### CI (GitHub Actions)
148
149
149
150
- There's a distributed GitHub Actions build workflow `"matrix"`.
150
-
- The bash build system produces JSON objects that drive the matrix stages:
151
-
- One matrix is per-arch, and builds all the containers whose source is hosted in this repo (bootkit, docker, mdev)
152
-
- Second matrix is per-flavor(/kernel), and builds the kernel
153
-
- Third matrix, depending on the other two, is per-flavor(/kernel), and builds Hook itself (via LinuxKit) and prepares a .tar.gz into GH artifacts
151
+
- The bash build system produces JSON objects that drive the matrix stages:
152
+
- One matrix is per-arch, and builds all the containers whose source is hosted in this repo (bootkit, docker, mdev)
153
+
- Second matrix is per-flavor(/kernel), and builds the kernel
154
+
- Third matrix, depending on the other two, is per-flavor(/kernel), and builds Hook itself (via LinuxKit) and prepares a .tar.gz into GH artifacts
154
155
155
156
The `gha-matrix` CLI command prepares a set of JSON outputs for GitHub Actions matrix workflow, based on the inventory and certain environment variables:
156
157
@@ -164,16 +165,8 @@ The `gha-matrix` CLI command prepares a set of JSON outputs for GitHub Actions m
164
165
-[ ] Update to Linuxkit 1.2.0 and new linuxkit pkgs; this might lead into the containerd vs dind;
165
166
-[ ]`make debug` functionality (sshd enabled) was lost in the Makefile -> bash transition;
0 commit comments