4434 Commits

Author SHA1 Message Date
Mathieu Tortuyaux
5d74a34dd1 jenkins/sdk: add default DOWNLOAD_ROOT
Otherwise, the variable is empty and it creates errors later. Default
value is `gs://flatcar-jenkins`. Not `GS_DEVEL_ROOT` because if we check
the previous behavior, `DOWNLOAD_ROOT` was hardcoded with:
```shell
DOWNLOAD_ROOT_SDK=https://storage.googleapis.com/flatcar-jenkins/sdk
```

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2021-10-13 14:47:26 +02:00
Mathieu Tortuyaux
8feab1f52b jenkins/kola/container: fix verify-key sharing in systemd container
`$verify_key` actually holds `--verify-key=verify.asc` so of course
`systemd-nspawn` fails since it does not expect `--verify-key` value.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2021-10-13 14:47:26 +02:00
Jeremi Piotrowski
08f1270980 jenkins/toolchains: fetch DIGESTS file to allow reusing downloaded SDK as seed
The catalyst build uses the same SDK version as seed as the current SDK, but
will only reuse the cached tarball if a DIGESTS file exists and is correct.
Prefetch this file to prevent the build from trying to access google storage
anonymously.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2021-10-13 14:47:26 +02:00
Mathieu Tortuyaux
5a1c7b4fbc jenkins/vm: remove --sdk-url
`download-image` already holds the remote host with the --root flag.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2021-10-13 14:47:26 +02:00
Jeremi Piotrowski
75ea008003 jenkins: use 'cork create' instead of 'cork update'
because we need to pass google credentials to update_chroot, and 'cork update'
doesn't support that.

Add --sdk-url-path to sdk.sh for new cork default.
2021-10-13 14:47:26 +02:00
Jeremi Piotrowski
dec4722b76 jenkins: use gs:// uri for DOWNLOAD_ROOT_SDK so that we can apply authentication 2021-10-13 14:47:26 +02:00
Mathieu Tortuyaux
450ef36f75 kola/dev-container: override binhost to use private GCS
in this commit we make sure to use GCS bucket for dev container tests by
providing the required credentials and the associated fetch command.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2021-10-13 14:47:26 +02:00
Mathieu Tortuyaux
c9bccac9a6 jenkins: add --json-key to cork update commands
it pulls https://github.com/flatcar-linux/mantle/pull/239 to be able to
use `--json-key` in order to access private GCS bucket

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2021-10-13 14:47:26 +02:00
Thilo Fromm
6018822518 set_version: safely iterate over argv
Co-authored-by: Kai Lüke <pothos@users.noreply.github.com>
2021-10-13 14:47:26 +02:00
Thilo Fromm
fc4731c6af build_image: add binhost option for dev container
Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-10-13 14:47:26 +02:00
Thilo Fromm
f508dec3a1 setup_board, update_chroot, dev container: use new bincache mirror
This updates the default settings in build scripts to use
https://mirror.release.flatcar-linux.net/
instead of the google storage bucket if no binhost or FLATCAR_DEV_BUILDS
is specified.

Defaults are updated for
* update_chroot (runs at SDK initialisation time)
* setup_board (creates /boards/[ARCH]/) chroots
* the development container
* set_version
2021-10-13 14:47:26 +02:00
Thilo Fromm
bf3005e872 build_library/release_util.sh: improve ssh opts for rsync
Co-authored-by: Kai Lüke <pothos@users.noreply.github.com>
2021-10-13 14:47:26 +02:00
Thilo Fromm
c176410f05 release_util.sh: script improvements
Co-authored-by: Krzesimir Nowak <knowak@microsoft.com>
2021-10-13 14:47:26 +02:00
Thilo Fromm
cbe348e481 release_util.sh: add rsync:// upload 2021-10-13 14:47:26 +02:00
Mathieu Tortuyaux
3861fda249 jenkins/manifest: use gsutil to download SDK version
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2021-10-13 14:47:26 +02:00
Kai Lueke
c65ace1225 Merge pull request #156 from flatcar-linux/scripts
jenkins/kola/packet.sh: fix check for skipping machine type tests
2021-09-30 11:55:10 +02:00
Kai Lueke
0b74f0144e jenkins/kola/packet.sh: fix check for skipping machine type tests
The cl.basic and cl.internet tests are different tests which wasn't
clear before. Also, the grep process returns an exit code of 1 if it
didn't find a match, causing the job to cancel. The list of tests is
space separated and should not be quoted but on the other hand, we
do have to handle a literal *.
Look for the right test and handle the grep exit code, and disable
globs for the subshell for preserving a literal *.
2021-09-30 11:55:10 +02:00
Kai Lueke
157706eb46 Merge pull request #153 from flatcar-linux/scripts
jenkins: run simple network test on different hardware
stable-2905.2.5
2021-09-29 13:56:58 +02:00
Kai Lueke
c6aa80f14b jenkins: run simple network test on different hardware
The Linux 5.10 stable kernel introduced a regression that we didn't
catch because we only run kola on one hardware type in Equinix Metal.
Validate that a simple network test works on various instance types of
the current hardware generation.
2021-09-29 13:56:58 +02:00
Jeremi Piotrowski
fce1c57533 Merge pull request #150 from kinvolk/flatcar-scripts
jenkins: add script to run kola arm64 tests under docker
stable-2905.2.4
2021-09-08 10:53:15 +02:00
Jeremi Piotrowski
acab1a4e2b jenkins: add script to run kola arm64 tests under docker
Included is a dockerfile that installs system deps of kola in an debian:11
image. For the test script, the control flow is:

qemu_uefi.sh
  qemu_uefi_arm64.sh
    (docker)
      qemu_common.sh

qemu_common uses the 'NATIVE_ARM64' variable passed by the jenkins job to control the behavior.
The differences are:

* use git directly to fetch (and verify) the manifest
* setup some symlinks so that /var/tmp is on the same BTRFS partition as $PWD/tmp
* setup symlinks so that we don't have to fixup installation of mantle to chroot
* run things directly instead of in chroot through cork

The whole script is executed as root, because kola requires root privileges
anyway and making kvm and sudo work with an arbitrary host user inside the
container would require a custom entrypoint to setup groups.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2021-09-08 10:53:15 +02:00
Kai Lüke
1e5062e7ed Merge pull request #135 from kinvolk/flatcar-scripts
jenkins/kola/qemu(_uefi): run update test from previous release
stable-2905.2.3 stable-2905.2.2 stable-2905.2.1
2021-07-27 12:53:00 +02:00
Kai Lüke
617951b782 jenkins/kola/qemu(_uefi): run update test from previous release
The newly enabled update test performs an update from the built image
to itself. This is useful to test that the update mechanism didn't
break but it doesn't say if the built image will be accepted as update
from the previous official release.

Introduce an additional kola run that begins from the previous official
release and tests to update to the built image. Since the test does two
updates it also covers the case of updating from the built image to the
built image. Thus, we can skip the test in the normal run.
This new kola run is done first to keep the qemu-latest symlink valid
for the main test suite.
2021-07-27 12:53:00 +02:00
Kai Lüke
fce3d8090d jenkins/kola: share a single qemu script file 2021-07-27 12:53:00 +02:00
Kai Lüke
6b5b0d0493 Merge pull request #130 from kinvolk/flatcar-scripts
Generate test update payload and run the kola update test
stable-2905.2.0
2021-07-14 20:51:26 +02:00
Kai Lüke
1abca123db Generate test update payload and run the kola update test
The kola update tests need a dev-key-signed update payload. This was
lacking and caused the update tests to be skipped.
Generate the test update payload for both dev builds and release builds
and run the kola tests for both. The test update payload has a special
name to not confuse it with the real update payload for releases, and
we keep the previous behavior to sign releases. Therefore, the
generate_update function wasn't used but the extract_update function
extended with generating the additional test payload.
2021-07-14 20:51:26 +02:00
Kai Lüke
28fc861261 Merge pull request #128 from kinvolk/flatcar-scripts
jenkins/systemd-run-wrap.sh: randomize unit name suffix
2021-07-14 13:45:59 +02:00
Kai Lüke
fcda469ff2 jenkins/systemd-run-wrap.sh: randomize unit name suffix
The timestamp alone was not enough to prevent unit name clashes.
Add a random suffix to greater reduce the chance of hitting a clash.
2021-07-14 13:45:59 +02:00
Kai Lüke
4a5932be8a Merge pull request #127 from kinvolk/flatcar-scripts
jenkins: move all inline bash scripts to flatcar-scripts
2021-07-05 20:07:08 +02:00
Kai Lüke
5a790a07e2 jenkins: move all inline bash scripts to flatcar-scripts
The logic of the inline bash scripts of each job was sometimes
separated into the flatcar-scripts/jenkins/*.sh helpers but mostly
part of the Groovy file. This coupling had its advantages but also
downsides when special cases needed to be added for different release
versions. Other issues were that the inline scripts needed the
backslash character to be escaped twice and Jenkins was not good in
terminating the child processes when stopping a job. Having inline
bash scripts in Groovy also mandated the use of Jenkins to build and
release Flatcar Container Linux which hinders test builds in other CI
platforms.
Move the inline bash scripts fully to to the files in
flatcar-scripts/jenkins/ and create new ones for job that didn't have
a script there yet. Also invoke them through a systemd-run wrapper
script which ensures that all child processes are terminated and also
sets up /opt/bin as additional path for the static lbzcat binary.
A workaround for bash 4 was needed to use a temporary file instead of
the <(cmd) bash feature which caused a strange syntax error, otherwise
the bash commands are moved as they are.
2021-07-05 20:07:08 +02:00
Krzesimir Nowak
3cf5d83056
Merge pull request #121 from kinvolk/krnowak/jobs-be-gone
Drop `--jobs` parameter
beta-2905.1.0 alpha-2905.0.0 alpha-2879.0.1 alpha-2879.0.0
2021-05-05 19:25:20 +02:00
Thilo Fromm
95ae4c90b7
Merge pull request #124 from kinvolk/t-lo/fix-sdk-bootstrap-part-2
bootstrap_sdk: use local SDK ebuilds for stage1 (part 2)
alpha-2857.0.0
2021-04-23 16:24:21 +02:00
Thilo Fromm
11e862e2d5 jenkins/sdk.sh: add stage1 portage and overlay refs
Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-04-23 16:23:10 +02:00
Thilo Fromm
8877d7adcd bootstrap_sdk: use local SDK ebuilds for stage1
This change uses portage-stable and coreos-overlay from the local SDK
chroot (from /var/lib/gentoo/repos) in the stage 1 SDK bootstrap build.
This is part 2 of the SDK bootstrap stage 1 fix (part 1 is covered in
64d8a73ac09853a4b9b813b53299d37569c35071), which ensures stage 1 does
not introduce any changes in its ebuilds over the seed SDK.

The change also introduces an option to consciously divert from the
above enforcement by use of command line parameters:

--stage1_overlay_ref <gitref> will check out coreos-overlay and use
                                <gitref> for stage 1 instead of the
                                local SDK's
                                /var/lib/gentoo/repos/coreos-overlay

--stage1_portage_ref <gitref> will check out portage-stable and use
                                <gitref> for stage 1 instead of the
                                local SDK's
                                /var/lib/gentoo/repos/gentoo

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-04-23 16:23:03 +02:00
Thilo Fromm
64d8a73ac0
Merge pull request #123 from kinvolk/t-lo/fix-sdk-bootstrap
Fix SDK bootstrap in bootstrap_sdk: no package updates in stage 1
beta-2823.1.3 beta-2823.1.2 beta-2823.1.1 beta-2823.1.0 alpha-2823.0.0
2021-03-15 15:06:13 +01:00
Thilo Fromm
659d4bf484
bootstrap_sdk: fix typo in top-level stage1 description
Co-authored-by: Sayan Chowdhury <sayan@kinvolk.io>
2021-03-05 12:11:18 +01:00
Thilo Fromm
ac31f8ac9a
bootstrap_sdk: fix typo in bootstrap process description
Co-authored-by: Marga Manterola <62987181+marga-kinvolk@users.noreply.github.com>
2021-03-04 19:03:00 +01:00
Thilo Fromm
12d59f88e0 build_library/catalyst_sdk.sh: save snapshot of coreos-overlay
This change to stage 4 of the SDK bootstrap process will keep a
snapshot of coreos-overlay in the SDK tarball. This snapshot can be
used in future SDK bootstraps' stage1 to ensure a clean stage 1 output
without any package updates.

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-03-04 18:59:13 +01:00
Thilo Fromm
319e3e702f bootstrap_sdk stage1: more comments, restructured for clarity
Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-03-04 18:07:54 +01:00
Thilo Fromm
9fd60f9ea2
Spelling fixes in comments
Co-authored-by: Krzesimir Nowak <krzesimir@kinvolk.io>
2021-03-04 11:33:30 +01:00
Thilo Fromm
84d7bf63b1 bootstrap_sdk: no package updates in stage 1
This change updates the stage1 SDK bootstrap build to use local
("known good") package ebuilds only, preventing updated package ebuilds
to apply in stage 1. This fixes SDK build breakage we observed when
upgrading core libraries like readline.

The change also removes the seed update from stage 1 as it should not
be needed anymore now that we postpone any package updates to stage 2.

The following package ebuild repos are used for stage 1:
- for portage-stable, we simply copy /var/gentoo/repos/gentoo
   from the SDK root.
- coreos-overlay is more complicated since ebuilds are missing from
   the SDK. So we grok the version the SDK was built with from
     /mnt/host/source/.repo/manifests/default.xml
   and then we create a local stage 1 clone of
     https://github.com/kinvolk/coreos-overlay.git
   in which we then check out the revision noted in the default mnifest.

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-03-03 17:32:38 +01:00
Kai Lüke
dd4a8e0335
Merge pull request #122 from kinvolk/kai/vm-matrix-reuse
jenkins/vm: expect a FORMATS parameter which has a list of formats
beta-2801.1.0 alpha-2801.0.1 alpha-2801.0.0
2021-02-19 15:14:24 +01:00
Kai Lüke
8aab1d6d5a jenkins/vm: expect a FORMATS parameter which has a list of formats
One Jenkins jobs for each image format caused a large overhead.
Allow to build multiple image formats in one job.
2021-02-18 13:42:15 +01:00
Krzesimir Nowak
a6a6e0be2c common: Make sure that NUM_JOBS is a positive integer 2021-02-18 08:25:21 +01:00
Krzesimir Nowak
6ed7cd66d5 *: Drop jobs parameter
The `--jobs` parameter that some scripts defined was not used anywhere
in jenkins or mantle. So the value of the parameter always ended up
being equal to `${NUM_JOBS}` set by `common.sh`. Also, even if the
`--jobs` parameter was used for some script, that script usually
didn't forward the jobs value to other scripts, so the other scripts
ended up using `${NUM_JOBS}` again. Also, the `${FLAGS_jobs}` variable
was used by some functions in the build library, and those functions
were sometimes invoked by scripts that didn't define the
`${FLAGS_jobs}` variable. It is tedious to track which script should
actually define the parameter, and where it should be forwarded.

Just get rid of this half-working pretense. If you want to affect how
many jobs `emerge` uses, export the `NUM_JOBS` environment variable
before calling any script.

For `EMERGE_FLAGS` and `REBUILD_FLAGS` we unconditionally specify the
`--jobs` flag's value to `${NUM_JOBS}` because they are passed to
`emerge`. On the other hand we drop the `--jobs` parameter from the
`UPDATE_ARGS` variable, because this variable passed to `setup_board`
or `update_chroot`, which don't have this flag any more.
2021-02-17 13:26:36 +01:00
Sayan Chowdhury
fcb58c6474
Merge pull request #120 from kinvolk/sayan/specify-num-jobs
image_to_vm.sh: Explicity mention the jobs param in image_to_vm step
2021-02-17 13:05:38 +05:30
Sayan Chowdhury
ee34c9d2e3
image_to_vm.sh: Explicity mention the jobs param in image_to_vm step
Now, in the oem aci creation step we make use of the jobs param.
Without this flag, an empty string is passed to to emerge which results
in failure.

Signed-off-by: Sayan Chowdhury <sayan.chowdhury2012@gmail.com>
2021-02-17 12:04:47 +05:30
Krzesimir Nowak
b1e730d0ed
Merge pull request #119 from kinvolk/krnowak/jobs-fix
Fix missing jobs parameter
2021-02-16 10:24:09 +01:00
Krzesimir Nowak
9cbf3049ea vm_image-util: Forward jobs parameter to build_oem_aci 2021-02-16 08:36:57 +01:00
Krzesimir Nowak
1084f961fd build_*_aci: Add missing jobs parameter
They end up using emerge_to_image which needs uses the `$FLAGS_jobs`
parameter. Seems like new portage does not like getting the parameter
like `--jobs=` (with an empty value).
2021-02-16 08:31:11 +01:00