Commit Graph

195 Commits

Author SHA1 Message Date
Kai Lueke
095ab2392e ci-automation/vms: Export official release variable
The official release variable is used to decide whether a build ID gets
appended to the FLATCAR_VERSION (or VERSION in os-release) or not. It
was set for the image job but not for the vms job, causing the
build_sysext script to get the build ID appended to the FLATCAR_VERSION
which causes a mismatch with the one from the image job.
Set the official release variable in the vms job as well.
2023-07-17 17:27:59 +02:00
Krzesimir Nowak
ec723be9d9 *: Drop unused pkgdb stuff 2023-07-05 08:43:25 +02:00
Krzesimir Nowak
98a5dca8bf ci-automation: Download the sysext base image 2023-07-05 08:40:15 +02:00
Jeremi Piotrowski
862f253518 ci-automation: check for zstd in environment
This replaces pigz, so remove the related variables (PIGZ).

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2023-06-28 16:43:01 +02:00
Jeremi Piotrowski
c19f0edbff ci-automation: Use zstd to compress container images
We currently use gzip together with pigz (parallel gzip) for importing
container images, and this is a lengthy operation (takes multiple minutes). By
moving to zstd we gain on all fronts: zstd produces smaller files, and is
faster to decompress/compress then pigz while using less resources.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2023-06-28 16:17:10 +02:00
Jeremi Piotrowski
1fc599f33c ci-automation: Publish torcx_output_root to bincache
`build_image` depends on accesss to the torcx manifest and the "content
addressable nature" of the directory. We currently rely on the torcx output
root structure being preserved in the container image.

While we're moving the torcx output root out of the container image, preserve
its contents so that they can be restored from bincache.
2023-06-27 16:35:30 +02:00
Jeremi Piotrowski
6ebbe5f2b9 ci-automation: Align CONTAINER_*_ROOT with usual location
The SDK container bind mounts __build__/images to the containers image
directory, but the CI uses a different path for images. This causes issues when
building the oem sysext, because it requires mounting an overlayfs. The current
path (~/build/...) is an overlayfs and an ovlerayfs can't be an upper
directory.

Align the CONTAINER_IMAGE_ROOT and CONTAINER_TORCX_ROOT values with standard
practices to that oem sysext building in jenkins ci works.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2023-06-26 12:33:20 +02:00
Kai Lueke
4653708e82 ci-automation: Add NVIDIA instance type only for amd64
The instance type used for the NVIDIA test is amd64-only.
2023-06-20 12:29:54 +02:00
Sayan Chowdhury
11637c6a6d
Add setup to run the GPU tests on Azure
Signed-off-by: Sayan Chowdhury <schowdhury@microsoft.com>
2023-06-16 13:04:09 +05:30
Krzesimir Nowak
df6e2aa505 ci-automation: Download portage database from bincache for vms 2023-06-06 13:01:09 +02:00
Krzesimir Nowak
a0b195f876 ci-automation: Allow using --devcontainer-file option too
I seem to have problems with getting a network connectivity inside
QEMU vm when running the tests in the azure machine. I don't know
what's the cause, but for the dev container tests these problems can
be worked around by using the locally provided dev container
image. Make it possible by specifying QEMU_DEVCONTAINER_FILE in the
environment.
2023-05-30 15:59:37 +02:00
Thilo Fromm
4ffc9b254f garbage_collect_github_ci_sdk: add keep_tail, clean up keep var usage
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-05-22 12:21:07 +02:00
Thilo Fromm
83a85683c8
Apply suggestions from code review
Co-authored-by: Krzesimir Nowak <knowak@microsoft.com>
2023-05-22 12:14:04 +02:00
Thilo Fromm
9b3a67e72b ci-automation/garbage_collect: Add github CI SDK builds
This change adds a garbage collector script for SDK containers built via
Github actions CI automation
https://github.com/flatcar/scripts/blob/main/.github/workflows/update-sdk.yaml
These SDK container builds do not create a version tag in the scripts
repo. The garbage collector therefore retrieves versions from a
directory listing of
https://bincache.flatcar-linux.net/containers/ .

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-05-09 17:29:38 +02:00
Thilo Fromm
177f8854cc
Merge pull request #774 from flatcar/t-lo/test-markdown-fix-foldable-details
tapfile_helper: fix foldable details output
2023-05-03 18:06:46 +02:00
Thilo Fromm
d66ab2b2c3 tapfile_helper: fix foldable details output
This change adds a "<summary>" sub-block to the "<details>" block in
markdown test reports.

The test run details output, which is used to print debug and error
messages of test runs in case of test failures, was meant to be
fold-able, aiding readability of test reports. This is implemented using
the "<details>" feature. However, we forgot to mark a "<summary>" line
within the "<details>" block, leading to the blocks not being fold-able
but instead being visible all the time.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-05-03 10:57:02 +02:00
Krzesimir Nowak
66e72c79a0 ci-automation: Properly escape parameters passed to bash
Forwarding parameters to another bash invocation through a string
interpreted as a bash script is a bit troublesome. It is not enough to
wrap a parameter like 'foo bar' in escaped double quotes (\") to avoid
it being split into two parameters by bash executing the script
string. It mostly works, but there's always a risk of having a path
where this breaks. It's rare

Wrapping into escaped quotes, be them double or single, also won't
work for passing an array of parameters, so it's even easier here to
trigger globbing or bracket expansion or another unwanted splitting of
supposedly one parameter into multiple. Globbing can be temporarily
disabled with 'set -f' or 'set -o noglob', but this still leaves all
the other special bash characters unescaped. So each parameter in the
array should be escaped before they are put into the script string.

The escaping can be done with `printf` and its '%q` formatter, so
let's do so. For single parameters it is as simple as
`foo_escaped=$(printf '%q' "${foo}")`, for arrays a loop needs to be
used.
2023-04-27 12:55:00 +02:00
Krzesimir Nowak
0b83fbf127 sdk_bootstrap: Push a branch also for two-phase SDK nightly builds
The two-phase nightly builds create an intermediate tag first, which
didn't match the main nightly tag regexp before. Because of that, the
commit was not pushed to the main branch. The following final SDK
build had a version that matched the regexp, but the last commit (with
the intermediate tag on it) wasn't in main, and thus was also not
pushed.
2023-04-24 14:41:22 +02:00
Thilo Fromm
401af830d1 scripts, CI, workflows: remove submodule handling (main) 2023-04-13 12:26:36 +02:00
Thilo Fromm
f07cb5f781 tapfile_helper ff.: support TAP and Markdown output
This change adds markdown output support to tapfile helper.
tap_generate_report() has been refactored to use low-level output
functions to write tests; TAP and markdown output is supported and both
are generated by default. Also, it should be straightforward to add
other output formats by implementing the respective low level print
functions.

The markdown output is now used by run-kola-tests.yaml to generate step
output and, if run from a PR, add a comment with test results to the PR.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-03-29 21:05:47 +02:00
Thilo Fromm
27d540692f run-kola-tests.yaml: use new artifacts, local web server
This change updates the github actions kola test runner workflow to use
the new, separated artifacts produced by ci.yaml.

Further, it adds a fix for the devcontainer tests. Devcontainer and bin
packages used in the devcontainer tests are now served from a local
temporary web server.

The change also adds the qemu_update test and provides the respective
update payload.

Lastly, the tests now use a local torcx_manifest.json produced by
ci.yaml, which points to a torcx tarball also served by the local
temporary web server.
2023-03-28 10:02:17 +02:00
Kai Lueke
d53d415ef8 Run kola without --qemu-skip-mangle on Jenkins
For the GitHub CI we have to use --qemu-skip-mangle because the LXC
containers don't have access to loop devices. Running with
--qemu-skip-mangle means that the serial console does not get captured
completely because systemd and dracut messages are missing, and thus we
don't catch these errors in kola.
Make the skipping conditional and use it in Jenkins at least for the
nightlies and releases.
2023-03-24 22:17:13 +09:00
Kai Lueke
87e13eb3de ci-automation: Allow git to work on directory owned by other user
The get_git_channel function failed to work which resulted in the
Alpha release job skipping the AWS publishing for the Alpha channel
because it defaulted to the developer channel as fallback when git
rejected to work on the directory owned by the build user while running
as root user. A new version of git caused this behavior change and also
prints an error message that explains to have to set safe.directory.

Set the git config entry safe.directory for the /work path when
entering the mantle container where git runs as root while working on
the directory owned by the build user.
2023-02-14 11:39:33 +09:00
Krzesimir Nowak
50183b48b8 ci-automation: Get two files to build vms instead of a whole directory
Getting the contents of the directory in the buildcache involves using
rsync with some ssh invocation to log in as a bincache user. It's not
a thing that will work locally unless the user gets ahold of the SSH
key allowing the user to log in to buildcache as a bincache user.

Replace it by downloading two files that are actually needed for
building vms: an image file and the version file. This just uses curl
and is accessible for everyone.
2023-02-08 14:50:36 +01:00
Krzesimir Nowak
46a250bf33 ci-automation: Report file size changes
This uses the new size-change-report.sh script to print out some
information about largest files being added/removed and files with
greatest increase/decrease in file size between two versions of the
image.
2023-02-02 10:05:02 +01:00
Krzesimir Nowak
219326392c ci-automation: Try reporting the changes in initrd too
This relies on flatcar_production_image_initrd_contents.txt being
uploaded to the server. It also exports the WITHWTD environment
variable with a value 1, which will make the package-diff script to
try out the wtd contents file variant first.
2023-02-02 10:04:40 +01:00
Mathieu Tortuyaux
b8cafc1b9f
gc: pass OPENSTACK_CREDS to mantle container
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2023-01-03 09:24:16 +01:00
Kai Lueke
bc3a9aeacd qemu_update: Add update test from an old release
To ensure that we can update from very old releases, add a test with a
fixed old release, here the Stable release that introduced arm64
support to have the same test logic for both architectures.
2022-11-29 16:51:27 +01:00
Krzesimir Nowak
fbb962c7f6 ci-automation: Add an environment variable to skip build shortcuts
This will be used for the "run all tests" days in Jenkins.
2022-11-03 12:00:10 +01:00
Kai Lueke
3cb9736c33 ci-automation: Use plain AMI image for uploads
Recently we ran into sporadic corruption issues for AWS EC2 AMIs.
We use the streamOptimized VMDK format and it seems to cause problems
at the AWS side, regardless if created by qemu-img or vmdk-convert.
Switch to using the plain AMI images for uploading as workaround.
2022-10-28 17:21:39 +02:00
Kai Lueke
25dbccc14d ci-automation: Support local patches
For embargoed releases it is useful to apply patches locally to build
with them before they are public. This allows to push the same patches
to the repo during the Flatcar release at the embargo lift. The result
is the same (as long as the scripts patches did not change parts of the
setup logic that was running before they got applied), we can just build
earlier and thus do the Flatcar release directly on the embargo lift
instead of having to wait with the build because it would require the
patches to be in the repos.
2022-10-27 11:53:33 +02:00
Krzesimir Nowak
06d2aabaa2 ci-automation/vendor-testing/vmware.sh: Fix unbound variable use
This gets triggered when the test is rerun and an existing image is
reused.
2022-10-11 15:25:56 +02:00
Jeremi Piotrowski
de132c62d5
Merge pull request #521 from flatcar/jepio/gpg-import-batch
ci-automation: use --batch when importing gpg key
2022-10-06 09:52:07 +02:00
Kai Lueke
00223be1c7 ci-automation/release: Only upload SDK if a new one was built
A release includes an SDK if its SDK version is the release version.
Only then we need to upload a new SDK container image.
2022-10-04 14:24:28 +02:00
Jeremi Piotrowski
6e11ae3394 ci-automation: use --batch when importing gpg key
All invocations of gpg in ci-automation pass --batch as an argument except the
import. Be consistent by having it included everywhere. Additionally, since
ci-automation runs wrapped in a systemd service, no tty is available so batch
is needed for correctness.
2022-10-04 10:22:43 +02:00
Mathieu Tortuyaux
289cc52c5f
automation/gc: add openstack garbage collector
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2022-09-29 11:21:25 +02:00
Mathieu Tortuyaux
de8b4eae6a
ci-automation: add openstack to tested vendors
Missing link to enable the tests in the Flatcar test suite.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2022-09-29 11:21:25 +02:00
Kai Lueke
89495373d9 ci-automation: Ensure to use latest container image
The container image was only created if it didn't exist locally. This
would result in fixes not being in a downstream job that is scheduled
to a different worker node on Jenkins that has a stale copy.
For the build automation we will now always download the latest
container tar ball based on comparing the image ID from a new artifact,
and for registry images we pull the container image to make sure that
we don't use a stale copy when we rebuild.
2022-09-29 10:04:23 +02:00
Kai Lüke
dca21df916
Merge pull request #513 from flatcar/kai/container-fallback
ci-automation: Fallback also to the mirror for container download
2022-09-27 17:49:53 +02:00
Kai Lueke
20643b260e ci-automation: Fallback also to the mirror for container download
When there is no SDK container image in the registry, the fallback
looks at bincache but bincache isn't backed up and may be cleaned of
old releases. While this won't be the regular case, the container
image registry may be unavailable (or renamed as happened now), or
people would like to rerun the image job which relies on the packages
container.
2022-09-27 15:53:33 +02:00
Krzesimir Nowak
24213a5c96 ci-automation: Download correct previous image for LTS release
qemu_update vendor test was downloading a wrong LTS image when it was
testing the old LTS image. This is because it was using a current
symlink, which for LTS channel will always point to the new LTS. Old
LTS is available under current-${YEAR} symlink. We can get the
information about year from the lts-info file.
2022-09-27 11:56:39 +02:00
Krzesimir Nowak
2606380396 ci-automation: Fix unbound variable errors
FLATCAR_VERSION and FLATCAR_SDK_VERSION are defined in the version
file, so it should be sourced before trying to use those. Here we try
to do it in a limited scope.

Also, SDK container link should use the dockerized version in a
directory name.
2022-09-27 10:55:08 +02:00
Kai Lueke
326c645647 ci-automation: Fix syntax error 2022-09-26 17:24:53 +02:00
Kai Lueke
bca6e6e41d ci-automation: Don't skip nightly build when the previous one failed
Currently we skip the nightly build if there are no changes. This
didn't work well because a new run doesn't fix any failure because the
rerun became a no-op.
Check if the main artifacts we expect from a step are found, as simple
heuristic on whether a rerun is needed.
2022-09-26 17:06:21 +02:00
Kai Lueke
18627499c1 Annotate a copied function
I found a duplicate function and verified that it's the only one via
comm -12 <(sort ci-automation/ci_automation_common.sh) <(sort sdk_lib/sdk_container_common.sh) | grep function
I'm not sure if this is due to a case where we only import one but
can't import the other, hence I'm not deleting it now.
2022-09-26 15:39:45 +02:00
Kai Lueke
3fef1eb801 ci-automation/release: Set up secret envs 2022-09-22 18:31:50 +02:00
Kai Lueke
ffee812d32 ci-automation/release: Run plume release only once
We need to run plume only once for each arch, move it out of the loop.
Also, address some smaller things that shellcheck complains about.
2022-09-22 18:31:50 +02:00
Kai Lueke
79d89faf91 ci-automation/secret_to_file: Fix usage from subshell
This failed when used from ( secret_to_file ... VAR ; cat $VAR )
because ( ) starts a new subshell PID and secret_to_file's returned
/proc/PID/fd/X path was then using the wrong PID.
2022-09-22 18:31:50 +02:00
Kai Lueke
ef8f20f9dd ci-automation/release: Disable GCS auth for plume pre-release
When GCS auth is expected, plume would upload the AMI list to GCS.
2022-09-22 18:31:50 +02:00
Mathieu Tortuyaux
593cf19a7a release: get product IDs from Jenkins
the JSON object is passed from the Groovy script to the release script,
we just need to extract the correct AWS Marketplace product ID based on
the "<channel>-<arch>".

Exception for the stable-amd64 where we also need to get the stable-pro
product ID.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2022-09-22 18:31:50 +02:00