4498 Commits

Author SHA1 Message Date
Thilo Fromm
e36c0b969b
Merge pull request #185 from flatcar-linux/t-lo/sdk-container-for-2983
sdk-container: add scripts for containerised SDK (2983 backport)
2021-12-08 14:00:19 +01:00
Thilo Fromm
800296d527 sdk-container: add scripts for containerised SDK
Back-port for flatcar-2983 branch.

This change introduces a containerised SDK as a replacement for cork SDK
operations. It also simplifies versioning by removing the need for
manifest repos as well as usage of the "repo" tool by use of git
submodules for coreos-overlay and portage-stable.

The following feature scripts are added:
- run_sdk_container: Run a command in an SDK container, using the
        current scripts repo + ebuild submodules.
        current scripts repo + ebuild submodules.
- bootstrap_sdk_container / build_sdk_container_image: Bootstrap a new
        SDK and create an SDK container from the resulting SDK tarball.

The following additions have been made to SDK scripts:
- setup_board: add --pkgdir parameter to use a custom binary packge
  directory.
2021-12-07 19:07:56 +01:00
Kai Lueke
05119d9f38 Merge pull request #176 from flatcar-linux/scripts
jenkins/kola/packet: Remove c3.small.x86 to try running cl.internet
stable-2983.2.1 stable-2983.2.0 beta-2983.1.2
2021-10-22 18:25:58 +02:00
Sayan Chowdhury
e8c9c0784e jenkins/kola/packet: Remove c3.small.x86 to try running cl.internet
Signed-off-by: Sayan Chowdhury <schowdhury@microsoft.com>
2021-10-22 18:25:58 +02:00
Kai Lueke
079de8ef9a Merge pull request #175 from flatcar-linux/scripts
jenkins/kola/aws.sh: use larger arm64 instance type for kubeadm
2021-10-21 14:13:00 +02:00
Kai Lueke
8608d00e7c jenkins/kola/aws.sh: use larger arm64 instance type for kubeadm
Currently the kubeadm tests fail on arm64 because the instance type
only offers 1 vCPU:
cluster.go:117: error execution phase preflight: [preflight] Some fatal errors occurred:
cluster.go:117: [ERROR NumCPU]: the number of available CPUs 1 is less than the required 2

Switch to the next larger instance type which has 2 vCPUS.
2021-10-21 14:13:00 +02:00
Sayan Chowdhury
deed4c1ea8
Merge pull request #174 from flatcar-linux/scripts
packet: Update the base URL to point to bucket.release.f-ln
2021-10-21 17:29:02 +05:30
Sayan Chowdhury
efb64ec235
packet: Update the base URL to point to bucket.release.f-ln
Signed-off-by: Sayan Chowdhury <schowdhury@microsoft.com>
2021-10-21 17:29:02 +05:30
Sayan Chowdhury
baabdc5c9e
Merge pull request #173 from flatcar-linux/scripts
do: Update the base URL to point to bucket.release.f-ln
2021-10-21 12:21:32 +05:30
Sayan Chowdhury
97b13339e1
do: Update the base URL to point to bucket.release.f-ln
Signed-off-by: Sayan Chowdhury <schowdhury@microsoft.com>
2021-10-21 12:21:32 +05:30
Kai Lueke
df3a606292 Merge pull request #170 from flatcar-linux/scripts
jenkins: use the SDK_URL_PATH path for DOWNLOAD_ROOT_SDK
2021-10-15 16:10:14 +02:00
Kai Lueke
32f26c25d5 jenkins: use the SDK_URL_PATH path for DOWNLOAD_ROOT_SDK
The SDK can either be a release SDK or a dev build SDK which are stored
in different paths. DOWNLOAD_ROOT_SDK should be based on the
SDK_URL_PATH value which indicates whether it's a release or dev build
path.
2021-10-15 16:10:14 +02:00
Kai Lueke
ad96b5a525 Merge pull request #169 from flatcar-linux/scripts
jenkins/sdk: download SDK Digest to prevent twice downloading
2021-10-15 15:39:06 +02:00
Mathieu Tortuyaux
c0c1e387e1 jenkins/sdk: download SDK Digest to prevent twice downloading
bootstrap_sdk runs catalyst.sh which will try to download the SDK if the
verify digest fails.
Importing the DIGEST allows to skip this step and to continue with the
previously downloaded SDK.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2021-10-15 15:39:06 +02:00
Mathieu Tortuyaux
7cd91d9f19
jenkins/toolchain: do not use the mantle embedded key to verify
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2021-10-13 18:43:58 +02:00
Mathieu Tortuyaux
473b1985ce jenkins/kola/container: pass PORTAGE_BINHOST to container
Otherwise, it was failing since we check for unbound variable:
```
/bin/bash: line 1: PORTAGE_BINHOST: unbound variable
```

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2021-10-13 15:30:08 +02:00
Mathieu Tortuyaux
0ebc2be0d1 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 15:30:08 +02:00
Mathieu Tortuyaux
3bc1d9da96 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 15:30:08 +02:00
Jeremi Piotrowski
79e7c0eda2 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 15:30:08 +02:00
Mathieu Tortuyaux
36a572e4ff 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 15:30:08 +02:00
Jeremi Piotrowski
0b535b3722 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 15:30:08 +02:00
Jeremi Piotrowski
cee026476d jenkins: use gs:// uri for DOWNLOAD_ROOT_SDK so that we can apply authentication 2021-10-13 15:30:08 +02:00
Mathieu Tortuyaux
44e3651579 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 15:30:08 +02:00
Mathieu Tortuyaux
c372d74195 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 15:30:07 +02:00
Thilo Fromm
ed91875c70 set_version: safely iterate over argv
Co-authored-by: Kai Lüke <pothos@users.noreply.github.com>
2021-10-13 15:30:07 +02:00
Thilo Fromm
fc39736676 build_image: add binhost option for dev container
Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-10-13 15:30:07 +02:00
Thilo Fromm
4c5f44608d 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 15:30:07 +02:00
Thilo Fromm
1e4c772017 build_library/release_util.sh: improve ssh opts for rsync
Co-authored-by: Kai Lüke <pothos@users.noreply.github.com>
2021-10-13 15:30:07 +02:00
Thilo Fromm
97d1b3a8be release_util.sh: script improvements
Co-authored-by: Krzesimir Nowak <knowak@microsoft.com>
2021-10-13 15:30:07 +02:00
Thilo Fromm
e6bac59c3f release_util.sh: add rsync:// upload 2021-10-13 15:30:07 +02:00
Mathieu Tortuyaux
42392eeb97 jenkins/manifest: use gsutil to download SDK version
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2021-10-13 15:30:07 +02:00
Kai Lueke
7461ea22da Merge pull request #156 from flatcar-linux/scripts
jenkins/kola/packet.sh: fix check for skipping machine type tests
2021-09-30 11:55:30 +02:00
Kai Lueke
a7b4c0bbea 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:30 +02:00
Kai Lueke
6362f6b6fe Merge pull request #153 from flatcar-linux/scripts
jenkins: run simple network test on different hardware
beta-2983.1.1
2021-09-29 13:57:10 +02:00
Kai Lueke
cb2fd5ff86 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:57:10 +02:00
Jeremi Piotrowski
4f510db04d Merge pull request #150 from kinvolk/flatcar-scripts
jenkins: add script to run kola arm64 tests under docker
beta-2983.1.0
2021-09-08 10:52:56 +02:00
Jeremi Piotrowski
07a12867e4 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:52:56 +02:00
Krzesimir Nowak
4ca7027365
Merge pull request #145 from kinvolk/krnowak/drop-unused-stuff
Remove unused scripts
alpha-2983.0.0
2021-08-30 17:53:05 +02:00
Thilo Fromm
1570708e40
Merge pull request #148 from kinvolk/t-lo/disk-util-use-bytearray
build_library/disk_util: use byte array for conversion, not chr()
2021-08-30 09:16:16 +02:00
Thilo Fromm
e4c22ef6c7 build_library/disk_util: use byte array for conversion
disk_util sometimes bails out during build with an ASCII conversion
error:

Traceback (most recent call last):
  File "/mnt/host/source/src/scripts/build_library/disk_util", line 1114, in <module>
    main(sys.argv)
  File "/mnt/host/source/src/scripts/build_library/disk_util", line 1110, in main
    options.func(options)
  File "/mnt/host/source/src/scripts/build_library/disk_util", line 779, in Verity
    Tune2fsReadWrite(options, part, disable_rw=True)
  File "/mnt/host/source/src/scripts/build_library/disk_util", line 716, in Tune2fsReadWrite
    image.write(chr(flag_value))
UnicodeEncodeError: 'ascii' codec can't encode character '\xff' in position 0: ordinal not in range(128)

Curiously, the error does not reproduce every time (though the code
leading to the error is straightforward).

This change converts the integer to be written to a byte array (of size
1) instead of using chr(). Also, the file to be written is explicitly
opened in binary mode.

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-08-27 17:25:34 +02:00
Krzesimir Nowak
ef0dfe5c5c Move cros_vm_constants to build_library
This file used to be imported by scripts coreos-base/cros-devutils,
which we have dropped. Now it is imported only from some other script
in build library so move it there. This leaves lib as a directory
where we keep shflags library.
2021-08-27 14:20:54 +02:00
Krzesimir Nowak
421de42db5 Drop unused scripts
The scripts were imported by some scripts from
coreos-base/cros-devutils, which we have dropped already. So the
scripts in the lib directory are currently an unused baggage.
2021-08-27 14:20:54 +02:00
Krzesimir Nowak
d67a8f04dc
Merge pull request #143 from kinvolk/krnowak/use-internal-cros-workon
*: Use the internal copy of cros_workon
2021-08-27 14:18:59 +02:00
Jeremi Piotrowski
5138697cc9
Merge pull request #146 from kinvolk/jepio/azure-gen2-jenkins
add support for running tests on Azure Gen2 VMs
2021-08-27 11:42:09 +02:00
Jeremi Piotrowski
a2b3950ac2 jenkins: add support for running tests on Azure Gen2 VMs
This requires passing the --azure-hyper-v-generation=V2 argument to kola. The
vhd/image is the same as for azure gen1 vms, the azure_gen2 specifier is only
for jenkins usage.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2021-08-26 19:14:10 +02:00
Krzesimir Nowak
344afd98f2
Merge pull request #142 from kinvolk/krnowak/python3-porting
Port some stuff to python3
2021-08-24 16:10:08 +02:00
Krzesimir Nowak
f143645215 generate_au_zip: Remove useless line 2021-08-24 16:08:15 +02:00
Krzesimir Nowak
cea18c41c3 *: Use the internal copy of cros_workon
The scripts that invoked `cros_workon` without specifying a path to
the script were not calling the internal `cros_workon` directly, but
rather a copy installed in `/usr/bin/cros_workon`.
`/usr/bin/cros_workon` comes from the `coreos-base/cros-devutil` and
is a wrapper script that sources `common.sh` file to figure the
location of the `scripts` and finally invokes the internal
`cros_workon`. Curious thing is that the sourced `common.sh` comes
from the `/usr/lib/crosutils` directory and contents of the directory
come from the `dev-util/crosutils` package. And that `common.sh` is
different from the one in the scripts directory, but fortunately the
part that detects the path to the `scripts` directory is the same. I'm
not sure where where exactly the copy of `common.sh` in
`/usr/lib/crosutils` comes from - likely from somewhere in
`https://chromium.googlesource.com/chromiumos/platform/crosutils`.

Just cut the middle layers and call the internal copy of `cros_workon`
directly.
2021-08-19 12:58:42 +02:00
Krzesimir Nowak
3f9c073b4b build_library: Fix some typos 2021-08-18 19:03:11 +02:00
Krzesimir Nowak
a314348a38 build_library: Fix getting integer from string
`string.atoi` was deprecated since at least the first release of
python2, and looks like it was dropped in python3.
2021-08-18 19:01:51 +02:00