diff --git a/.github/workflows/integration-test-containers.yml b/.github/workflows/integration-test-containers.yml index 34f5e679566..71a5626b3e7 100644 --- a/.github/workflows/integration-test-containers.yml +++ b/.github/workflows/integration-test-containers.yml @@ -40,7 +40,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Get changed containers + - name: Set environment run: | dirs=$(dirname ${{ needs.test-containers.outputs.changed_files }} | sort | uniq ) @@ -50,6 +50,10 @@ jobs: echo "EOS" } >> "$GITHUB_ENV" + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + echo "COLLECTOR_QA_TAG=$(echo "${GITHUB_SHA}" | cut -c1-8)" >> "$GITHUB_ENV" + fi + - name: Login to quay.io/rhacs-eng uses: docker/login-action@v2 with: @@ -66,10 +70,8 @@ jobs: done env: PLATFORM: linux/${{ matrix.arch }} - IMAGE_SUFFIX: "-${{ matrix.arch }}" - name: Push containers - if: github.event_name == 'push' run: | for dir in $CONTAINER_DIRS; do if [[ -f "$dir/Makefile" ]]; then @@ -78,14 +80,13 @@ jobs: done env: PLATFORM: linux/${{ matrix.arch }} - IMAGE_SUFFIX: "-${{ matrix.arch }}" push-manifest: runs-on: ubuntu-latest needs: - rebuild-containers - test-containers - if: needs.test-containers.outputs.changed == 'true' && github.event_name == 'push' + if: needs.test-containers.outputs.changed == 'true' steps: - uses: actions/checkout@v3 @@ -99,6 +100,10 @@ jobs: echo "EOS" } >> "$GITHUB_ENV" + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + echo "COLLECTOR_QA_TAG=$(echo "${GITHUB_SHA}" | cut -c1-8)" >> "$GITHUB_ENV" + fi + - name: Login to quay.io/rhacs-eng uses: docker/login-action@v2 with: diff --git a/.github/workflows/integration-tests-vm-type.yml b/.github/workflows/integration-tests-vm-type.yml index 348ba035323..e654fc91978 100644 --- a/.github/workflows/integration-tests-vm-type.yml +++ b/.github/workflows/integration-tests-vm-type.yml @@ -109,6 +109,10 @@ jobs: echo "COLLECTOR_LOG_LEVEL=trace" | tee -a "$GITHUB_ENV" fi + if [[ '${{ github.event_name }}' == 'pull_request' ]]; then + echo "COLLECTOR_QA_TAG=$(echo "$GITHUB_SHA" | cut -c1-8)" >> "$GITHUB_ENV" + fi + - name: Create VMs if: ${{ ! inputs.run-benchmarks }} run: | diff --git a/integration-tests/container/Makefile-constants.mk b/integration-tests/container/Makefile-constants.mk index 97494b91fe9..505b04120e6 100644 --- a/integration-tests/container/Makefile-constants.mk +++ b/integration-tests/container/Makefile-constants.mk @@ -1,2 +1,2 @@ PLATFORM ?= linux/amd64 -IMAGE_SUFFIX ?= +IMAGE_ARCH = $(word 2,$(subst /, ,$(PLATFORM))) diff --git a/integration-tests/container/benchmark/Makefile b/integration-tests/container/benchmark/Makefile index 7f61b17516f..0841671ab70 100644 --- a/integration-tests/container/benchmark/Makefile +++ b/integration-tests/container/benchmark/Makefile @@ -6,7 +6,7 @@ DEFAULT_GOAL = all COLLECTOR_QA_BENCHMARK_TAG := phoronix ifneq ($(COLLECTOR_QA_TAG),) -COLLECTOR_QA_BENCHMARK_TAG=phoronix-$(COLLECTOR_QA_TAG)$(IMAGE_SUFFIX) +COLLECTOR_QA_BENCHMARK_TAG=phoronix-$(COLLECTOR_QA_TAG) endif .PHONY: all @@ -15,12 +15,12 @@ all: build .PHONY: build build: @docker buildx build --load --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BENCHMARK_TAG)$(IMAGE_SUFFIX) . + -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BENCHMARK_TAG)-$(IMAGE_ARCH) . .PHONY: push push: @docker buildx build --push --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BENCHMARK_TAG)$(IMAGE_SUFFIX) . + -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BENCHMARK_TAG)-$(IMAGE_ARCH) . .PHONY: manifest manifest: diff --git a/integration-tests/container/containerstats/Makefile b/integration-tests/container/containerstats/Makefile index f70d1068577..a890c4adf7f 100644 --- a/integration-tests/container/containerstats/Makefile +++ b/integration-tests/container/containerstats/Makefile @@ -6,7 +6,7 @@ include ../Makefile-constants.mk COLLECTOR_QA_STATS_TAG := stats ifneq ($(COLLECTOR_QA_TAG),) -COLLECTOR_QA_STATS_TAG=stats-$(COLLECTOR_QA_TAG)$(IMAGE_SUFFIX) +COLLECTOR_QA_STATS_TAG=stats-$(COLLECTOR_QA_TAG) endif .PHONY: all @@ -15,12 +15,12 @@ all: build .PHONY: build build: @docker buildx build --load --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_STATS_TAG) . + -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_STATS_TAG)-$(IMAGE_ARCH) . .PHONY: push push: @docker buildx build --push --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_STATS_TAG) . + -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_STATS_TAG)-$(IMAGE_ARCH) . .PHONY: manifest manifest: diff --git a/integration-tests/container/jsonlabel/Makefile b/integration-tests/container/jsonlabel/Makefile index 5f7e699ce35..d870aa50da5 100644 --- a/integration-tests/container/jsonlabel/Makefile +++ b/integration-tests/container/jsonlabel/Makefile @@ -6,7 +6,7 @@ include ../Makefile-constants.mk COLLECTOR_QA_JSON_LABEL_TAG := json-label ifneq ($(COLLECTOR_QA_TAG),) -COLLECTOR_QA_JSON_LABEL_TAG=json-label-$(COLLECTOR_QA_TAG)$(IMAGE_SUFFIX) +COLLECTOR_QA_JSON_LABEL_TAG=json-label-$(COLLECTOR_QA_TAG) endif .PHONY: all @@ -15,12 +15,12 @@ all: build .PHONY: build build: @docker buildx build --load --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_JSON_LABEL_TAG) . + -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_JSON_LABEL_TAG)-$(IMAGE_ARCH) . .PHONY: push push: @docker buildx build --push --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_JSON_LABEL_TAG) . + -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_JSON_LABEL_TAG)-$(IMAGE_ARCH) . .PHONY: manifest manifest: diff --git a/integration-tests/container/perf/Makefile b/integration-tests/container/perf/Makefile index 0eb8ce32ede..88a3044d832 100644 --- a/integration-tests/container/perf/Makefile +++ b/integration-tests/container/perf/Makefile @@ -9,10 +9,10 @@ COLLECTOR_QA_BCC_TAG := bcc COLLECTOR_QA_BPFTRACE_TAG := bpftrace ifneq ($(COLLECTOR_QA_TAG),) -COLLECTOR_QA_INIT_TAG=init-$(COLLECTOR_QA_TAG)$(IMAGE_SUFFIX) -COLLECTOR_QA_PERF_TAG=perf-$(COLLECTOR_QA_TAG)$(IMAGE_SUFFIX) -COLLECTOR_QA_BCC_TAG=bcc-$(COLLECTOR_QA_TAG)$(IMAGE_SUFFIX) -COLLECTOR_QA_BPFTRACE_TAG=bpftrace-$(COLLECTOR_QA_TAG)$(IMAGE_SUFFIX) +COLLECTOR_QA_INIT_TAG=init-$(COLLECTOR_QA_TAG) +COLLECTOR_QA_PERF_TAG=perf-$(COLLECTOR_QA_TAG) +COLLECTOR_QA_BCC_TAG=bcc-$(COLLECTOR_QA_TAG) +COLLECTOR_QA_BPFTRACE_TAG=bpftrace-$(COLLECTOR_QA_TAG) endif .PHONY: all @@ -21,24 +21,24 @@ all: build .PHONY: build build: @docker buildx build --load --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_INIT_TAG) --target init -f Dockerfile . + -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_INIT_TAG)-$(IMAGE_ARCH) --target init -f Dockerfile . @docker buildx build --load --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_PERF_TAG) --target perf -f Dockerfile . + -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_PERF_TAG)-$(IMAGE_ARCH) --target perf -f Dockerfile . @docker buildx build --load --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BCC_TAG) --target bcc -f Dockerfile . + -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BCC_TAG)-$(IMAGE_ARCH) --target bcc -f Dockerfile . @docker buildx build --load --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BPFTRACE_TAG) -f Dockerfile.bpftrace . + -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BPFTRACE_TAG)-$(IMAGE_ARCH) -f Dockerfile.bpftrace . .PHONY: push push: @docker buildx build --push --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_INIT_TAG) --target init -f Dockerfile . + -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_INIT_TAG)-$(IMAGE_ARCH) --target init -f Dockerfile . @docker buildx build --push --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_PERF_TAG) --target perf -f Dockerfile . + -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_PERF_TAG)-$(IMAGE_ARCH) --target perf -f Dockerfile . @docker buildx build --push --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BCC_TAG) --target bcc -f Dockerfile . + -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BCC_TAG)-$(IMAGE_ARCH) --target bcc -f Dockerfile . @docker buildx build --push --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BPFTRACE_TAG) -f Dockerfile.bpftrace . + -t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BPFTRACE_TAG)-$(IMAGE_ARCH) -f Dockerfile.bpftrace . .PHONY: manifest manifest: manifest-bcc manifest-bpftrace manifest-perf manifest-init diff --git a/integration-tests/container/processes-listening-on-ports/Makefile b/integration-tests/container/processes-listening-on-ports/Makefile index 8f3c428c645..5e00e404575 100644 --- a/integration-tests/container/processes-listening-on-ports/Makefile +++ b/integration-tests/container/processes-listening-on-ports/Makefile @@ -6,7 +6,7 @@ include ../Makefile-constants.mk COLLECTOR_QA_PROCESSES_LISTENING_ON_PORTS_TAG := collector-processes-listening-on-ports ifneq ($(COLLECTOR_QA_TAG),) -COLLECTOR_QA_PROCESSES_LISTENING_ON_PORTS_TAG=collector-processes-listening-on-ports-$(COLLECTOR_QA_TAG)$(IMAGE_SUFFIX) +COLLECTOR_QA_PROCESSES_LISTENING_ON_PORTS_TAG=collector-processes-listening-on-ports-$(COLLECTOR_QA_TAG) endif .PHONY: all @@ -15,12 +15,12 @@ all: build .PHONY: build build: @docker buildx build --load --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/qa-multi-arch:$(COLLECTOR_QA_PROCESSES_LISTENING_ON_PORTS_TAG) . + -t quay.io/rhacs-eng/qa-multi-arch:$(COLLECTOR_QA_PROCESSES_LISTENING_ON_PORTS_TAG)-$(IMAGE_ARCH) . .PHONY: push push: @docker buildx build --push --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/qa-multi-arch:$(COLLECTOR_QA_PROCESSES_LISTENING_ON_PORTS_TAG) . + -t quay.io/rhacs-eng/qa-multi-arch:$(COLLECTOR_QA_PROCESSES_LISTENING_ON_PORTS_TAG)-$(IMAGE_ARCH) . .PHONY: manifest manifest: diff --git a/integration-tests/container/schedule-curls/Makefile b/integration-tests/container/schedule-curls/Makefile index 6c2be4a2521..624993c6dfe 100644 --- a/integration-tests/container/schedule-curls/Makefile +++ b/integration-tests/container/schedule-curls/Makefile @@ -6,7 +6,7 @@ include ../Makefile-constants.mk COLLECTOR_QA_SCHEDULE_CURLS_TAG := collector-schedule-curls ifneq ($(COLLECTOR_QA_TAG),) -COLLECTOR_QA_SCHEDULE_CURLS_TAG=collector-schedule-curls-$(COLLECTOR_QA_TAG)$(IMAGE_SUFFIX) +COLLECTOR_QA_SCHEDULE_CURLS_TAG=collector-schedule-curls-$(COLLECTOR_QA_TAG) endif .PHONY: all @@ -15,12 +15,12 @@ all: build .PHONY: build build: @docker buildx build --load --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/qa-multi-arch:$(COLLECTOR_QA_SCHEDULE_CURLS_TAG) . + -t quay.io/rhacs-eng/qa-multi-arch:$(COLLECTOR_QA_SCHEDULE_CURLS_TAG)-$(IMAGE_ARCH) . .PHONY: push push: @docker buildx build --push --platform ${PLATFORM} \ - -t quay.io/rhacs-eng/qa-multi-arch:$(COLLECTOR_QA_SCHEDULE_CURLS_TAG) . + -t quay.io/rhacs-eng/qa-multi-arch:$(COLLECTOR_QA_SCHEDULE_CURLS_TAG)-$(IMAGE_ARCH) . .PHONY: manifest manifest: