Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏭 Consolidate osbuilder and Auroraboot #1633

Closed
Tracked by #2127
jimmykarily opened this issue Jul 24, 2023 · 6 comments
Closed
Tracked by #2127

🏭 Consolidate osbuilder and Auroraboot #1633

jimmykarily opened this issue Jul 24, 2023 · 6 comments
Assignees

Comments

@jimmykarily
Copy link
Contributor

jimmykarily commented Jul 24, 2023

We currently have 2 different tools to build Kairos images:

  • Auraboot, meant to be used outside Kubernetes
  • osbuilder, meant to be used as a controller inside Kubernetes
    osbuilder vs auroraboot

Both of them have more responsibilities than building (e.g. Auroraboot handles netbooting, osbuilder handles upgrades) but they share the building part.

The current situation and the desired is described in the image above.

This is an epic to collect all the steps/issues toward the desired state.

The last item needs to be discussed and it will be more clear when we have everything consolidated in one image.

@jimmykarily
Copy link
Contributor Author

jimmykarily commented Aug 1, 2023

osbuilder BYOI (https __github com_kairos-io_kairos_issues_1546)

One more image describing the desired state of the various tools (osbuilder, auroraboot, enki) and the relations between them.

@jimmykarily
Copy link
Contributor Author

We will soon be able to build Kairos container images using just Dockerfiles (no Earthly or other tools). There are 2 things missing to have the full "factory" experience:

  • A tool that produces the various other artifacts from the container image (e.g. iso, img)
  • A tool that wraps the whole flow in some nice UX

Right now the creation of additional artifacts happens in Earthly using osbuilder-tools image. Above we describe how Autoraboot should provide both the UX and the artifact building functionality. Let's consider splitting as such:

  • enki is the tool that builds all types of artifacts given a container image
  • Auroraboot is a cli interface that calls out to enki. It's meant to be used by humans.\
  • Osbuilder controller also calls out to enki. It's meant to be used in Kubernetes in a declarative way.

The new suggestion above is that osbuilder doesn't use Auroraboot but enki directly. This allows us to focus the UX of Auroraboot to humans and not try to satisfy the needs of osbuilder too. enki should be able to cover both since it will be an internal tool, with no focus on UX.

jimmykarily added a commit to kairos-io/AuroraBoot that referenced this issue Nov 1, 2024
jimmykarily added a commit to kairos-io/enki that referenced this issue Nov 1, 2024
so that it can be used as a library from Auroraboot
as part of kairos-io/kairos#1633

The following anti-patterns make it very hard to re-use the enki
functions:

- viper is used as a global store, randomly accessing everything from anywhere
- we pass around too many "configs": the BuildConfig, the embedded
  kairos-agent config, the BuildUKIAction (which is essentially yet another config),

It's nearly impossible to construct the proper input for any function
because we don't know what part of the configs available, is actually needed
and used.

This is a first refactoring that should at least let the caller use the
BuildUKIAction without needing to populate a global "viper" object.

Signed-off-by: Dimitris Karakasilis <[email protected]>
jimmykarily added a commit to kairos-io/AuroraBoot that referenced this issue Nov 6, 2024
jimmykarily added a commit to kairos-io/AuroraBoot that referenced this issue Nov 7, 2024
jimmykarily added a commit to kairos-io/AuroraBoot that referenced this issue Nov 12, 2024
as part of kairos-io/kairos#1633

Signed-off-by: Dimitris Karakasilis <[email protected]>
jimmykarily added a commit to kairos-io/AuroraBoot that referenced this issue Nov 12, 2024
part of: kairos-io/kairos#1633

Signed-off-by: Dimitris Karakasilis <[email protected]>
jimmykarily added a commit to kairos-io/AuroraBoot that referenced this issue Nov 12, 2024
* Port sysext command from enki

part of: kairos-io/kairos#1633

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Don't use viper

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Use global "--debug" option and some minor fixes

- args that weren't used
- command output was not printed

Signed-off-by: Dimitris Karakasilis <[email protected]>

---------

Signed-off-by: Dimitris Karakasilis <[email protected]>
jimmykarily added a commit to kairos-io/AuroraBoot that referenced this issue Nov 12, 2024
as part of kairos-io/kairos#1633

Signed-off-by: Dimitris Karakasilis <[email protected]>
jimmykarily added a commit to kairos-io/AuroraBoot that referenced this issue Nov 12, 2024
* Port genkey command from enki

as part of kairos-io/kairos#1633

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Port genkey e2e test and don't use viper

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Run the genkey tests in CI

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Allow certs with negative serial numbers

Not sure why the asus certs have a negative serial number but they do.
If the asus box had that others might too, so we should better support
it. The alternative would be to generate certs with positive serial
number for the tests.

https://github.com/golang/go/blob/master/src/crypto/x509/parser.go#L1014-L1018
microsoft/mssql-docker#895 (comment)

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Remove focus

Signed-off-by: Dimitris Karakasilis <[email protected]>

---------

Signed-off-by: Dimitris Karakasilis <[email protected]>
@jimmykarily
Copy link
Contributor Author

New auroraboot release: https://github.com/kairos-io/AuroraBoot/releases/tag/v0.3.0
We should be good to archive the enki repository now. If there is any importing of code from that repo, we will port to auroraboot or kairos-sdk as soon as we discover it. No changes or fixes should be made on enki from now on.

@jimmykarily
Copy link
Contributor Author

Cut another release which completely removes enki as a dependency: https://github.com/kairos-io/AuroraBoot/releases/tag/v0.3.1

also the enki repository is now archived.

jimmykarily added a commit to kairos-io/AuroraBoot that referenced this issue Nov 13, 2024
So we can deprecate the osbuilder-tools image in favor of this one.

Part of kairos-io/kairos#1633

Signed-off-by: Dimitris Karakasilis <[email protected]>
jimmykarily added a commit to kairos-io/AuroraBoot that referenced this issue Nov 13, 2024
So we can deprecate the osbuilder-tools image in favor of this one.

Part of kairos-io/kairos#1633

Signed-off-by: Dimitris Karakasilis <[email protected]>
jimmykarily added a commit to kairos-io/AuroraBoot that referenced this issue Nov 13, 2024
So we can deprecate the osbuilder-tools image in favor of this one.

Part of kairos-io/kairos#1633

Signed-off-by: Dimitris Karakasilis <[email protected]>
jimmykarily added a commit to kairos-io/osbuilder that referenced this issue Nov 13, 2024
because it has been merged with auroraboot here:

kairos-io/AuroraBoot#110

as part of kairos-io/kairos#1633

Signed-off-by: Dimitris Karakasilis <[email protected]>
jimmykarily added a commit to kairos-io/osbuilder that referenced this issue Nov 14, 2024
because it has been merged with auroraboot here:

kairos-io/AuroraBoot#110

as part of kairos-io/kairos#1633

Signed-off-by: Dimitris Karakasilis <[email protected]>
jimmykarily added a commit to kairos-io/helm-charts that referenced this issue Nov 14, 2024
jimmykarily added a commit to kairos-io/AuroraBoot that referenced this issue Nov 14, 2024
…110)

* Copy over the osbuilder-tools image assets and merge with auroraboot

So we can deprecate the osbuilder-tools image in favor of this one.

Part of kairos-io/kairos#1633

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Print command output when things fail

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Build versioned image with earthly

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Fix ARG being in the global scope and not visible in the stage

this making the `auroraboot --version` command fail

https://docs.docker.com/build/building/variables/#scoping

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Set the correct arg in pipeline

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Add back qemu (needed by some test)

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Remove duplicate block in dockerfile and keep luet repos up to date

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Support images in the form of "dir:", in build-iso

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Let elemental handle the schema and create missing tmp dir

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Remove not necessary flag

it seems that it only fails when the user building is not the same as
the owner of the .git directory:

golang/go#53532

I only saw it when running:

```
docker run --rm -it -v $PWD:/work --workdir /work golang go build .
```

With `docker build` it just works (maybe that command handles the users
differently?). In any case, it doesn't affect CI or anything else so
I'll remove it.

Signed-off-by: Dimitris Karakasilis <[email protected]>

---------

Signed-off-by: Dimitris Karakasilis <[email protected]>
@jimmykarily
Copy link
Contributor Author

I extracted the last item to a separate ticket. Since it has nothing to do with consolidation of osbuilder and auroraboot, I don't think it is part of this epic. Let's close this one as soon as the other 2 items are done.

jimmykarily added a commit to kairos-io/osbuilder that referenced this issue Nov 15, 2024
* Remove references to osbuilder-tools image

because it has been merged with auroraboot here:

kairos-io/AuroraBoot#110

as part of kairos-io/kairos#1633

Signed-off-by: Dimitris Karakasilis <[email protected]>

* WIP

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Fix test command

Signed-off-by: Dimitris Karakasilis <[email protected]>

* go mod tidy

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Bump linting action

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Don't look for artifacts in build/ subdir

because it has been fixed here:

kairos-io/AuroraBoot#115

Signed-off-by: Dimitris Karakasilis <[email protected]>

---------

Signed-off-by: Dimitris Karakasilis <[email protected]>
jimmykarily added a commit to kairos-io/helm-charts that referenced this issue Nov 15, 2024
* Use auroraboot image as tools image

part of kairos-io/kairos#1633

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Update crds from osbuilder repo

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Bump action

Signed-off-by: Dimitris Karakasilis <[email protected]>

* Bump chart version

Signed-off-by: Dimitris Karakasilis <[email protected]>

---------

Signed-off-by: Dimitris Karakasilis <[email protected]>
@github-project-automation github-project-automation bot moved this from In Progress 🏃 to Done ✅ in 🧙Issue tracking board Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

1 participant