tinkerbell/hook

Figure out how to build kernel as part of CI/CD and hook it to the os yaml file

gianarb opened this issue · 2 comments

As you may know, if you tried to build tinkie by yourself or if you read README.md and kernel/README.md, this is the workflow more or less.

if you need to rebuild a kernel, you can do:

$ cd kernel
$ make build_5.10.x
 ---> e08367d496ed
Step 33/35 : COPY --from=kernel-build /out/* /
 ---> 48cbcdadd35d
Step 34/35 : LABEL org.opencontainers.image.revision=cb1336fcb12243daba4c1658e89926a244b702a3
 ---> Running in 72019d18547c
Removing intermediate container 72019d18547c
 ---> 085a74b4689d
Step 35/35 : LABEL org.opencontainers.image.source=https://github.com/linuxkit/linuxkit
 ---> Running in 7c079a5f2c14
Removing intermediate container 7c079a5f2c14
 ---> 9bda170b7231
Successfully built 9bda170b7231
Successfully tagged linuxkit/kernel:5.10.11-9d7ae34f30663ec464ac3696aa1c0251865fd9ff-amd64
Tagging linuxkit/alpine@sha256:bca9e72a17c1c74cf7b28a397c643048fd055fa096a3edfe1d16365a5307b9d9 as linuxkit/alpine:e2391e0b164c57db9f6c4ae110ee84f766edc430

At that point, I usually tag the image I get, and I push it to my registry: docker.io/gianarb.

$ docker tag linuxkit/kernel:5.10.11-1ce7f0bd892ab1e3b15f1d2ae9197401eca03654-amd64 gianarb/tinkie-kernel:5.10.x
$ docker push gianarb/tinkie-kernel:5.10.x
The push refers to repository [docker.io/gianarb/tinkie-kernel]
49d9db376899: Layer already exists
5.10.x: digest: sha256:557e71bfd56932c3f4d5e22e8fec82cf92cf9b340e880f723ed8b65e47aa5d95 size: 530

Now that I have a new version of the kernel, I can build tinkie:

# from the project root
make dist

It will use the new kernel I just pushed. If the kernel tag has changed, it should change here as well:

https://github.com/gianarb/tinkie/blob/master/tinkie.yaml#L2


This project works manually, but ideally, I would like to figure out how we can make it all at once. Technically we do not need to build kernel and tinkie at the same time very often, but right now that's the case. I expect it to be a bit more independent in the near future.

I figured out I was overthinking. I am writing a GitHub Action workflow that should work 👍


The makefile inside kernel dir supports

 make push_5.10.x

That should make the actual tagging and pushing. It supports ORG=docker.io/gianarb if you want to override the registry.

Our own @detiber fired it out #28