Skip to content

Commit c4a3328

Browse files
committed
add image updater job
1 parent 3b01954 commit c4a3328

File tree

3 files changed

+137
-0
lines changed

3 files changed

+137
-0
lines changed
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
base_images:
2+
prcreator:
3+
name: prcreator
4+
namespace: ci
5+
tag: latest
6+
build_root:
7+
image_stream_tag:
8+
name: builder
9+
namespace: ocp
10+
tag: rhel-9-golang-1.24-openshift-4.20
11+
images:
12+
- dockerfile_literal: |
13+
FROM src
14+
RUN cat /etc/dnf/dnf.conf || true
15+
RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc
16+
RUN dnf install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm
17+
RUN ln -s /etc/yum.repos.d/microsoft-prod.repo /etc/yum.repos.art/ci/
18+
RUN dnf install -y azure-cli libicu git
19+
ADD prcreator /usr/bin/prcreator
20+
from: src
21+
inputs:
22+
prcreator:
23+
paths:
24+
- destination_dir: .
25+
source_path: /usr/bin/prcreator
26+
to: image-updater-base
27+
resources:
28+
'*':
29+
requests:
30+
cpu: 500m
31+
memory: 1Gi
32+
tests:
33+
- as: image-updater-all-components
34+
cron: 0 2 * * 1-5
35+
steps:
36+
test:
37+
- as: update-images
38+
commands: |
39+
#!/bin/bash
40+
set -o errexit
41+
set -o nounset
42+
set -o pipefail
43+
44+
echo "===== Configure Azure Authentication ====="
45+
export AZURE_CLIENT_ID; AZURE_CLIENT_ID=$(cat /var/run/hcp-integration-credentials/client-id)
46+
export AZURE_CLIENT_SECRET; AZURE_CLIENT_SECRET=$(cat /var/run/hcp-integration-credentials/client-secret)
47+
export AZURE_TENANT_ID; AZURE_TENANT_ID=$(cat /var/run/hcp-integration-credentials/tenant)
48+
49+
echo "===== Sync Go workspace vendor directory ====="
50+
go work vendor
51+
52+
# Configure git
53+
git config user.name "openshift-ci-robot"
54+
git config user.email "[email protected]"
55+
56+
echo "===== Building image-updater ====="
57+
cd tooling/image-updater
58+
make build
59+
60+
echo "===== Running image-updater for all components ====="
61+
./image-updater update --config config.yaml
62+
63+
# Check if there are any changes
64+
if [[ $(git status --porcelain) == "" ]]; then
65+
echo "No image updates needed for any components"
66+
exit 0
67+
fi
68+
69+
git add .
70+
git commit -m "Ran image-updater for all components"
71+
72+
cd ../..
73+
74+
echo "===== Materializing configuration ====="
75+
make -C config materialize
76+
77+
echo "===== Changes detected ====="
78+
git status --short
79+
80+
echo "===== Creating PR ====="
81+
/usr/bin/prcreator \
82+
-github-token-path=/etc/github/oauth \
83+
-organization=Azure \
84+
-repo=ARO-HCP \
85+
-branch=main \
86+
-git-message="Ran materialize" \
87+
-pr-title="Automated - Update all component image digests" \
88+
-pr-message="This automated PR updates all ARO-HCP container image digests to the latest versions from registries.
89+
90+
**Components Updated:**
91+
- \`maestro\` - Maestro operator (quay.io/redhat-user-workloads/maestro-rhtap-tenant/maestro/maestro)
92+
- \`hypershift\` - HyperShift operator (quay.io/acm-d/rhtap-hypershift-operator)
93+
- \`pko-package\` - Package Operator package (quay.io/package-operator/package-operator-package)
94+
- \`pko-manager\` - Package Operator manager (quay.io/package-operator/package-operator-manager)
95+
- \`pko-remote-phase-manager\` - Remote Phase Manager (quay.io/package-operator/remote-phase-manager)
96+
- \`arohcpfrontend\` - Frontend service (arohcpsvcdev.azurecr.io/arohcpfrontend)
97+
- \`arohcpbackend\` - Backend service (arohcpsvcdev.azurecr.io/arohcpbackend)
98+
99+
**Schedule:** Monday through Friday at 2 AM UTC
100+
101+
**Generated by:** [periodic-ci-Azure-ARO-HCP-main-image-updater-all-components](https://prow.ci.openshift.org/?job=periodic-ci-Azure-ARO-HCP-main-image-updater-all-components)
102+
103+
---
104+
105+
/cc @hbhushan @geoberle @mmazur @roivaz @venkateshsredhat @bennerv @mbarnes @SudoBrendan
106+
107+
Please review the image digest changes and merge if CI passes."
108+
credentials:
109+
- collection: ""
110+
mount_path: /etc/github
111+
name: github-credentials-openshift-ci-robot-private-git-cloner
112+
namespace: ci
113+
- collection: ""
114+
mount_path: /var/run/hcp-integration-credentials
115+
name: hcp-integration-credentials
116+
namespace: test-credentials
117+
from: image-updater-base
118+
resources:
119+
requests:
120+
cpu: 500m
121+
memory: 1Gi
122+
zz_generated_metadata:
123+
branch: main
124+
org: Azure
125+
repo: ARO-HCP
126+
variant: image-updater

ci-operator/config/Azure/ARO-HCP/Azure-ARO-HCP-main__periodic.config.prowgen

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ slack_reporter:
88
- create-aro-hcp-in-integration
99
- integration-e2e-parallel
1010
- delete-expired-integration-resource-groups
11+
- image-updater-all-components
1112
- channel: "#aro-hcp-prow-failures-stg"
1213
job_states_to_report:
1314
- failure

ci-operator/config/Azure/ARO-HCP/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# ARO-HCP CI Configuration
2+
3+
This directory contains CI/CD configuration for the Azure ARO-HCP (Hosted Control Plane) project.
4+
5+
## Configuration Files
6+
7+
- **`Azure-ARO-HCP-main.yaml`** - Presubmit and postsubmit jobs (runs on PRs and merges)
8+
- **`Azure-ARO-HCP-main__periodic.yaml`** - Scheduled periodic jobs (cluster creation, E2E tests, cleanup)
9+
- **`Azure-ARO-HCP-main__image-updater.yaml`** - Automated image digest update job - Mon-Fri
10+
111
# Adding New Production Regions to ARO-HCP Testing
212

313
This guide shows how to add periodic CI tests for new ARO-HCP production regions.

0 commit comments

Comments
 (0)