Commit Graph

488 Commits

Author SHA1 Message Date
scuzhanglei
98ec3aa12c Make kairos-agent support install local bundle (#1296)
Signed-off-by: zhanglei <zhanglei@smartx.com>
2023-04-14 23:33:02 +08:00
Dimitris Karakasilis
863ca11b1d Change module path according to Go docs (#1220)
https://go.dev/doc/modules/major-version

This way we can bump the kairos dependency on the provider-kairos repo

which otherwise produced the error:

```
~/workspace/kairos/provider-kairos (main)*$ go get -u github.com/kairos-io/kairos@v2.0.0-alpha3
go: github.com/kairos-io/kairos@v2.0.0-alpha3: invalid version: module contains a go.mod file, so module path must match major version ("github.com/kairos-io/kairos/v2")
```

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Co-authored-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-30 14:18:53 +03:00
Mauro Morales
582d84c1c7 sparkles: Custom partitioning refactor config (#1180)
* Introduce config/collector package

to split the collection of config sources out of the config package.

Each consumer of the new package will take care of unmarshalling the
yaml to a specific Config struct, do validations etc.

* Add tests and remove garbage
* Follow all config_url chains and test it
* Add missing options file and refactor cmdline code
* Consolidate the way we merge configs no matter where they come from
* Allow and use only files with valid headers

Config is  specific to Kairos while Collector is generic. This
will allow us to do validations which are just related to Kairos at the
config level, while including every type of key and querying of the full
yaml at the Collector level splitting the responsibilities of each
package.

---------

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-03-29 16:25:38 +02:00
Itxaka
994c21fdc6 seedling: Add auth flags to upgrade (#1179) 2023-03-24 14:00:33 +01:00
Itxaka
518d29be7d Bump to newer sdk (#1166) 2023-03-18 10:27:18 +01:00
Itxaka
1a18305da4 sparkles: Use kairos-sdk module (#1140) 2023-03-15 15:45:00 +01:00
Oz Tiram
7a13280fb6 bug: Fix link to QR code (#1046)
While working on #687, I noticed that this link is broken.
It's a tiny fix which can be merged without waiting for the actual
fix of the above mentioned issue.

Signed-off-by: Oz Tiram <oz@spectrocloud.com>
2023-03-06 19:16:19 +01:00
Mauro Morales
08feaf3e92 sparkles: Integrate schema validation (#853)
* Change ValidationError to return the actual error

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add validate command

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Warn validation errors when scanning configs

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Lint

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add schema command to print config json schema

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add strict-validations flag

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Lint and remove focus

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Rename command schema to print-schema

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Fix issue by reading originalData

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Lint

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Remove test from removed feature

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add comments to exported functions

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Lint

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add test for validate.go

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Remove focus

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add more tests for root schema

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add more tests

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

---------

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
Co-authored-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-02-14 16:15:13 +01:00
Mauro Morales
21ab650dc3 arrow_up: Upgrade urfave/cli to v2 (#713)
Upgrade urfave/cli to v2

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-01-25 00:39:51 +01:00
Mauro Morales
9bd28bccf5 bug: Remove duplicated list of upgradable releases (#688)
* Remove duplicated list of upgradable releases

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Make list output consistent

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-01-19 22:16:13 +01:00
Oz Tiram
2bfe7c1965 seedling: Add version information directly from git (#651)
* 🌱 Add version information directly from git

Partial fix for kairos-io/kairos#643.

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* Update cmd/profile-build/main.go

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

Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
2023-01-16 19:24:11 +01:00
Ettore Di Giacinto
8a615c430e seedling: Webui installer (#587)
* 🌱 Add webui

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

* 🌱 Re-read config files after loading bundles

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

* [check-spelling] Update metadata

Update for https://github.com/kairos-io/kairos/actions/runs/3806058276/attempts/1
Accepted in https://github.com/kairos-io/kairos/pull/587#issuecomment-1367859480

Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
Signed-off-by: mudler <mudler@c3os.io>

* 🎨 Beautify index page

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

* Do not rerun if we were successful or we are already running

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

* Add syntax highlight

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

* Add error message

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

* Add YAML validation and highlight

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

* Fixup terminal output

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

* Fix newlines

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

* fixups

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

* 🎨 Fixup lint issues

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

* Mark dependencies

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

* Let configure the listening address

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

Signed-off-by: mudler <mudler@c3os.io>
Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
2023-01-05 14:15:05 +01:00
Ettore Di Giacinto
3b90b1a482 seedling: Return configuration data from the agent (#567)
* 🌱 Return configuration data from the agent

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

* 🤖 Cover query by tests

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

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
2022-12-19 17:01:57 +01:00
Ettore Di Giacinto
ea51cd6ef2 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
Santhosh
d655ffcee7 set configScanDir as package scoped var (#264)
set config.Install.env variables in environment

adding env to config to use across all stages

switch to config.Scan to read config
2022-10-24 16:43:23 +05:30
Ettore Di Giacinto
8ed0ce3d58 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
2b0adaeb9b 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
c2d5f3befa memo: Move URL to kairos.io 2022-09-17 22:11:45 +00:00
Ettore Di Giacinto
4404dda133 art: Rebranding (#130)
See: https://github.com/c3os-io/c3os/issues/88
2022-09-17 18:43:51 +02:00
Ettore Di Giacinto
6fc5aa32a7 sparkles: Add manual-install 2022-09-10 13:01:03 +00:00
Ettore Di Giacinto
25c0da20cb art: Move ListOutput under utils 2022-08-18 13:14:12 +00:00
Ettore Di Giacinto
b57d97fcab art: Expose to sdk upgrade/list events 2022-08-18 13:12:05 +00:00
Ettore Di Giacinto
be558ead39 art: Add --debug to upgrade 2022-08-17 08:31:39 +00:00
mudler
149c825e4b 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
cb7d203a86 art: Drop CLI from c3os codebase
Part of: https://github.com/c3os-io/c3os/issues/68
2022-08-11 13:31:00 +02:00
mudler
c2721eb53c 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
43907c8d95 Merge pull request #55 from c3os-io/feature/cluster-provider
Abstract Cluster Provisioning with Cluster Plugins
2022-08-09 08:01:54 +02:00
Ettore Di Giacinto
fe08c577ed art: Allow the agent to self-restart on error
In init systems that don't support automatic restart this might be handy when we fail because we boot up too fast.

This is an attempt to fix https://github.com/c3os-io/c3os/issues/47
2022-08-08 08:15:15 +00:00
Ettore Di Giacinto
c8244f7dbd robot: Make linter happy 2022-07-25 22:26:10 +00:00
Ettore Di Giacinto
bc7c3b95dc art: Refactor agent code
Move out cmd pieces and split into its own package. Also make sure we reload
plugins before bootstrapping nodes.

Also commons out the agent configuration in a specific YAML file.
2022-07-18 22:02:49 +00:00
Ettore Di Giacinto
b11530714c gear: Setup log rotation 2022-07-17 08:42:12 +00:00
Ettore Di Giacinto
1a03c96235 art: Refactor out config sections
Now there is a `install` section in the config that has the fields that previously where in `c3os` but
were actually only used during install phase.

Also the k3s and c3os config were moved to the provider instead that in the global config.
2022-07-16 20:47:55 +00:00
Ettore Di Giacinto
5bb5ff9253 arrow_up: bump go-pluggable 2022-07-16 15:24:10 +00:00
Ettore Di Giacinto
c890936889 robot: Try to fixup tests 2022-07-16 14:28:55 +00:00
Ettore Di Giacinto
1f712225e4 gear: Add c3os bundles 2022-07-13 22:23:47 +00:00
Ettore Di Giacinto
d2627c5a45 art: Split build targets to speedup process 2022-07-09 18:13:25 +00:00
Ettore Di Giacinto
c7cbb37b24 gear: Extract netboot artifacts
This changeset also adds a `config_url` and `options` keyword in the c3os config.
Along with that the config logic is changed so the configuration is taken also from boot commands and merged in the final installed config file.
2022-07-07 16:57:38 +00:00
Ettore Di Giacinto
b2e49776a3 Split off cli into separate binaries (#37)
* 🎨 Split off cli into separate binaries

This commit splits off the cli into 3 binaries:
- agent
- cli
- provider

The provider now is a separate component that can be tested by itself
and have its own lifecycle. This paves the way to a ligher c3os variant,
HA support and other features that can be provided on runtime.

This is working, but still there are low hanging fruit to care about.

Fixes #14

* 🤖 Add provider bin to releases

* ⚙️ Handle signals

* ⚙️ Reduce buildsize footprint

* 🎨 Scan for providers also in /system/providers

* 🤖 Run goreleaser

* 🎨 Refactoring
2022-07-04 22:39:34 +02:00