Skip to content

Commit

Permalink
Adds QA tag to pull request images
Browse files Browse the repository at this point in the history
  • Loading branch information
Stringy committed Aug 17, 2023
1 parent d3440f2 commit 3cf61de
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 33 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/integration-test-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/integration-tests-vm-type.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/container/Makefile-constants.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PLATFORM ?= linux/amd64
IMAGE_SUFFIX ?=
IMAGE_ARCH = $(word 2,$(subst /, ,$(PLATFORM)))
6 changes: 3 additions & 3 deletions integration-tests/container/benchmark/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand 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:
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/container/containerstats/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand 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:
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/container/jsonlabel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand 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:
Expand Down
24 changes: 12 additions & 12 deletions integration-tests/container/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand 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:
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/container/schedule-curls/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand 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:
Expand Down

0 comments on commit 3cf61de

Please sign in to comment.