Skip to content

Commit c7ac5da

Browse files
authored
chore(e2e): rhidp-6297 Automate E2E Runner Image Build and Push to Quay via GitHub Actions (#2524)
* Add GitHub workflow to build and push e2e-runner image This workflow builds the e2e-runner Docker image and pushes it to Quay.io upon pull requests to the main branch. Signed-off-by: Gustavo Lira <[email protected]> * Update README with OpenShift CI image workflow details Clarified the process for updating and deploying the `rhdh-e2e-runner` image, including workflows for `main` and other branches. Highlighted steps for local testing, GitHub Actions automation, and propagation delays in OpenShift CI's mirror Signed-off-by: Gustavo Lira <[email protected]> --------- Signed-off-by: Gustavo Lira <[email protected]>
1 parent 0abeaa4 commit c7ac5da

File tree

2 files changed

+88
-16
lines changed

2 files changed

+88
-16
lines changed
+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build & Push e2e-runner Image to Quay.io
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- '.ibm/images/Dockerfile'
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
REGISTRY: quay.io
16+
REGISTRY_IMAGE: rhdh-community/rhdh-e2e-runner
17+
IMAGE_TAG: main
18+
19+
jobs:
20+
build-image:
21+
name: Build & Push e2e-runner Image
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
os: [ubuntu-24.04]
26+
runs-on: ${{ matrix.os }}
27+
permissions:
28+
contents: read
29+
packages: write
30+
31+
steps:
32+
- name: Checkout Repository
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0
36+
37+
- name: Prepare Environment Variables
38+
run: |
39+
echo "PLATFORM=linux/amd64" >> $GITHUB_ENV
40+
41+
- name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v3
43+
44+
- name: Login to Quay.io
45+
uses: docker/login-action@v3
46+
with:
47+
registry: ${{ env.REGISTRY }}
48+
username: ${{ secrets.QUAY_USERNAME }}
49+
password: ${{ secrets.QUAY_TOKEN }}
50+
51+
- name: Build and Push Image
52+
uses: docker/build-push-action@v5
53+
with:
54+
context: .ibm/images/
55+
push: true
56+
tags: ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}
57+
platforms: ${{ env.PLATFORM }}

.ibm/images/README

+31-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,38 @@
1-
This Dockerfile creates an image to be used by the IBM Cloud pipelines
1+
# RHDH e2e Runner - OpenShift CI Integration
22

3-
Currently this image is built by hand at intervals and pushed to https://quay.io/repository/rhdh-community/rhdh-e2e-runner?tab=tags when in need of an update.
3+
## Overview
4+
The `rhdh-e2e-runner` is a container image used in **OpenShift CI**, where it is deployed via a **mirror** that fetches the image from the Quay repository.
45

5-
```
6-
SHA="$(git rev-parse --short=8 HEAD)"
7-
# main or release-1.y
8-
branch="$(git rev-parse --abbrev-ref HEAD)"
9-
image="quay.io/rhdh-community/rhdh-e2e-runner:${branch}"
6+
## Workflow for Updating the Image
107

11-
# build and push
12-
podman build . -f Dockerfile -t "${image}-${SHA}" && podman push "${image}-${SHA}"
8+
### **Main Branch Workflow**
9+
For changes to the image in `.ibm/images/Dockerfile`, follow these steps:
10+
1. **Perform a Local Test:**
11+
- Before updating the `Dockerfile`, perform a local test by running the e2e tests to ensure the changes are stable.
1312

14-
# update the floating (branch-named) tag too
15-
skopeo --insecure-policy copy --all docker://${image}-${SHA} docker://${image}
16-
```
13+
2. **Update the Dockerfile:**
14+
- Once validated, update `.ibm/images/Dockerfile` with the required changes.
1715

18-
In future this might be automated so that if the contents of this folder changes, a new image is pushed automatically.
16+
3. **GitHub Actions Build & Push:**
17+
- The **GitHub Actions workflow** automatically builds and pushes the updated image to **Quay.io**.
18+
- This only happens **after all tests are completed successfully**.
1919

20-
See also:
20+
4. **Propagation to OpenShift CI Mirror:**
21+
- After the image is pushed to Quay, OpenShift CI **does not** immediately use the new image.
22+
- There is a delay while OpenShift updates its **mirror** with the new version.
2123

22-
* https://quay.io/repository/rhdh-community/rhdh-e2e-runner?tab=info
23-
* https://issues.redhat.com/browse/RHIDP-6244
24+
5. **Merge to Main Branch:**
25+
- The image update process happens **before merging into `main`**.
26+
- Ensure that the updated image has been successfully used in e2e tests before merging.
27+
28+
### **Other Branches Workflow**
29+
For branches **other than `main`**, OpenShift CI does **not** fetch from Quay:
30+
- Instead, **OpenShift CI builds the image directly** from `.ibm/images/Dockerfile`.
31+
- Any changes made to the file will **immediately reflect** in the test execution.
32+
- There is no need to wait for an image update in the mirror.
33+
34+
## Key Considerations
35+
- **Local testing is mandatory** before making any modifications.
36+
- **GitHub Actions automates the push process** only for `main` branch updates.
37+
- **OpenShift CI mirror has a delay** in updating the image after it is pushed to Quay.
38+
- **Other branches build the image directly**, so changes take effect immediately.

0 commit comments

Comments
 (0)