From 557b65e0925ed9f707da60776603a460a77803e9 Mon Sep 17 00:00:00 2001 From: Erik Sjölund Date: Mon, 11 Jul 2022 21:59:32 +0200 Subject: [CI:DOCS] Improve language. Fix spelling and typos. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Correct spelling and typos. * Improve language. Co-authored-by: Ed Santiago Signed-off-by: Erik Sjölund --- contrib/remote/containers.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/remote/containers.conf b/contrib/remote/containers.conf index 9b0b62c42..70710be04 100644 --- a/contrib/remote/containers.conf +++ b/contrib/remote/containers.conf @@ -1,4 +1,4 @@ -# The containers configuration file specifies all of the available configuration +# The container's configuration file specifies all of the available configuration # command-line options/flags for container engine tools like Podman # but in a TOML format that can be easily modified and versioned. -- cgit v1.2.3-54-g00ecf From b2f3b28c6a4548e0982f2ead9cc4f3acc8f27f82 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Mon, 11 Jul 2022 12:54:16 -0600 Subject: logformatter: link by *task ID*, not build ID Reason: task IDs are unique and permanent; linking by build ID and task name is non-unique, because Re-run. Fixes: #14863 Signed-off-by: Ed Santiago --- contrib/cirrus/logformatter | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'contrib') diff --git a/contrib/cirrus/logformatter b/contrib/cirrus/logformatter index 59969c3e7..1dc618768 100755 --- a/contrib/cirrus/logformatter +++ b/contrib/cirrus/logformatter @@ -560,18 +560,14 @@ END_HTML # See #14569 for more info. # # [1] https://cirrus-ci.org/guide/writing-tasks/#latest-build-artifacts - if ($have_formatted_log && $ENV{CIRRUS_BUILD_ID} && $ENV{CIRRUS_TASK_NAME}) { - my $URL_BASE = "https://api.cirrus-ci.com"; - my $build_id = $ENV{CIRRUS_BUILD_ID}; - my $task_name = $ENV{CIRRUS_TASK_NAME}; - - # Escape spaces in task names ("int fedora 35 podman root etc") - $task_name =~ s/\s/%20/g; - - # URL is long and cumbersome and duplicaty. The task name cannot be - # reduced; the file name could, but I choose to leave it because I - # sometimes download HTML logs and oh how I hate "log.html" filenames. - my $URL = "${URL_BASE}/v1/artifact/build/$build_id/$task_name/html/${outfile}"; + if ($have_formatted_log && $ENV{CIRRUS_TASK_ID}) { + my $URL_BASE = "https://api.cirrus-ci.com"; + my $task_id = $ENV{CIRRUS_TASK_ID}; + + # Link by *taskID*, not buildID + taskname. First, this is shorter + # and less duplicaty. Second, and more important, buildID + taskname + # is non-unique, and a link to a flake log will be clobbered. + my $URL = "${URL_BASE}/v1/artifact/task/$task_id/html/${outfile}"; print "\n\nAnnotated results:\n $URL\n"; } -- cgit v1.2.3-54-g00ecf From ca4630ede6d50e3417502a7d31ef60576f371b8c Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Tue, 12 Jul 2022 08:28:21 -0600 Subject: CI: sanity check for desired runtime We're still not testing runc in CI (#14833), and it may be weeks or months before we can, due to criu/glibc nightmare, but one day we'll be back on track, then later on we'll update VMs again, and screw it up, and lose runc, and not notice, and RHEL will break, and oh noes headless chicken again, repeat repeat. We can do better. Use .cirrus.yml to explicitly define which VMs should use which runtimes, and enforce it early in the CI build step. This should never fail (uh huh) in a PR, only in one of the update-VM PRs. Signed-off-by: Ed Santiago --- .cirrus.yml | 4 ++++ contrib/cirrus/runner.sh | 10 ++++++++++ 2 files changed, 14 insertions(+) (limited to 'contrib') diff --git a/.cirrus.yml b/.cirrus.yml index 81bbe7c8f..14d3540c1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -167,14 +167,18 @@ build_task: VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME} CTR_FQIN: ${FEDORA_CONTAINER_FQIN} # ID for re-use of build output + CI_DESIRED_RUNTIME: crun - env: &priorfedora_envvars DISTRO_NV: ${PRIOR_FEDORA_NAME} VM_IMAGE_NAME: ${PRIOR_FEDORA_CACHE_IMAGE_NAME} CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN} + CI_DESIRED_RUNTIME: crun - env: &ubuntu_envvars DISTRO_NV: ${UBUNTU_NAME} VM_IMAGE_NAME: ${UBUNTU_CACHE_IMAGE_NAME} CTR_FQIN: ${UBUNTU_CONTAINER_FQIN} + # FIXME 2022-07-12: change to runc once #14833 is fixed! + CI_DESIRED_RUNTIME: crun env: TEST_FLAVOR: build clone_script: *full_clone diff --git a/contrib/cirrus/runner.sh b/contrib/cirrus/runner.sh index 762a3b501..32f66bac2 100755 --- a/contrib/cirrus/runner.sh +++ b/contrib/cirrus/runner.sh @@ -236,6 +236,16 @@ function _run_build() { make clean make vendor make podman-release # includes podman, podman-remote, and docs + + # Last-minute confirmation that we're testing the desired runtime. + # This Can't Possibly Fail™ in regular CI; only when updating VMs. + # $CI_DESIRED_RUNTIME must be defined in .cirrus.yml. + req_env_vars CI_DESIRED_RUNTIME + runtime=$(bin/podman info --format '{{.Host.OCIRuntime.Name}}') + # shellcheck disable=SC2154 + if [[ "$runtime" != "$CI_DESIRED_RUNTIME" ]]; then + die "Built podman is using '$runtime'; this CI environment requires $CI_DESIRED_RUNTIME" + fi } function _run_altbuild() { -- cgit v1.2.3-54-g00ecf From 03eaea8bbe4dc7791c2129d64321988d3ec12bb0 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 11 Jul 2022 10:20:53 -0400 Subject: Run codespell Signed-off-by: Daniel J Walsh --- Makefile | 2 +- contrib/cirrus/CIModes.md | 2 +- test/apiv2/12-imagesMore.at | 2 +- test/buildah-bud/apply-podman-deltas | 2 +- test/system/170-run-userns.bats | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'contrib') diff --git a/Makefile b/Makefile index eb1c4b581..ad8fcbb51 100644 --- a/Makefile +++ b/Makefile @@ -258,7 +258,7 @@ test/version/version: version/version.go .PHONY: codespell codespell: - codespell -S bin,vendor,.git,go.sum,.cirrus.yml,"RELEASE_NOTES.md,*.xz,*.gz,*.ps1,*.tar,swagger.yaml,*.tgz,bin2img,*ico,*.png,*.1,*.5,copyimg,*.orig,apidoc.go" -L uint,iff,od,seeked,splitted,marge,ERRO,hist,ether -w + codespell -S bin,vendor,.git,go.sum,.cirrus.yml,"RELEASE_NOTES.md,*.xz,*.gz,*.ps1,*.tar,swagger.yaml,*.tgz,bin2img,*ico,*.png,*.1,*.5,copyimg,*.orig,apidoc.go" -L pullrequest,uint,iff,od,seeked,splitted,marge,erro,hist,ether -w .PHONY: validate validate: lint .gitvalidation validate.completions man-page-check swagger-check tests-included tests-expect-exit diff --git a/contrib/cirrus/CIModes.md b/contrib/cirrus/CIModes.md index 8b1e33bb1..c782ca64b 100644 --- a/contrib/cirrus/CIModes.md +++ b/contrib/cirrus/CIModes.md @@ -27,7 +27,7 @@ outdated) example of it's output can be seen below: [The list is documented](https://cirrus-ci.org/guide/writing-tasks/#environment-variables). Reference to any variables defined in YAML will **not** behave how you expect, don't use them! -* Somme Cirrus-CI defined variables contain non-empty values outside their +* Some Cirrus-CI defined variables contain non-empty values outside their obvious context. For example, when running for a PR a task will have `$CIRRUS_BRANCH` set to `pull/`. diff --git a/test/apiv2/12-imagesMore.at b/test/apiv2/12-imagesMore.at index fc18dd2d7..d4b09174f 100644 --- a/test/apiv2/12-imagesMore.at +++ b/test/apiv2/12-imagesMore.at @@ -63,7 +63,7 @@ podman pull -q $IMAGE podman system connection add --default test ssh://$USER@localhost/run/user/$UID/podman/podman.sock # should fail but need to check the output... # status 125 here means that the save/load fails due to -# cirrus weirdness with exec.Command. All of the args have been parsed sucessfully. +# cirrus weirdness with exec.Command. All of the args have been parsed successfully. t POST "libpod/images/scp/$IMAGE?destination=QA::" 500 \ .cause="exit status 125" t DELETE libpod/images/$IMAGE 200 \ diff --git a/test/buildah-bud/apply-podman-deltas b/test/buildah-bud/apply-podman-deltas index 0b691dd0e..3b3c5592a 100755 --- a/test/buildah-bud/apply-podman-deltas +++ b/test/buildah-bud/apply-podman-deltas @@ -197,7 +197,7 @@ skip_if_remote "--build-context option not implemented in podman-remote" \ "build-with-additional-build-context and COPY, additional context from host" \ "build-with-additional-build-context and RUN --mount=from=, additional-context not image and also test conflict with stagename" \ -skip_if_remote "env-variable for Containerfile.in pre-processing is not propogated on remote" \ +skip_if_remote "env-variable for Containerfile.in pre-processing is not propagated on remote" \ "bud with Containerfile.in, via envariable" \ # Requires a local file outside context dir diff --git a/test/system/170-run-userns.bats b/test/system/170-run-userns.bats index 84788a7f4..2ad9eb0b8 100644 --- a/test/system/170-run-userns.bats +++ b/test/system/170-run-userns.bats @@ -124,7 +124,7 @@ EOF run_podman rm -t 0 --force ${cid} else run_podman 125 run -d --userns=nomap $IMAGE sleep 100 - is "${output}" "Error: nomap is only supported in rootless mode" "Container should fail to start since nomap is not suppored in rootful mode" + is "${output}" "Error: nomap is only supported in rootless mode" "Container should fail to start since nomap is not supported in rootful mode" fi } @@ -135,6 +135,6 @@ EOF is "${output}" "$user" "Container should run as the current user" else run_podman 125 run --rm --userns=keep-id $IMAGE id -u - is "${output}" "Error: keep-id is only supported in rootless mode" "Container should fail to start since keep-id is not suppored in rootful mode" + is "${output}" "Error: keep-id is only supported in rootless mode" "Container should fail to start since keep-id is not supported in rootful mode" fi } -- cgit v1.2.3-54-g00ecf From ff7259567663ee5d6cf9b3e8e62c5d4ac39c47d6 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Thu, 21 Jul 2022 13:47:25 -0400 Subject: [CI:DOCS] Cirrus: Add prominent gitlab warning It was not obvious enough in the scripts how much of a snowflake this environment is. Fix that with lots of capitalized words and asterisks. Signed-off-by: Chris Evich --- contrib/cirrus/runner.sh | 3 +++ contrib/cirrus/setup_environment.sh | 23 ++++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'contrib') diff --git a/contrib/cirrus/runner.sh b/contrib/cirrus/runner.sh index 32f66bac2..939cc33ce 100755 --- a/contrib/cirrus/runner.sh +++ b/contrib/cirrus/runner.sh @@ -334,6 +334,9 @@ function _run_release() { } +# ***WARNING*** ***WARNING*** ***WARNING*** ***WARNING*** +# Please see gitlab comment in setup_environment.sh +# ***WARNING*** ***WARNING*** ***WARNING*** ***WARNING*** function _run_gitlab() { rootless_uid=$(id -u) systemctl enable --now --user podman.socket diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh index 4952f8dd2..d5044816d 100755 --- a/contrib/cirrus/setup_environment.sh +++ b/contrib/cirrus/setup_environment.sh @@ -321,13 +321,30 @@ case "$TEST_FLAVOR" in install_test_configs ;; gitlab) - # This only runs on Ubuntu for now + # ***WARNING*** ***WARNING*** ***WARNING*** ***WARNING*** + # This sets up a special ubuntu environment exclusively for + # running the upstream gitlab-runner unit tests through + # podman as a drop-in replacement for the Docker daemon. + # Test and setup information can be found here: + # https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27270#note_499585550 + # + # Unless you know what you're doing, and/or are in contact + # with the upstream gitlab-runner developers/community, + # please don't make changes willy-nilly to this setup. + # It's designed to follow upstream gitlab-runner development + # and alert us if any podman change breaks their foundation. + # + # That said, if this task does break in strange ways or requires + # updates you're unsure of. Please consult with the upstream + # community through an issue near the one linked above. If + # an extended period of breakage is expected, please un-comment + # the related `allow_failures: $CI == $CI` line in `.cirrus.yml`. + # ***WARNING*** ***WARNING*** ***WARNING*** ***WARNING*** + if [[ "$OS_RELEASE_ID" != "ubuntu" ]]; then die "This test only runs on Ubuntu due to sheer laziness" fi - # Ref: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27270#note_499585550 - remove_packaged_podman_files make install PREFIX=/usr ETCDIR=/etc -- cgit v1.2.3-54-g00ecf