Commit Graph

26 Commits

Author SHA1 Message Date
Itxaka
c170fc554a warning: 🎨 Use immucore 🦔 (#877)
* ⚠️ 🎨  Use immucore

Build kairos with immmucore instead of cos-immutable-rootfs

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* 🐛 Fix state sdk

State sdk is using ghw to identify the state of the disks, but
unfortunately ghw only works with devices and not with labels

This patch adds a workaround by checking deeper for partitions that
migth not have mountpoints reported by ghw but are indeed mounted

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* 🐛 Fix state not catching netboot properly

This worked with the old cos-immutable-rootfs due to the rd.cos.disable
stanza in cmdline making the livecd cloud config file trigger, which
created the livecd sentinel file.

With immucore, the sentinel is being created during initramfs directly
so we need to rely on the cmdline to identify it.

State sdk should know that having the netboot stanza should identify the
boot as cdlive

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* Fix custom binds set as RW_PATHS

RW_PATHS are meant for overlay dirs which go away after a reboot.
Custom binds/binds are mounted under COS_PERSISTENT, so they persist
after reboot AND are RW by default.

This patch removes adding the custom binds into the RW_PATHS on the
cos-layout file as that can lead to unintended consequences

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* Dont run custom mounts on livecd and recovery

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* Rework writing custom ephemeral/binds

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* Maybe fix tests

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* Add missing sgdisk to ubuntu images

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* 🐛 Backport dracut patch for ubuntu 20 iscsi

There was an issue with dracut 48 in which the iscsid.socket required fs
targets to be ready. On an iso this could lead to a dependency cycle
between the dmsquash module setting up the livecd rootfs and the iscsi
socket required the initrd-fs to be ready.

This was fixed on dracut 50 and its what this patch brings, dropping the
socket dependency on the fs target so it can break the dependency cycle.

This only affect ubuntu 20 lts, and only affects booting from the iso.
Alos the issue is random as systemd will decide to break the dependency
in a non predictable way by disabling one of the services that conflict,
so sometimes it would be the iscsi serviec, which would make the iso
boot but sometimes it could be other more important services liek teh
local fs or the dracut pre-mount services.

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
(cherry picked from commit 63f0c75d69ab3adca143f917c2e31b75ca3d96c7)

* Bump immucore

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

---------

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
2023-03-01 00:02:10 +01:00
Ettore Di Giacinto
61cc567cd8 seedling: Detect more information about runtime (#956)
* 🌱 Detect more information about runtime

This introduces a `system` and a `kairos` block available in
kairos-agent get state.

This allows for instance to query the agent for the kairos version as
such:

`kairos-agent get state kairos.version`

Part of #755

Signed-off-by: mudler <mudler@c3os.io>

* 🤖 Fixup tests

Signed-off-by: mudler <mudler@c3os.io>

---------

Signed-off-by: mudler <mudler@c3os.io>
2023-02-26 20:18:49 +01:00
Santhosh
27a33ce381 import the images to any CRI on start from the local filesystem (#857)
import the images to containerd on start from the local filesystem

Signed-off-by: Santhosh <santhosh@spectrocloud.com>
2023-02-09 21:40:56 +05:30
Santhosh
485e2da5cb set local_file bundleconfig to true if target prefix is file:// (#823)
set local file bundleconfig to true if target prefix is file://

Signed-off-by: Santhosh <santhosh@spectrocloud.com>
2023-02-07 18:13:03 +05:30
Santhosh
31eb6ec19d unpack local image file (#803)
LocalFile in BundleConfig, to prefix file:// to Target image file
Unpack local image file

Signed-off-by: Santhosh <santhosh@spectrocloud.com>
2023-02-02 22:24:16 +05:30
Ettore Di Giacinto
7d66776a34 seedling: Keep current dir when installing runnable bundles (#582)
Signed-off-by: mudler <mudler@c3os.io>

Signed-off-by: mudler <mudler@c3os.io>
2022-12-23 16:51:54 +01:00
Santhosh
2870c9111e add env and cacerts attributes to clusterplugin.cluster object (#556)
add env and cacerts attributes to clusterplugin.cluster object

Signed-off-by: Santhosh <santhosh@spectrocloud.com>

Signed-off-by: Santhosh <santhosh@spectrocloud.com>
2022-12-14 14:27:45 +05:30
Dimitris Karakasilis
8fbc72447e Add helper function to unstructured (#527)
* Add helper function to unstructured

to be used in: https://github.com/spectrocloud/kubesplit/tree/remove-dependencies

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* Add tests

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2022-12-05 19:56:21 +02:00
Ettore Di Giacinto
b99d55b900 seedling: Glob all configs found (#502)
* 🌱 Glob all configs found

This allows to read all the configs found during scanning - this is especially useful in first boot as it allows
to have separate config file logic split into several files

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>

* 🌱 Simplify config merge logic

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* WIP

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* 🌱 Make the function work

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Signed-off-by: mudler <mudler@kairos.io>

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: mudler <mudler@kairos.io>
Co-authored-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2022-11-28 15:37:45 +01:00
Eng Zer Jun
b92c2eaf6b art: Move from io/ioutil to io and os packages (#470)
refactor: move from io/ioutil to io and os packages

The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit
replaces the existing io/ioutil functions with their new definitions in
io and os packages.

[1]: https://golang.org/doc/go1.16#ioutil
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-11-22 01:11:03 +08:00
Ettore Di Giacinto
5f43f69352 seedling: Add build profile to simplify flavors maintenance (#463)
Signed-off-by: Ettore Di Giacinto <mudler@kairos.io>

Signed-off-by: Ettore Di Giacinto <mudler@kairos.io>
2022-11-21 09:48:23 +01:00
Ettore Di Giacinto
a4ff805b0f arrow_up: Bump repository and drop some workarounds (#434)
* ⬆️ Bump Kairos repositories

Signed-off-by: Ettore Di Giacinto <mudler@mocaccino.org>

* 🐧 Find out which grub to call

Signed-off-by: Ettore Di Giacinto <mudler@mocaccino.org>

Signed-off-by: Ettore Di Giacinto <mudler@mocaccino.org>
2022-11-16 11:44:18 +01:00
Ettore Di Giacinto
d6fc1751b0 seedling: Add 'found' to partition state (#342)
* 🌱 Add 'found' to partition state

This allows to programmatically query the state if partitions were found

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>

* 🤖 Add tests

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
2022-10-31 18:40:19 +01:00
Ettore Di Giacinto
8b862e5e6a sparkles: enhancements (#263)
* 🎨 Do not need to prefix '.' on queries

*  Add recovery to stateapi

*  Add cloudconfig SDK

*  Unify post-install/firstboot hooks

This also adds capabilities to add grub option at first boot rather than
after installation as for bundles.

* 🤖 Optimize tests to wait for state to change
2022-10-24 08:34:49 +02:00
Ettore Di Giacinto
696e87bbee sparkles: state api sdk (#262)
*  Add state api

This is related to https://github.com/kairos-io/kairos/issues/34.

Starts to unify the API to retrieve the state in the sdk to have a common place to query system status information.

* 🤖 Add test

* Update go.mod

* ⚙️ Fine-tune detection of partitions

* 🤖 Add more fine-grained tests

* 🎨 Add /dev/ to partition name

* 🤖 Fixup tests

* ⚙️ Remount accessors

*  Add state partition to cloud-init paths

* 📝 Upper case Kairos in motd

* 🎨 Add mounts sdk

* 🎨 Set grub options via SDK

* 🎨 Make it more idiomatic
2022-10-23 20:22:32 +02:00
Ettore Di Giacinto
5aeed0ddd2 sparkles: Add reset event for sdk (#143) 2022-09-23 17:20:23 +02:00
Ettore Di Giacinto
b2071db5db art: Rebranding (#130)
See: https://github.com/c3os-io/c3os/issues/88
2022-09-17 18:43:51 +02:00
Jacob Payne
4be833ccfe add support for json serialziation of cluster objects (#89) 2022-08-27 00:44:42 -07:00
Ettore Di Giacinto
ee3c7f5775 robot: Add bundles test suite, fixup linting issues 2022-08-18 15:19:15 +00:00
Ettore Di Giacinto
41f419fcd1 art: Add EventError to sdk 2022-08-18 13:26:53 +00:00
Ettore Di Giacinto
d1c9d2a063 art: Expose to sdk upgrade/list events 2022-08-18 13:12:05 +00:00
mudler
14cd97cf0d robot: Run only relevant tests, push to core-*
From now on images built from this repo are the c3os core images.
c3os core images contains only the base image, framework files and the c3os agent.

This also sets up tests accordingly to run only to cover the c3os-agent.
2022-08-12 15:49:41 +02:00
mudler
f3ce62216c art: Expose interactive install to providers
In this way install can be driven from providers too

Part of: https://github.com/c3os-io/c3os/issues/68
2022-08-12 12:21:12 +02:00
mudler
f2d186b4f9 art: Move out recovery
Will be part of the provider

Part of: https://github.com/c3os-io/c3os/issues/68
2022-08-12 09:41:17 +02:00
mudler
a8f5593beb art: Drop provider from c3os code
Part of: https://github.com/c3os-io/c3os/issues/68
2022-08-10 18:56:07 +02:00
Ettore Di Giacinto
2844b7fc15 Merge pull request #55 from c3os-io/feature/cluster-provider
Abstract Cluster Provisioning with Cluster Plugins
2022-08-09 08:01:54 +02:00