Commit Graph

44 Commits

Author SHA1 Message Date
David Cassany 9a1892b4c8 Simplify podman calls in CI steup
Ubuntu 24.04 ships podman v4 which fixes a v3 issue
on loading images. With v4 loaded images keep the
image name if present.

Signed-off-by: David Cassany <dcassany@suse.com>
2024-12-13 11:27:38 +01:00
David Cassany 737983ab60 Switch GHA runners to Ubuntu 24.04
Ubuntu 24.04 is about to the version deployed with ubuntu-latest.
This commit is to start using it and validating it before the actual
change happens.

Signed-off-by: David Cassany <dcassany@suse.com>
2024-12-13 11:27:38 +01:00
David Cassany Viladomat 5f996b5dba
Expand downgrade test by upgrading back to origin after downgrading (#2224)
* Expand downgrade test by upgrading back to origin after downgrading

Signed-off-by: David Cassany <dcassany@suse.com>

* Adapt github worflow to handle cache for downgrade tests and import the container images

Signed-off-by: David Cassany <dcassany@suse.com>

---------

Signed-off-by: David Cassany <dcassany@suse.com>
2024-11-12 11:12:51 +01:00
David Cassany Viladomat 644cdc72ef
Refactor ci (#2137)
* Refactor CI to use a local registry
* Cache image and fetch image tarballs
* Composite fetch images
* Push to insecure registry with podman
* Simplify workflow runs
* Improve cache cleanup
* Improve ip detection

Signed-off-by: David Cassany <dcassany@suse.com>
2024-07-11 09:32:42 +00:00
David Cassany Viladomat 80bd8d8171
make configurable boot-assessment checks (#2018)
* make configurable boot-assessment checks

Signed-off-by: David Cassany <dcassany@suse.com>

* Improve EventuallyConnects in tests

Signed-off-by: David Cassany <dcassany@suse.com>

* Fix fallback test

Signed-off-by: David Cassany <dcassany@suse.com>

* Store boot assessment variables in grubenv

This commit refactors the boot-assessment logic to run checks
with a customizable service and to store grub variables in
already existing files in EFI partition and OEM.

Also the EFI partition is made accessible in after-*-chroot
hooks. This makes easier to write and manage files in EFI
partition if needed (e.g. grub_oem_env variable file), without
having to relay on mounts or remounts.

Signed-off-by: David Cassany <dcassany@suse.com>

---------

Signed-off-by: David Cassany <dcassany@suse.com>
2024-03-22 14:11:04 +00:00
Fredrik Lönnegren 4ff0f27bfc
Turn off smm test
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2024-03-22 14:41:14 +01:00
Fredrik Lönnegren 9a53309504
Turn off secure boot test
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2024-03-22 14:33:25 +01:00
Fredrik Lönnegren c0f39f2dbd Test qemu secure boot
Add qemu settings for secure boot and add test in smoke suite to
actually test that secure boot is enabled.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2024-03-21 14:58:49 +01:00
Fredrik Lönnegren 9676ec906c
Refactor early system mounting (#1866)
* Add mount command

The mount command mounts the system and is meant to run in an initrd to
actually mount the root filesystem and use systemd to switch-root into
it.

It also optionally writes an /etc/fstab file to the newly mounted
system so that systemd will mount the system after switching root.

The command is used in the new dracut module elemental-rootfs, which
will coexist with immutable-rootfs (they are functionally the same)
until immutable-rootfs can be deprecated.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Add tmpfs overlay mount

Mounts a tmpfs to /run/elemental/overlay with size= flag set

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Examples use the new elemental-rootfs

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Add persistent overlay mounts

Persistent mounts use the /run/elemental/persistent/.state directory to
store upper and work dirs.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Add sentinel files

Write sentinel file (active_mode, passive_mode, recovery_mode) to
/run/cos or /run/elemental based on which kernel cmdline is used
(cos-img/filename or elemental.image)

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Read kernel cmdline for mount

This commit adds capabilities to the mount command to read configuration
from the kernel cmdline. The supported parameters are:

* elemental.disable + rd.cos.disable
* elemental.image + cos-img/filename
* elemental.oemlabel + rd.cos.oemlabel

In the new elemental.image parameter we can specify
active|passive|recovery instead of the path to the image.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Enable recovery booting and reset

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Load env vars

Currently supported:
* OVERLAY
* RW_PATHS
* PERSISTENT_STATE_PATHS
* PERSISTENT_STATE_BIND

Loaded from files (if they exist):
* /run/elemental/layout.env
* /run/cos/cos-layout.env

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Run rootfs stage inside mount command

Since the rootfs stage should be run between mounting the image and
mounting the rest of the system I added a call to RunStage that takes
care of this and then uses godotenv dependency to actually load
/run/elemental/layout.env and /run/cos/cos-layout.env.

This means the old way of generating layout files will still work with
the new mount-command.

The caveat here is that in the current implementation the rootfs stage
will run twice, once from the elemental-setup-rootfs service and once
from this command. I would say the easiest way forward is to remove the
elemental-setup-rootfs when switching to elemental-rootfs as the default
mounting module.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Add persistent bind mounts

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Add block overlay

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Use registry.opensuse.org for example images

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Minor changes to get tests working

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Fsck partitions before mounting

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Fix for fsck

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

More mount tests

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Comment mount example configuration

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Add elemental-setup services to elemental-rootfs

The elemental-setup and rootfs features are heavily dependent on each
other.

This commit copies the elemental-setup feature into elemental-rootfs,
and changes the mount-command to actually start the
elemental-setup-rootfs service during mount to not run the yip rootfs
stage twice.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Fix lint goconst

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

* Add elemental-sysroot feature

The features elemental-sysroot, elemental-rootfs and elemental-setup are
used for mounting the root filesystem and all overlays.

elemental-sysroot is used for mounting state/recovery partition to
/run/elemental/state, and then mounting the image from the partition
based on kernel parameters.

elemental-setup actually runs the different stages of boot using
elemental run-stage command.

elemental-rootfs runs the 'elemental mount' command to mount tmpfs
overlays, persistent overlays and then writes the /etc/fstab to actually
mount when pivoting to the new root.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

* Update sysroot, setup and rootfs dracut modules

This commit goes through the early systemd services run in dracut and
adds Wants,Before,Requires to each step to make them run during the
correct stage of the bootup (man dracut.bootup).

We also change all the /run/cos and /run/initramfs/cos-state to the new
/run/elemental and /run/initramfs/elemental-state directories.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

* Test compatibility

Tests still use /run/cos, this commit adds back
/run/cos/active|passive|recovery_mode files

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

* Update to latest ele-testhelpers

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

* Forwards compatibility for immutable-rootfs feat

This commit makes the immutable-rootfs module forwards compatible with
the other changes in mount, elemental-sysroot and elemental-setup.

It uses the new elemental.image and elemental.oemlabel cmdline paramters
if found, otherwise falls back to the old parameters and also sets the
/run/elemental/active|passive|recovery_mode files.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

* Update init features for green and tumbleweed

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

* Remove oem mounts from elemental-setup-initramfs

This should fix installer-tests in CI since the /oem might not exist
when booting from ISO.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

---------

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-12-12 13:50:54 +00:00
David Cassany 6290bf3f85 Improve CI stability
Adds several improvements:

* Check VM pid on 'EventuallyConnects'. So it does not wait for a
  command to succeed if the underlaying VM crashed and it is not
  running.

* Does not use '-daemonize' flag of qemu, now it simply runs on the
  background and the stdout and stderr are redirected to vmstdout file.

* Does not install QEMU, the runner already has a recent QEMU version
  installed. This saves several minutes on each macos job.

* Fixes some of the stability issues on macOS by disabling hugepages on
  the kernel. This is not supported on macOS.

Signed-off-by: David Cassany <dcassany@suse.com>
2023-10-31 11:00:55 +01:00
David Cassany bf2cdb9a6b Try different drivers for macOS
Signed-off-by: David Cassany <dcassany@suse.com>
2023-10-30 10:34:03 +01:00
David Cassany 80828a213d Add installer test
This commit adds an installer test and moves the smoke
test to be executed on the installed system rather than the
disk build.

Signed-off-by: David Cassany <dcassany@suse.com>
2023-10-30 10:34:03 +01:00
Fredrik Lönnegren f6dc1ebef7
Add aarch64 workflow (#1779)
* Add arm64 workflow

This commit adds arm64 to the build-matrix for PRs and checks if the PR
is labeled with arm64 before running.

ARM64 tests are run on self-hosted runners while x86_64 tests are still
run on github macos-latest runners.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-06-16 15:45:27 +02:00
Fredrik Lönnegren cfdc4b30c0 Set docs BASE_URL
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-06-05 14:25:55 +02:00
Fredrik Lönnegren b3d140e829 Fix docs
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-06-05 13:49:01 +02:00
Fredrik Lönnegren ab064b6567
Update docsy to latest version (#1786)
This commit makes the `make build-docs` work without errors again.

The docsy submodule was updated and added an npm-install step to
download dependencies used by docsy.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-06-05 13:23:35 +02:00
Fredrik Lönnegren 78d856f2d2
Publish docs to gh-pages (#1783) 2023-06-02 17:47:56 +02:00
Fredrik Lönnegren c32f7a0b6b Use 4GB of memory for test-machines
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-05-23 09:45:19 +02:00
Fredrik Lönnegren 7d53dfc966 Add -smp flag to qemu-system
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-05-16 15:33:26 +02:00
David Cassany f855fd698f Refactor tests
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany 429341549c Reduce disk size and free worker space
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany 648048ddff Add reset and local upgrade tests
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
Fredrik Lönnegren 574d41aa83 Set no acceleration for tests
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-05-11 15:31:28 +02:00
Fredrik Lönnegren 7c1a62e4ac Delete scripts/get_luet.sh
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany c64c0fe384 Adding hooks test
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany ac6bc0af33 Add installer test
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany 342a45ecc2 Make use cache instead of uploading artifacts
This commit makes use of caches for qcow2 and ISO disks to speed up
CI tests and allow reuse if changes are not affecting them. Specially
interesting to iterate on tests without having to rebuild everything
when the changes are on the actual test.

Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany 5d643a0168 Include elemental-cli in toolkit and build it based on commit or tag
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany c272f599b9 Moving to a pure qemu approach for testing, no vagrant, no libvirt
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany 723bd937f2 Add test execution to Makefile
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
Itxaka f3a370f37d
Change green for teal as the default base (#1321)
* Change green for teal as the default base

Signed-off-by: Itxaka <igarcia@suse.com>

* Revert auto bumped go.mod/sum

Signed-off-by: Itxaka <igarcia@suse.com>

* Rememeber that pr-docker jobs are deactivated

Signed-off-by: Itxaka <igarcia@suse.com>

* revert standard dockerfile for now

Signed-off-by: Itxaka <igarcia@suse.com>

* go.mod shenanigans

Signed-off-by: Itxaka <igarcia@suse.com>

* debuig: Add final repo to build iso for now

Signed-off-by: Itxaka <igarcia@suse.com>

* Add final repo to manifest when building local iso

So any missing packages on local build are obtained from the repo of our
flavor, instead of relyaing in the green repo

Signed-off-by: Itxaka <igarcia@suse.com>

* debug

Signed-off-by: Itxaka <igarcia@suse.com>

* bump cos & luet-mtree

Signed-off-by: Itxaka <igarcia@suse.com>

* Remove final repo on build images

We now use the manifest to add the proper repo with the proper priority

Signed-off-by: Itxaka <igarcia@suse.com>

* Fix repo url on iso build

Signed-off-by: Itxaka <igarcia@suse.com>

* Fix standard example

Signed-off-by: Itxaka <igarcia@suse.com>

* update docs

Signed-off-by: Itxaka <igarcia@suse.com>

* Bump version for tests

Signed-off-by: Itxaka <igarcia@suse.com>

* Debug

Signed-off-by: Itxaka <igarcia@suse.com>

* Fix tests to use the new --system-uri from elemental

Signed-off-by: Itxaka <igarcia@suse.com>
2022-05-19 21:56:16 +02:00
Ettore Di Giacinto 982d796be2
Use hugo from toolchain (#1331)
* Use hugo from toolchain

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* Bump bootstrap luet version

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-05-17 21:30:05 +02:00
Ettore Di Giacinto ca1f140b15
ci: Add pipeline option to force install from upstream repo (#1266)
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-04-28 20:13:09 +00:00
David Cassany Viladomat d912c06837
Consume local builds for the toolchain (#1263)
Signed-off-by: David Cassany <dcassany@suse.com>
2022-04-27 17:21:08 +00:00
Itxaka 0fff8c1a64
Fix a duplicated key in the luet config (#1215)
We had a duplicated key in the generated luet config by
scripts/get_luet.sh

Signed-off-by: Itxaka <igarcia@suse.com>
2022-04-01 14:07:37 +02:00
Ettore Di Giacinto fa0773f21e
Unflaky ci - 2 (#1206)
* ci: remove dangling container after bootstrap

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* ci: correctly skip EFI section

Replace with a smaller test and mark to pending the remaining

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-03-25 16:02:56 +00:00
Ettore Di Giacinto f7a8590652
Unflaky ci tests (#1204)
* ci: Disable flaky EFI tests

See #1202

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* ci: Split up installer tests

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* ci: trigger on test changes

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* ci: Add docker install in bootstrap script

Also add checksum verification when downloading the blob with curl

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* ci: Force docker install in our pipeline

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-03-25 12:19:00 +00:00
Ettore Di Giacinto 8b8380682e
scripts: detect system arch (#1091)
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-03-24 17:01:08 +00:00
Itxaka 0f335814aa
Bump luet-cosing to republish (#1121) 2022-02-10 13:39:39 +01:00
Itxaka 3e201702cf
ci: Add no spinner to deps (#671)
Signed-off-by: Itxaka <igarcia@suse.com>
2021-09-20 19:15:59 +02:00
Itxaka d4a2502af6
ci: Add arch to CI builds (#614)
* ci: Add arch to CI builds

This adds an arch value to the ci templates in order to differentiate
between the current amd64 and future arches that we may add.

On top of that it expands the ci templates with the labels value which
would add an extra step to the workflow in order to check for the given
labels in the PR and fail the workflow otherwise (Useful for arches,
do-not-test, etc...)

It also adds an arm64 workflow that runs on self runners for PRs labeled
with the arm64 label. Currently a separated one as its experimental..and
we dont have arm54 runners yet :D

Signed-off-by: Itxaka <igarcia@suse.com>

* ghrunner: missing deps

Add missing deps to runner image (sudo, git) and fix the labels option
for the runner

Signed-off-by: Itxaka <igarcia@suse.com>

* ghrunner: bump runner version

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: introduce skip_docker_build

In case we want to skip the docker builds

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: disable iso/tests for arm64

Currently experimental so we better dont spend cycles on that

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: Set different repos if arch is not amd64

We agreed that the current amd64 repo will kep its name as its the
"default" or what we expect most users to use and for the rest of arches
we would use the suffix $arch on them

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: Small fix to skip images in github-release

if the images are skipped we need also to not have them as need in the
release-github job

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: add release for arm64

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: Fix image link to use the arch in the file name

Also fixes a small issue with github-release which was downloading all
files without checking if they were requested

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: rename arm files to arm64

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: add master for arm64

Adds master workflow for arm64 which will build and push all flavors on
arm64 branches

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: Allow not installing luet from cos repo

Currently we use the cos repo to install or "upgrade" luet but for newly
arches we may not have pushed the required artifacts yet. This allows a
different path by just copying the downloaded luet into its proper dir

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: dont install luet from repo for arm64

At least we need this to pass 1 master run to have the proper artifacts
in place

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: clean luet binaries and paths on local runners

Otherwise the install script will fail and we want a clean start

Signed-off-by: Itxaka <igarcia@suse.com>

* fixup: I dont know how to write the mv command

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: Fix wrong repo for luet

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: separate arch values and change amd64 name

Separate the values files into archs so it build the correct packages
(golang)

Also change from amd64 to x86_64

Signed-off-by: Itxaka <igarcia@suse.com>

* templates: introduce do_checksum template

Useful to auto check if we want the checksum or not

Signed-off-by: Itxaka <igarcia@suse.com>

* build.go: Allow for skipping packages to build

The automatic checker tries to get all missing packages but does not
accep a skip packages var in order to be able to skip some packages.

This introduces a new var SKIP_PACKAGES in the same format as the
PACKAGES var for building that accepts a space separated list of
packages in the format category/name and will skip those packages from
the automated build (which is the only thing using the build.go stuff I
think)

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: skip fips related packages in arm64

There is no arm64 (or other arches than x86_64) golang-fips available

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: disable building live/grub* packages

currently failing as they depend on the proper arch

Signed-off-by: Itxaka <igarcia@suse.com>

* ci: drop more live-* packages from arm64 builds

Signed-off-by: Itxaka <igarcia@suse.com>

* arm64: fix grub2-efi-image package

Now it supports the arm64 path to generate a valid package

Signed-off-by: Itxaka <igarcia@suse.com>

* fix get_luet script

Signed-off-by: Itxaka <igarcia@suse.com>

* k9s: add binutils to prelude

Seems like on arm64 binutils is not installed

Signed-off-by: Itxaka <igarcia@suse.com>

* makefile: Fix cache for luet based off the current arch

Signed-off-by: Itxaka <igarcia@suse.com>

* k9s: add binutils-gold package install

Looks like compiling k9s in arm64 requires the gold linker

Signed-off-by: Itxaka <igarcia@suse.com>

* values: drop i386 package from arm64 build

Signed-off-by: Itxaka <igarcia@suse.com>
2021-09-09 16:25:19 +02:00
Ettore Di Giacinto 15d05fd730
Change flavor names after codenames (#442)
* Change flavor names after codenames

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* release: rename deployer iso to 'Seed'
2021-07-23 17:59:07 +02:00
Ettore Di Giacinto b38f1b75cc
Consume luet-makeiso from our repository (#353)
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2021-06-30 10:49:04 +02:00
Ettore Di Giacinto a8541a05f4
Use our repository for the CI (#303)
* Consume toolchain from our repository. Add jq

Also add envrc helper to expose raw img disk creation.

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* Build nerdctl and k9s from source

Co-authored-by: Darren Shepherd <darren@rancher.com>
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

Co-authored-by: Darren Shepherd <darren@rancher.com>
2021-06-21 19:59:49 +02:00