-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automates integration test container builds
- Loading branch information
Showing
8 changed files
with
201 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test-containers: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
changed: ${{ steps.filter.outputs.container }} | ||
changed_files: ${{ steps.filter.outputs.container_files }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
list-files: shell | ||
filters: | | ||
container: | ||
- integration-tests/container/** | ||
rebuild-containers: | ||
needs: test-containers | ||
if: ${{ needs.test-containers.outputs.changed == 'true' }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch: [amd64, ppc64le, s390x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Get changed containers | ||
run: | | ||
dirs=$(dirname ${{ needs.test-containers.outputs.changed_files }} | sort | uniq ) | ||
echo "CONTAINER_DIRS=$dirs" >> "$GITHUB_ENV" | ||
- name: Build containers | ||
run: | | ||
for dir in $CONTAINER_DIRS; do | ||
make -C "integration-tests/container/$dir" build | ||
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 | ||
make -C "integration-tests/container/$dir" push | ||
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' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get changed containers | ||
run: | | ||
dirs=$(dirname ${{ needs.test-containers.outputs.changed_files }} | sort | uniq ) | ||
echo "CONTAINER_DIRS=$dirs" >> "$GITHUB_ENV" | ||
- name: Make manifests | ||
run: | | ||
for dir in $CONTAINER_DIRS; do | ||
make -C "integration-tests/container/$dir" manifest | ||
done | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PLATFORM ?= linux/amd64 | ||
IMAGE_SUFFIX ?= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
BASE_PATH = . | ||
include ../Makefile-constants.mk | ||
|
||
DEFAULT_GOAL = all | ||
|
||
COLLECTOR_QA_BENCHMARK_TAG := phoronix | ||
|
||
ifneq ($(COLLECTOR_QA_TAG),) | ||
COLLECTOR_QA_BENCHMARK_TAG=phoronix-$(COLLECTOR_QA_TAG) | ||
COLLECTOR_QA_BENCHMARK_TAG=phoronix-$(COLLECTOR_QA_TAG)$(IMAGE_SUFFIX) | ||
endif | ||
|
||
PLATFORM ?= linux/amd64 | ||
|
||
|
||
.PHONY: all | ||
all: | ||
@docker buildx build --load --platform ${PLATFORM} \ | ||
-t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BENCHMARK_TAG) . | ||
-t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BENCHMARK_TAG)$(IMAGE_SUFFIX) . | ||
|
||
.PHONY: push | ||
push: | ||
@docker buildx build --push --platform ${PLATFORM} \ | ||
-t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BENCHMARK_TAG) . | ||
-t quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BENCHMARK_TAG)$(IMAGE_SUFFIX) . | ||
|
||
.PHONY: manifest | ||
manifest: | ||
@docker manifest create quay.io/rhacs-eng/collector:performance:$(COLLECTOR_QA_BENCHMARK_TAG) \ | ||
quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BENCHMARK_TAG)-amd64 \ | ||
quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BENCHMARK_TAG)-s390x \ | ||
quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BENCHMARK_TAG)-ppc64le | ||
|
||
@docker manifest push quay.io/rhacs-eng/collector-performance:$(COLLECTOR_QA_BENCHMARK_TAG) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters