Commit Graph

4592 Commits

Author SHA1 Message Date
Mathieu Tortuyaux
dc4e4a8701
Merge pull request #158 from flatcar-linux/tormath1/cork-private
jenkins: add `--json-key` and `--sdk-url` to `cork update` commands
2021-10-07 14:42:35 +02:00
Mathieu Tortuyaux
998d2f4fc6
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-07 14:41:16 +02:00
Thilo Fromm
7f80cb138b
Merge pull request #159 from flatcar-linux/t-lo/use-new-bincache-mirror
setup_board, update_chroot, dev container: use new bincache mirror
2021-10-07 11:57:30 +02:00
Thilo Fromm
6882ea2d7c
Merge pull request #161 from flatcar-linux/t-lo/add-rsync-upload
release_util.sh: add rsync:// upload
2021-10-07 11:55:50 +02:00
Thilo Fromm
cc469d2f47
build_library/release_util.sh: improve ssh opts for rsync
Co-authored-by: Kai Lüke <pothos@users.noreply.github.com>
2021-10-07 11:17:33 +02:00
Thilo Fromm
0aad4b9dd1
release_util.sh: script improvements
Co-authored-by: Krzesimir Nowak <knowak@microsoft.com>
2021-10-07 10:48:26 +02:00
Thilo Fromm
9c3ba12936 release_util.sh: add rsync:// upload 2021-10-07 09:27:49 +02:00
Mathieu Tortuyaux
3b923e7abc
Merge pull request #160 from flatcar-linux/tormath1/fix-sdk-version
jenkins/manifest: use gsutil to download SDK version
2021-10-06 17:33:30 +02:00
Mathieu Tortuyaux
d9bf2e89c5
jenkins/manifest: use gsutil to download SDK version
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2021-10-06 17:27:23 +02:00
Thilo Fromm
17924f9d07
set_version: safely iterate over argv
Co-authored-by: Kai Lüke <pothos@users.noreply.github.com>
2021-10-06 11:44:15 +02:00
Thilo Fromm
eaff2d47eb build_image: add binhost option for dev container
Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-10-05 16:38:43 +02:00
Thilo Fromm
51aac23dc8 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-05 15:03:00 +02:00
Sayan Chowdhury
ccdc52cc15
Merge pull request #155 from flatcar-linux/krnowak/trap-fixes
Fix the traps to align with bash 5.1 upgrade
2021-10-01 21:49:27 +05:30
Kai Lüke
0de747c971
Merge pull request #156 from flatcar-linux/kai/jenkins-cl-internet
jenkins/kola/packet.sh: fix check for skipping machine type tests
2021-09-30 11:53:29 +02:00
Kai Lueke
e24c456889 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:50:30 +02:00
Kai Lüke
3bbd7221c7
Merge pull request #153 from flatcar-linux/kai/test-more-hw
jenkins: run simple network test on different hardware
2021-09-29 13:55:27 +02:00
Krzesimir Nowak
8215daa1c5
Merge pull request #154 from flatcar-linux/krnowak/ignore-more-categories
build_library: Ignore more categories in write_licenses
2021-09-29 09:20:19 +02:00
Kai Lueke
6a04b54f0b 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-28 18:10:24 +02:00
Krzesimir Nowak
ba29a29717 build_library: Ignore more categories in write_licenses
acct-user and acct-group categories aren't licensed too.
2021-09-28 17:55:17 +02:00
Krzesimir Nowak
caa74dfaf8 common: Do not warn on listing the nonexistent files
The subshell was printing the error backtrace, but apparently it was
of no consequences. Just assume that listing may fail, so we don't get
any confusing backtraces.
2021-09-28 16:35:21 +02:00
Krzesimir Nowak
d801ecccdf build_library/board_options: Fix pkg_version function
The documentation says it always returns zero, which is not true -
portageq could return a non-zero return value and that would be the
return value of the function. Fix the function to actually follow the
documentation - apparently the function should just return an empty
string in case of failure (like package not found).
2021-09-28 16:32:30 +02:00
Krzesimir Nowak
b797cdb723 build_torcx_store: Fix pipeline error handling 2021-09-27 20:18:22 +02:00
Krzesimir Nowak
69d0f05b44 build_torcx_store: Make a variable local 2021-09-27 20:18:22 +02:00
Krzesimir Nowak
eee6b50aa5 *: Do not use RETURN traps
It has some weird semantics that seem to trip us up after updating
bash to 5.1. We tried to use it inside functions to clean up some
stuff after function returns. This can be emulated with an EXIT trap
within a subshell. Fortunately all the users of the RETURN trap were
not setting any global variables - modifications of such variables are
local to the subshell and are lost when the subshell exits.
2021-09-27 20:18:22 +02:00
Jeremi Piotrowski
fbaa248898
Merge pull request #150 from kinvolk/jepio/arm64-native-qemu
jenkins: add script to run kola arm64 tests under docker
2021-09-07 10:39:49 +02:00
Dongsu Park
5f9fb5cd08
Merge pull request #151 from kinvolk/dongsu/glsa-update-20210903
build_library: update allow list for GLSA checks 2021-09-03
2021-09-06 16:04:04 +02:00
Dongsu Park
ec19fd5aa2 build_library: add entries to the GLSA allow list
Now that GLSA metadata was updated as of 2021-09-03, we need to
add the following entries to the GLSA allow list, to avoid build
failures caused by `glsa-check -t all`.

202006-03: perl 5.26.2, only SDK, allowlist
202008-01: python 2.7.15 & 3.6.5, only SDK, allowlist
202101-18: python 2.7.15 & 3.6.5, only SDK, allowlist
202104-04: python 2.7.15 & 3.6.5, only SDK, allowlist
202105-22: samba 4.12.9, not affected, samba has no ldap flag, no smbd.
202105-34: bash 4.3, non-trivial to update
202107-31: polkit 0.113, in-progress
202107-48: systemd 247.9, backported the fixes to v247.9.
2021-09-06 16:03:13 +02:00
Jeremi Piotrowski
c8dd87c095 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-06 14:08:11 +02:00
Dongsu Park
dfe49e7bcf build_library: remove unnecessary entries from GLSA allow list
201904-13: git 2.26.3, so not affected
201909-08: dbus 1.12.20, so not affected
201911-01: openssh 8.6, so not affected
202003-12: sudo 1.9.5, so not affected
202003-20: systemd 246+, so not affected
202003-24: file 5.39, so not affected
202003-30: git 2.26.3, so not affected
202003-31: gdb 9.2, so not affected
202003-52: samba 4.12.9, so not affected
202004-10: openssl 1.1.1l, so not affected
202004-13: git 2.26.3, so not affected
202005-02: qemu 5.2, so not affected
2021-09-03 17:43:49 +02:00
Kai Lüke
94261d5dd4
Merge pull request #149 from kinvolk/kai/accept-failed-update-test
jenkins/kola/qemu_common.sh: continue regular tests even if update test fails
2021-09-02 10:56:31 +02:00
Kai Lueke
0e8ea8b9d7 jenkins/kola/qemu_common.sh: continue regular tests even if update test fails
The update test runs first but if it fails, we still want to continue
with the regular test suite.
2021-09-02 10:38:02 +02:00
Krzesimir Nowak
4ca7027365
Merge pull request #145 from kinvolk/krnowak/drop-unused-stuff
Remove unused scripts
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
Krzesimir Nowak
ea0f478cfa build_library: Fix some string vs bytes issues
This is some fallout from converting scripts from python2 to
python3. Output received from the functions in subprocess module now
return bytearrays, but we operate on them as if they were a text. So
decode the bytearrays to strings. Otherwise we are either getting some
junk values passed to the command line utilities (for example:
`b'/dev/loop2'` instead of `/dev/loop2`), or exceptions are thrown,
because a function expected a string.
2021-08-18 18:58:16 +02:00
Krzesimir Nowak
b6c6a05404 build_library: Fix python script extension
It's not a shell script. It never was a shell script. Must have been a
mistake to name it as such.
2021-08-18 18:57:04 +02:00
Krzesimir Nowak
336a967941 build_library: Convert python2 scripts to python3
This is just a conversion done by 2to3 with a manual updates of
shebangs to mention python3 explicitly. The fixups for bytearray vs
string issues will follow up.
2021-08-18 18:56:48 +02:00
Krzesimir Nowak
df63498a91 common: Replace the use of python2 with python3
We want to move to python3 eventually so update the script snippet. We
can be sure that python3 is installed, because portage already
requires it.
2021-08-18 18:56:35 +02:00
Krzesimir Nowak
bd5c0c6a0e check_out_of_date.py: Drop unused script
The script is potentially useful, but it seems to be unused anyway. We
can bring it back later if there's a need. Note that this will need
updating it to python3 first. Which is why I'm dropping it currently -
it's one python2 script less to port.
2021-08-18 18:52:46 +02:00
Dongsu Park
a091274a76
Merge pull request #141 from kinvolk/dongsu/generate-au-multi-arch
build_library: support multi-arch in generate_au_zip
2021-08-16 16:16:00 +02:00