From adbcf5133bddb595d3e72044c78a8385e42f2906 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Fri, 8 May 2026 11:21:41 -0400 Subject: [PATCH 1/5] TMT: remove tags and filters, use individual plans Signed-off-by: Lokesh Mandvekar --- plans/main.fmf | 20 +++++++++++--------- test/tmt/main.fmf | 9 ++++++--- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/plans/main.fmf b/plans/main.fmf index 2b884e71..2c8de5fa 100644 --- a/plans/main.fmf +++ b/plans/main.fmf @@ -19,15 +19,17 @@ prepare: dnf -y upgrade --allowerasing order: 20 -/no-rpm: - summary: Run tests independent of rpm +/validate: + summary: Validate test discover+: - filter: tag:no-rpm - adjust+: - - enabled: false - when: initiator is not defined or initiator != packit + test: /validate -/rpm: - summary: Run tests on the rpm +/unit: + summary: Unit tests discover+: - filter: tag:rpm + test: /unit + +/integration: + summary: Integration tests + discover+: + test: /integration diff --git a/test/tmt/main.fmf b/test/tmt/main.fmf index 9210cc8e..84a669c6 100644 --- a/test/tmt/main.fmf +++ b/test/tmt/main.fmf @@ -1,20 +1,23 @@ /validate: - tag: [ no-rpm, validate ] summary: Validate test test: make -C ../.. validate require: - clippy - rustfmt + adjust: + enabled: false + when: initiator is not defined or initiator != packit /unit: - tag: [ no-rpm, unit ] summary: Unit tests test: make -C ../.. unit require: - cargo + adjust: + enabled: false + when: initiator is not defined or initiator != packit /integration: - tag: [ rpm, integration ] summary: Integration tests test: bash test_integration.sh environment: From 9de40d6c710f44954962f9fae3ea84317ee75079 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Fri, 8 May 2026 11:22:04 -0400 Subject: [PATCH 2/5] TMT: improve prepare steps Signed-off-by: Lokesh Mandvekar --- contrib/tmt/update-deps.sh | 8 ++++++++ plans/main.fmf | 13 +++---------- 2 files changed, 11 insertions(+), 10 deletions(-) create mode 100755 contrib/tmt/update-deps.sh diff --git a/contrib/tmt/update-deps.sh b/contrib/tmt/update-deps.sh new file mode 100755 index 00000000..fd3cfa87 --- /dev/null +++ b/contrib/tmt/update-deps.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Set podman-next COPR repository priority to 1 + +COPR_REPO_FILE="/etc/yum.repos.d/*podman-next*.repo" +if compgen -G $COPR_REPO_FILE > /dev/null; then + sed -i -n '/^priority=/!p;$apriority=1' $COPR_REPO_FILE +fi +dnf -y upgrade --allowerasing diff --git a/plans/main.fmf b/plans/main.fmf index 2c8de5fa..fe8e1e6e 100644 --- a/plans/main.fmf +++ b/plans/main.fmf @@ -4,19 +4,12 @@ execute: how: tmt prepare: - when: distro == centos-stream or distro == rhel - how: shell - script: | - dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(rpm --eval '%{?rhel}').noarch.rpm - dnf -y config-manager --set-enabled epel + how: feature + epel: enabled order: 10 - when: initiator == packit how: shell - script: | - COPR_REPO_FILE="/etc/yum.repos.d/*podman-next*.repo" - if compgen -G $COPR_REPO_FILE > /dev/null; then - sed -i -n '/^priority=/!p;$apriority=1' $COPR_REPO_FILE - fi - dnf -y upgrade --allowerasing + script: bash contrib/tmt/update-deps.sh order: 20 /validate: From 41dabb3b1a4662c806e0ec638d5a046779740707 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Fri, 8 May 2026 11:23:26 -0400 Subject: [PATCH 3/5] Packit: reorganize test jobs and remove notifications - Remove all COPR build failure notifications - Remove all test failure notifications from integration jobs - Add identifiers to integration jobs (integration-fedora, integration-centos) - Add tmt_plan to existing integration jobs (/plans/integration) - Add new validate test job (skip_build: true, fedora-latest-x86_64) - Add new unit test job (skip_build: true, fedora-latest-x86_64) Signed-off-by: Lokesh Mandvekar --- .packit.yaml | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index 76e827ce..40d6452f 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -51,9 +51,6 @@ jobs: - job: copr_build trigger: pull_request packages: [aardvark-dns-fedora] - notifications: &copr_build_failure_notification - failure_comment: - message: "Ephemeral COPR build failed. @containers/packit-build please check." targets: &fedora_copr_targets - fedora-all-x86_64 - fedora-all-aarch64 @@ -63,7 +60,6 @@ jobs: - job: copr_build trigger: pull_request packages: [aardvark-dns-eln] - notifications: *copr_build_failure_notification targets: fedora-eln-x86_64: additional_repos: @@ -76,7 +72,6 @@ jobs: - job: copr_build trigger: pull_request packages: [aardvark-dns-centos] - notifications: *copr_build_failure_notification targets: ¢os_copr_targets - centos-stream-9-x86_64 - centos-stream-9-aarch64 @@ -88,9 +83,6 @@ jobs: - job: copr_build trigger: commit packages: [aardvark-dns-fedora] - notifications: - failure_comment: - message: "podman-next COPR build failed. @containers/packit-build please check." branch: main owner: rhcontainerbot project: podman-next @@ -99,11 +91,10 @@ jobs: # Tests on Fedora - job: tests trigger: pull_request + identifier: integration-fedora packages: [aardvark-dns-fedora] - notifications: &test_failure_notification - failure_comment: - message: "Tests failed. @containers/packit-build please check." targets: *fedora_copr_targets + tmt_plan: "/plans/integration" tf_extra_params: environments: - artifacts: @@ -113,15 +104,34 @@ jobs: # Tests on CentOS Stream - job: tests trigger: pull_request + identifier: integration-centos packages: [aardvark-dns-centos] - notifications: *test_failure_notification targets: *centos_copr_targets + tmt_plan: "/plans/integration" tf_extra_params: environments: - artifacts: - type: repository-file id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/centos-stream-$releasever/rhcontainerbot-podman-next-centos-stream-$releasever.repo + # Validate test (no RPM build needed) + - job: tests + trigger: pull_request + identifier: validate + skip_build: true + targets: + - fedora-latest-x86_64 + tmt_plan: "/plans/validate" + + # Unit tests (no RPM build needed) + - job: tests + trigger: pull_request + identifier: unit + skip_build: true + targets: + - fedora-latest-x86_64 + tmt_plan: "/plans/unit" + # Sync to Fedora # NOTE: Breaking changes related to Podman6 will only be shipped to Fedora # Rawhide (to be Fedora 45) and newer. From f2e6e71062feae304d152c3c3b2eed0fb524764f Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Fri, 8 May 2026 11:24:35 -0400 Subject: [PATCH 4/5] Packit/TMT: add MSRV job Signed-off-by: Lokesh Mandvekar --- .packit.yaml | 9 +++++++++ plans/main.fmf | 5 +++++ test/tmt/main.fmf | 15 +++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/.packit.yaml b/.packit.yaml index 40d6452f..aee51bba 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -132,6 +132,15 @@ jobs: - fedora-latest-x86_64 tmt_plan: "/plans/unit" + # MSRV test (no RPM build needed) + - job: tests + trigger: pull_request + identifier: msrv + skip_build: true + targets: + - fedora-latest-x86_64 + tmt_plan: "/plans/msrv" + # Sync to Fedora # NOTE: Breaking changes related to Podman6 will only be shipped to Fedora # Rawhide (to be Fedora 45) and newer. diff --git a/plans/main.fmf b/plans/main.fmf index fe8e1e6e..b21b11da 100644 --- a/plans/main.fmf +++ b/plans/main.fmf @@ -26,3 +26,8 @@ prepare: summary: Integration tests discover+: test: /integration + +/msrv: + summary: MSRV test + discover+: + test: /msrv diff --git a/test/tmt/main.fmf b/test/tmt/main.fmf index 84a669c6..846b3400 100644 --- a/test/tmt/main.fmf +++ b/test/tmt/main.fmf @@ -27,3 +27,18 @@ adjust: duration: 10m when: arch == aarch64 + +/msrv: + summary: Minimum Supported Rust Version (MSRV) check + test: | + MSRV=$(grep '^rust-version' ../../Cargo.toml | cut -d'"' -f2) + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain "$MSRV" + source $HOME/.cargo/env + make -C ../.. build + require: + - curl + - gcc + - openssl-devel + adjust: + enabled: false + when: initiator is not defined or initiator != packit From d13167e027d30c236d63bb7c6d85f4b46a110916 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Fri, 8 May 2026 11:25:05 -0400 Subject: [PATCH 5/5] Remove Cirrus CI configuration Fixes: RUN-4616 Signed-off-by: Lokesh Mandvekar --- .cirrus.yml | 266 ------------------------ .github/workflows/check_cirrus_cron.yml | 25 --- Cargo.toml | 2 +- contrib/cirrus/lib.sh | 63 ------ contrib/cirrus/netavark_cache_groom.sh | 23 -- contrib/cirrus/runner.sh | 90 -------- contrib/cirrus/setup.sh | 45 ---- hack/get_ci_vm.sh | 78 ------- 8 files changed, 1 insertion(+), 591 deletions(-) delete mode 100644 .cirrus.yml delete mode 100644 .github/workflows/check_cirrus_cron.yml delete mode 100644 contrib/cirrus/lib.sh delete mode 100644 contrib/cirrus/netavark_cache_groom.sh delete mode 100755 contrib/cirrus/runner.sh delete mode 100755 contrib/cirrus/setup.sh delete mode 100755 hack/get_ci_vm.sh diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index 4f42c310..00000000 --- a/.cirrus.yml +++ /dev/null @@ -1,266 +0,0 @@ ---- - -# Format Ref: https://cirrus-ci.org/guide/writing-tasks/ - -# Main collection of env. vars to set for all tasks and scripts. -env: - # Actual|intended branch for this run - DEST_BRANCH: "main" - # The default is 'sh' if unspecified - CIRRUS_SHELL: "/bin/bash" - # Location where source repo. will be cloned - CIRRUS_WORKING_DIR: "/var/tmp/aardvark-dns" - # Rust package cache also lives here - CARGO_HOME: "/var/cache/cargo" - # Rust compiler output lives here (see Makefile) - CARGO_TARGET_DIR: "$CIRRUS_WORKING_DIR/targets" - # Testing depends on the latest netavark binary from upstream CI - NETAVARK_BRANCH: "main" - NETAVARK_URL: "https://api.cirrus-ci.com/v1/artifact/github/containers/netavark/success/binary.zip?branch=${NETAVARK_BRANCH}" - # Save a little typing (path relative to $CIRRUS_WORKING_DIR) - SCRIPT_BASE: "./contrib/cirrus" - IMAGE_SUFFIX: "c20260310t170224z-f43f42d14" - FEDORA_NETAVARK_IMAGE: "fedora-netavark-${IMAGE_SUFFIX}" - FEDORA_NETAVARK_AMI: "fedora-netavark-aws-arm64-${IMAGE_SUFFIX}" - EC2_INST_TYPE: "t4g.xlarge" - - -gcp_credentials: ENCRYPTED[f6a0e4101418bec8180783b208721fc990772817364fed0346f5fd126bf0cfca03738dd8c7fb867944637a1eac7cec37] - -aws_credentials: - role_arn: arn:aws:iam::449134212816:role/aardvark-dns-ci-role - role_session_name: cirrus - region: us-east-1 - -build_task: - alias: "build" - # Compiling is very CPU intensive, make it chooch quicker for this task only - gce_instance: &standard_build_gce_x86_64 - image_project: "libpod-218412" - zone: "us-central1-c" - disk: 200 # GB, do not set <200 per gcloud warning re: I/O performance - cpu: 8 - memory: "8Gb" - image_name: "${FEDORA_NETAVARK_IMAGE}" - cargo_cache: &cargo_cache - folder: "$CARGO_HOME" - fingerprint_script: echo -e "cargo_v3_${DEST_BRANCH}_amd64\n---\n$(- - aardvark-dns - aardvark-dns.debug - aardvark-dns.info - aardvark-dns.aarch64-unknown-linux-gnu - aardvark-dns.debug.aarch64-unknown-linux-gnu - aardvark-dns.info.aarch64-unknown-linux-gnu - bin_cache: *ro_bin_cache - clone_script: *noop - # The paths used for uploaded artifacts are relative here and in Cirrus - artifacts_prep_script: - - set -x - - curl --fail --location -o /tmp/armbinary.zip ${API_URL_BASE}/build_aarch64/armbinary.zip - - unzip /tmp/armbinary.zip - - mv bin/* ./ - - rm -rf bin - artifacts_test_script: # Other CI systems depend on all files being present - - ls -la - # If there's a missing file, show what it was in the output - - for fn in $EXP_BINS; do [[ -r "$(echo $fn|tee /dev/stderr)" ]] || exit 1; done - # Upload tested binary for consumption downstream - # https://cirrus-ci.org/guide/writing-tasks/#artifacts-instruction - binary_artifacts: - path: ./aardvark-dns* diff --git a/.github/workflows/check_cirrus_cron.yml b/.github/workflows/check_cirrus_cron.yml deleted file mode 100644 index 02d8a53c..00000000 --- a/.github/workflows/check_cirrus_cron.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -# See also: -# https://github.com/containers/podman/blob/main/.github/workflows/check_cirrus_cron.yml - -on: - # Note: This only applies to the default branch. - schedule: - # N/B: This should correspond to a period slightly after - # the last job finishes running. See job defs. at: - # https://cirrus-ci.com/settings/repository/6483741884284928 - - cron: '03 03 * * 1-5' - # Debug: Allow triggering job manually in github-actions WebUI - workflow_dispatch: {} - -jobs: - # Ref: https://docs.github.com/en/actions/using-workflows/reusing-workflows - call_cron_failures: - uses: containers/podman/.github/workflows/check_cirrus_cron.yml@main - secrets: - SECRET_CIRRUS_API_KEY: ${{secrets.SECRET_CIRRUS_API_KEY}} - ACTION_MAIL_SERVER: ${{secrets.ACTION_MAIL_SERVER}} - ACTION_MAIL_USERNAME: ${{secrets.ACTION_MAIL_USERNAME}} - ACTION_MAIL_PASSWORD: ${{secrets.ACTION_MAIL_PASSWORD}} - ACTION_MAIL_SENDER: ${{secrets.ACTION_MAIL_SENDER}} diff --git a/Cargo.toml b/Cargo.toml index 44edaf2b..3820eb30 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ description = "A container-focused DNS server" homepage = "https://github.com/containers/aardvark-dns" repository = "https://github.com/containers/aardvark-dns" categories = ["virtualization"] -exclude = ["/.cirrus.yml", "/.github/*"] +exclude = ["/.github/*"] rust-version = "1.88" [package.metadata.vendor-filter] diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh deleted file mode 100644 index 00f0f824..00000000 --- a/contrib/cirrus/lib.sh +++ /dev/null @@ -1,63 +0,0 @@ - - -# Library of common, shared utility functions. This file is intended -# to be sourced by other scripts, not called directly. - -# BEGIN Global export of all variables -set -a - -# Automation library installed at image-build time, -# defining $AUTOMATION_LIB_PATH in this file. -if [[ -r "/etc/automation_environment" ]]; then - source /etc/automation_environment -fi - -if [[ -n "$AUTOMATION_LIB_PATH" ]]; then - source $AUTOMATION_LIB_PATH/common_lib.sh -else - ( - echo "WARNING: It does not appear that containers/automation was installed." - echo " Functionality of most of this library will be negatively impacted" - echo " This ${BASH_SOURCE[0]} was loaded by ${BASH_SOURCE[1]}" - ) > /dev/stderr -fi - -# Unsafe env. vars for display -SECRET_ENV_RE='(ACCOUNT)|(GC[EP]..+)|(SSH)|(PASSWORD)|(TOKEN)' - -# setup.sh calls make_cienv() to cache these values for the life of the VM -if [[ -r "/etc/ci_environment" ]]; then - source /etc/ci_environment -else # set default values - see make_cienv() below - # Install rust packages globally instead of per-user - CARGO_HOME="${CARGO_HOME:-/usr/local/cargo}" - # Ensure cargo packages can be executed - PATH="$PATH:$CARGO_HOME/bin" -fi - -# END Global export of all variables -set -a - -# Shortcut to automation library timeout/retry function -retry() { err_retry 8 1000 "" "$@"; } # just over 4 minutes max - -# Helper to ensure a consistent environment across multiple CI scripts -# containers, and shell environments (e.g. hack/get_ci_vm.sh) -make_cienv(){ - local envname - local envval - local SETUP_ENVIRONMENT=1 - for envname in CARGO_HOME PATH CIRRUS_WORKING_DIR SETUP_ENVIRONMENT; do - envval="${!envname}" - # Properly escape values to prevent injection - printf -- "$envname=%q\n" "$envval" - done -} - -complete_setup(){ - set +x - msg "************************************************************" - msg "Completing environment setup, writing vars:" - msg "************************************************************" - make_cienv | tee -a /etc/ci_environment -} diff --git a/contrib/cirrus/netavark_cache_groom.sh b/contrib/cirrus/netavark_cache_groom.sh deleted file mode 100644 index 5764c8d7..00000000 --- a/contrib/cirrus/netavark_cache_groom.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# -# This script is intended to be run from Cirrus-CI to prepare the -# rust targets cache for re-use during subsequent runs. This mainly -# involves removing files and directories which change frequently -# but are cheap/quick to regenerate - i.e. prevent "cache-flapping". -# Any other use of this script is not supported and may cause harm. - -set -eo pipefail - -SCRIPT_DIRPATH=$(dirname ${BASH_SOURCE[0]}) -source $SCRIPT_DIRPATH/lib.sh - -if [[ "$CIRRUS_CI" != true ]] || [[ -z "$NETAVARK_BRANCH" ]]; then - die "Script is not intended for use outside of Cirrus-CI" -fi - -SCRIPT_DEST=$SCRIPT_DIRPATH/cache_groom.sh -showrun curl --location --silent --show-error -o $SCRIPT_DEST \ - https://raw.githubusercontent.com/containers/netavark/$NETAVARK_BRANCH/contrib/cirrus/cache_groom.sh - -# Certain common automation library calls assume execution from this file -exec bash $SCRIPT_DEST diff --git a/contrib/cirrus/runner.sh b/contrib/cirrus/runner.sh deleted file mode 100755 index 756b7c64..00000000 --- a/contrib/cirrus/runner.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash - -set -eo pipefail - -# This script runs in the Cirrus CI environment, invoked from .cirrus.yml . -# It can also be invoked manually in a `hack/get_ci_vm.sh` environment, -# documentation of said usage is TBI. -# -# The principal deciding factor is the first argument. For any -# given value 'xyz' there must be a function '_run_xyz' to handle that -# argument. - -source $(dirname ${BASH_SOURCE[0]})/lib.sh - -_run_noarg() { - die "runner.sh must be called with a single argument" -} - -_run_build() { - # Assume we're on a fast VM, compile everything needed by the - # rest of CI since subsequent tasks may have limited resources. - make all debug=1 - make build_unit # reuses some debug binaries - make all # optimized/non-debug binaries - - # This will get scooped up and become part of the artifact archive. - # Identify where the binary came from to benefit downstream consumers. - cat | tee bin/aardvark-dns.info << EOF -repo: $CIRRUS_REPO_CLONE_URL -branch: $CIRRUS_BASE_BRANCH -title: $CIRRUS_CHANGE_TITLE -commit: $CIRRUS_CHANGE_IN_REPO -build: https://cirrus-ci.com/build/$CIRRUS_BUILD_ID -task: https://cirrus-ci.com/task/$CIRRUS_TASK_ID -EOF -} - -_run_build_aarch64() { - _run_build -} - -_run_validate() { - make validate -} - -_run_validate_aarch64() { - _run_validate -} - -_run_unit() { - make unit -} - -_run_unit_aarch64() { - _run_unit -} - -_run_integration() { - make integration -} - -_run_integration_aarch64() { - make # FIXME: (@lsm5) investigate why cached binary isn't being reused - _run_integration -} - -show_env_vars - -msg "************************************************************" -msg "Toolchain details" -msg "************************************************************" -rustc --version -cargo --version - -msg "************************************************************" -msg "Runner executing '$1' on $OS_REL_VER" -msg "************************************************************" - -((${SETUP_ENVIRONMENT:-0})) || \ - die "Expecting setup.sh to have completed successfully" - -cd "${CIRRUS_WORKING_DIR}/" - -handler="_run_${1:-noarg}" - -if [ "$(type -t $handler)" != "function" ]; then - die "Unknown/Unsupported runner.sh argument '$1'" -fi - -$handler diff --git a/contrib/cirrus/setup.sh b/contrib/cirrus/setup.sh deleted file mode 100755 index 37f7df07..00000000 --- a/contrib/cirrus/setup.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# This script configures the CI runtime environment. It's intended -# to be used by Cirrus-CI, not humans. - -set -e - -source $(dirname $0)/lib.sh - -# Only do this once -if [[ -r "/etc/ci_environment" ]]; then - msg "It appears ${BASH_SOURCE[0]} already ran, exiting." - exit 0 -fi -trap "complete_setup" EXIT - -msg "************************************************************" -msg "Setting up runtime environment" -msg "************************************************************" -show_env_vars - -req_env_vars NETAVARK_URL NETAVARK_BRANCH -cd /usr/libexec/podman -rm -vf netavark* -if showrun curl --fail --location -o /tmp/netavark.zip "$NETAVARK_URL" && \ - unzip -o /tmp/netavark.zip; then - - if [[ $(uname -m) != "x86_64" ]]; then - showrun mv netavark.$(uname -m)-unknown-linux-gnu netavark - fi - showrun chmod a+x /usr/libexec/podman/netavark -else - warn "Error downloading/extracting the latest pre-compiled netavark binary from CI" - showrun cargo install \ - --root /usr/libexec/podman \ - --git https://github.com/containers/netavark \ - --branch "$NETAVARK_BRANCH" - showrun mv /usr/libexec/podman/bin/netavark /usr/libexec/podman -fi -# show netavark commit in CI logs -showrun /usr/libexec/podman/netavark version - -# Warning, this isn't the end. An exit-handler is installed to finalize -# setup of env. vars. This is required for runner.sh to operate properly. -# See complete_setup() in lib.sh for details. diff --git a/hack/get_ci_vm.sh b/hack/get_ci_vm.sh deleted file mode 100755 index 715b8fca..00000000 --- a/hack/get_ci_vm.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env bash - -# -# For help and usage information, simply execute the script w/o any arguments. -# -# This script is intended to be run by Red Hat podman developers who need -# to debug problems specifically related to Cirrus-CI automated testing. -# It requires that you have been granted prior access to create VMs in -# google-cloud. For non-Red Hat contributors, VMs are available as-needed, -# with supervision upon request. - -set -e - -SCRIPT_FILEPATH=$(realpath "${BASH_SOURCE[0]}") -SCRIPT_DIRPATH=$(dirname "$SCRIPT_FILEPATH") -REPO_DIRPATH=$(realpath "$SCRIPT_DIRPATH/../") - -# Help detect what get_ci_vm container called this script -GET_CI_VM="${GET_CI_VM:-0}" -in_get_ci_vm() { - if ((GET_CI_VM==0)); then - echo "Error: $1 is not intended for use in this context" - exit 2 - fi -} - -# get_ci_vm APIv1 container entrypoint calls into this script -# to obtain required repo. specific configuration options. -if [[ "$1" == "--config" ]]; then - in_get_ci_vm "$1" # handles GET_CI_VM==0 case - case "$GET_CI_VM" in - 1) - cat < /dev/stderr - source ./contrib/cirrus/lib.sh - echo "+ Running environment setup" > /dev/stderr - ./contrib/cirrus/setup.sh "$CIRRUS_TASK_NAME" -else - # Pass this repo and CLI args into container for VM creation/management - mkdir -p $HOME/.config/gcloud/ssh - mkdir -p $HOME/.aws - podman run -it --rm \ - --tz=local \ - -e NAME="$USER" \ - -e SRCDIR=/src \ - -e GCLOUD_ZONE="$GCLOUD_ZONE" \ - -e A_DEBUG="${A_DEBUG:-0}" \ - -v $REPO_DIRPATH:/src:O \ - -v $HOME/.config/gcloud:/root/.config/gcloud:z \ - -v $HOME/.config/gcloud/ssh:/root/.ssh:z \ - -v $HOME/.aws:/root/.aws:z \ - quay.io/libpod/get_ci_vm:latest "$@" -fi