Commit Graph

488 Commits

Author SHA1 Message Date
Ettore Di Giacinto
edb1bb752a robot: Make linter happy 2022-07-25 22:26:10 +00:00
Ettore Di Giacinto
e9b07938cc robot: Add golangci file 2022-07-16 14:29:22 +00:00
Mauro Morales
648b755add Pass VERSION flag including v2 in path (#1290)
* Pass VERSION flag including v2 in path

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

* Pass VERSION flag including v2 in path for goreleaser

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

---------

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-04-13 19:44:19 +02:00
Mauro Morales
d6f4b637bd robot: Add version to goreleaser (#1252)
* Add version to goreleaser

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

* do not remove github token

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

* include version in dist target

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

* Add missing flag to pass the version

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

---------

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-04-05 12:24:19 +02:00
Itxaka
5c6b043e8d art: rename kairos-agent and add sha256 signatures (#670)
* 🎨 Change kairos agent release name and sign sha256

This patch changes the release artifact to be named kairos-agent instead
of just kairos, so its clear what the archive is referring to.

Also adds cosign signatures to the iso sha256 files so users can confirm
they havent been tampered with

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

* Add docs for signature and checksum verification for ISO

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

* Update version used for signing docs

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

---------

Signed-off-by: Itxaka <itxaka@spectrocloud.com>
Co-authored-by: Itxaka <itxaka@spectrocloud.com>
2023-01-28 17:55:26 +01:00
Ettore Di Giacinto
56b13e23aa art: Rebranding (#130)
See: https://github.com/c3os-io/c3os/issues/88
2022-09-17 18:43:51 +02:00
Ettore Di Giacinto
10dfe1876f robot: Fixup goreleaser build, drop windows builds for the agent 2022-08-17 08:40:24 +00:00
mudler
95a154e244 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
Ettore Di Giacinto
e3836c393c robot: Disable provider/agent builds on releases 2022-07-23 09:35:05 +00:00
Ettore Di Giacinto
0e3391a2f5 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
Ettore Di Giacinto
6b9084ab84 gear: installer -> cli 2022-02-18 18:41:36 +01:00
Ettore Di Giacinto
4a44e92f7e Update deps 2022-02-04 23:20:25 +01:00
Ettore Di Giacinto
8adf5bdef3 Add automated install via pairing 2022-02-02 00:02:30 +01:00
renovate[bot]
8d3d3ebd40 Update module github.com/Masterminds/semver/v3 to v3.2.1 (#1327)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-20 11:10:59 +00:00
Itxaka
febfa39632 bug: Fix version list (#1323)
* 🐛 Fix version list

First version in the list is the latest one.
Alos moves the check for same version above the current place, so it can
check before asking if you want to update to the same version

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

* 🌱 Rework versioning for upgrade

Use the semver lib to parse the versions into a proper collection where
it can be parsed and versions compared and sorted properly

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

* 🤖 lint

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

---------

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-04-20 09:57:58 +02:00
Mauro Morales
f0c9f3a1df seedling: Prefix variable names with distro name in os-release (#1263)
* Use site variables to update image flavor and name

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

* Typo

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

* Prefix variable names with distro name in os-release

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

* Adapt tests to read os-release with prefix

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

* Adapt docs to show how to read os-release with prefix

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

* Update SDK to be aware of attr prefixes

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

* Adapt test with new variable names

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

* Temporarily print the os-release

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

* Check KAIROS_VERSION on tests and fallback to VERSION

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

* Match kubo ID and VERSION_ID

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

* Make kubo extension match any ID

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

* Test still fails, trying with surrounding quotes

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

* Reduce tests wait time

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

* Use tumbleweed for bundles tests

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

* Update docs about systemd-sysext

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

* reduce wait time in reset tests

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

---------

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-04-19 22:37:00 +02:00
renovate[bot]
b7d3316d6b Update github.com/spectrocloud/peg digest to 2e15270 (#1264)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-18 16:23:15 +02:00
renovate[bot]
8523a70eeb Update module github.com/pterm/pterm to v0.12.59 (#1305)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-18 11:47:26 +02:00
renovate[bot]
137be210b5 Update module golang.org/x/oauth2 to v0.7.0 (#1267)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-18 11:44:02 +02:00
renovate[bot]
0a9005e7f0 Update module github.com/santhosh-tekuri/jsonschema/v5 to v5.3.0 (#1250)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-18 11:43:32 +02:00
renovate[bot]
6a27d7fd94 Update module github.com/swaggest/jsonschema-go to v0.3.49 (#1279)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-12 19:13:12 +02:00
renovate[bot]
8283d9c98f Update module golang.org/x/net to v0.9.0 (#1266)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-07 22:50:40 +02:00
renovate[bot]
49753c0cb9 Update module github.com/pterm/pterm to v0.12.58 (#1247)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-04 10:09:20 +02:00
Dimitris Karakasilis
8c4abd51b2 Run go mod tidy to fix errors
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-03-30 14:35:31 +03:00
renovate[bot]
dfc9b4830b Update module github.com/kairos-io/kcrypt to v0.5.2 (#1218)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-30 14:28:33 +03:00
Dimitris Karakasilis
355b636fd8 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
renovate[bot]
9c848453a9 Update module github.com/onsi/gomega to v1.27.6 (#1219)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-30 09:23:22 +02:00
Mauro Morales
36dd09c2db 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
renovate[bot]
4713ed05ed Update module github.com/urfave/cli/v2 to v2.25.1 (#1195)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-29 09:21:34 +02:00
renovate[bot]
eae59a8b4b Update module github.com/pterm/pterm to v0.12.57 (#1206)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-28 23:48:57 +00:00
renovate[bot]
7512db55ca Update module github.com/imdario/mergo to v0.3.15 (#1190)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-25 09:30:10 +01:00
renovate[bot]
6d228317fc Update module github.com/onsi/gomega to v1.27.5 (#1185)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-24 08:08:00 +01:00
renovate[bot]
bd785f2952 Update module github.com/onsi/ginkgo/v2 to v2.9.2 (#1184)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-23 22:09:43 +01:00
Itxaka
48eb4ec294 Bump to newer sdk (#1166) 2023-03-18 10:27:18 +01:00
Itxaka
e024c7ccf3 arrow_up: Bump repositories (#1163) 2023-03-17 14:04:43 +01:00
renovate[bot]
9016bff05b Update module github.com/imdario/mergo to v0.3.14 (#1148)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-16 12:25:38 +01:00
Itxaka
a0a7fee9f9 sparkles: Use kairos-sdk module (#1140) 2023-03-15 15:45:00 +01:00
renovate[bot]
985f7d00ea Update module github.com/itchyny/gojq to v0.12.12 (#1085)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-15 08:32:26 +01:00
renovate[bot]
e4dfa16ce2 Update module github.com/swaggest/jsonschema-go to v0.3.48 (#1094)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-14 14:03:39 +01:00
renovate[bot]
9d1cc7934c Update module github.com/pterm/pterm to v0.12.55 (#1086)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-14 14:03:00 +01:00
renovate[bot]
957edf3970 Update module github.com/urfave/cli/v2 to v2.25.0 (#1098)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-14 14:01:13 +01:00
renovate[bot]
ab0a77fa92 Update module github.com/onsi/gomega to v1.27.4 (#1129)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-14 13:59:36 +01:00
renovate[bot]
dd6bbce14a Update module golang.org/x/oauth2 to v0.6.0 (#1104)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-14 10:41:02 +01:00
Itxaka
cc567510b3 bug: downgrade yip (#1088)
Looks like yip 1.x is not working as expected, skipping stages and
whatnot

This downgrades it to a know working 0.11.x version until those issues
are fixed

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-10 13:42:15 +01:00
Itxaka
5d355732fd bug: Bump yip (#1082)
version 1.0.0 wont run all stages in certains cases

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-10 08:27:24 +01:00
Itxaka
eb25d56f59 Bump ghw and fix state (#1073)
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-09 17:18:37 +01:00
Oz Tiram
0a43ea7956 🔧 Use random free port for Spice display and SSH (#832)
* Refactor tests to use the "VM" construct from peg

📖 Add cloud-config.json for v1.6.0 (#977)

:docs: Add cloud-config.json for v1.6.0

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

📖 Add documentation about schema validation (#978)

* 📖 Add documentation for cloud config validation

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

* Add image

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

* Move image to static dir

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

---------

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

🐛 Backport dracut patch for ubuntu 20 iscsi (#979)

🔧 Use random free port for Spice display and SSH

When running the install test with qemu, the second test will
fail because the 2nd machine will fail to start.
The failure is cause because the port of the previous machine is
still not freed.
Hence, let the install-test use a differnet random port if not
specified.
`GetFreePorts` copied from `kairos-io/kcrypt-challenger`.
Credits @jimmykarily.

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

Update peg and use new VM interface

This enables creating mulitple VMs in parallel
as done in kairos-io/kcrypt-challenger.

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

Handle possible collision of spice and SSH ports

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

Migrate all tests to new PEG API

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

Remove one more reference to old API.

Replace Machine.SendFile with vm.Scp

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

Try and fix bundle_tests

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

Temporarily disable many flavours

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

Bump peg and fix code

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

Remove unecessary output and fix test issues

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

Make sure we install before we start checking things.

It seems that we were relying on previous tests to do the installation
because we only had one "Machine".

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

Bump peg to better handle "Sudo", dedup tests

and make sure installation has happened before every check

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

Wait until systemd service becomes active

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

Merge multiple similar tests into one

because the big overhead comes from the BeforeEach block which is the
same in all tests. The tests themselves are just checking differnet
things on similar VMs. By merging them we same a lot of time in
preparing the same env again and again.

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

Fix forgotten "Machine"

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

Bring all flavors back

This partly reverts commit aa029c20acd79c46122783aad030e2a5410a9374.

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

Merge similar tests an uncomment code

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

Fix fogotten global Machine function

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

Wait for systemd-sysext to do its thing

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

Fix forgotten global Sudo and remove gatherLogs

which wasn't working anyway

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

Fixes after rebase

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

Fix `source` not present in ubuntu/debian `/bin/sh`

and add debug output to failed test

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

* Bump peg to fix "read only filesystem" error in tests

50b63c0bf8

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

* Use "." instead of "source" in vm's "/bin/sh"

because "source" is not recognised in debian based flavors

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

* Bump peg to fix vm.Sudo problems

and remove redundant check.

Now peg just pipes the ssh command without creating tmp scripts

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

---------

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Co-authored-by: Mauro Morales <mauro.morales@spectrocloud.com>
Co-authored-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-03-01 23:55:40 +01:00
Itxaka
5bfceade0f 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
d51a9f3470 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
renovate[bot]
31eb84bb82 Update module github.com/labstack/echo/v4 to v4.10.2 (#939)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-22 07:18:54 +01:00