Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 89 additions & 13 deletions .github/workflows/update-locks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,45 @@ on:
schedule:
- cron: "17 8 * * 1"
workflow_dispatch:
inputs:
propose:
description: Open an update PR (main only); false retains candidates only
type: boolean
default: true

concurrency:
group: update-locks-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: read

jobs:
bases:
name: resolve UBI manifest indexes
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Refresh selected UBI release and verify both platforms
run: python scripts/refresh-bases.py

- name: Share the same pinned bases with both native resolvers
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: base-input-candidate
path: |
Containerfile
artifacts/lock-inputs.json
if-no-files-found: error
retention-days: 7

resolve:
needs: bases
name: resolve candidate (${{ matrix.architecture }})
strategy:
fail-fast: false
Expand All @@ -29,7 +62,12 @@ jobs:
with:
persist-credentials: false

- name: Validate reviewed lock inputs
- name: Download the common base selection
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: base-input-candidate

- name: Validate candidate lock inputs
run: python scripts/artifacts.py validate-inputs artifacts/lock-inputs.json

- name: Acquire PostgreSQL seeds and approved keys
Expand All @@ -45,12 +83,12 @@ jobs:
env:
ARCHITECTURE: ${{ matrix.architecture }}
PLATFORM: ${{ matrix.platform }}
UBI_MINIMAL: registry.access.redhat.com/ubi9/ubi-minimal:9.8@sha256:7fbeae18dc9476399f565e68255f602a3374ea8614ba3d14843565131a13ff93
run: >-
docker run --rm --platform "${PLATFORM}"
--volume "${PWD}:/work" --workdir /work
"${UBI_MINIMAL}" bash scripts/resolve-lock.sh
"${ARCHITECTURE}" /work/resolution-inputs /work/resolution-output
run: |
UBI_MINIMAL="$(python -c 'import json; print(json.load(open("artifacts/lock-inputs.json"))["base_images"]["builder"])')"
docker run --rm --platform "${PLATFORM}" \
--volume "${PWD}:/work" --workdir /work \
"${UBI_MINIMAL}" bash scripts/resolve-lock.sh \
"${ARCHITECTURE}" /work/resolution-inputs /work/resolution-output

- name: Render and validate candidate lock
env:
Expand All @@ -61,16 +99,54 @@ jobs:
--architecture "${ARCHITECTURE}" \
--binary-inventory resolution-output/binary-inventory.tsv \
--source-inventory resolution-output/source-inventory.tsv \
--output "${ARCHITECTURE}.lock.json"
python scripts/artifacts.py validate-lock "${ARCHITECTURE}.lock.json"
--output "artifacts/locks/${ARCHITECTURE}.json"
python scripts/artifacts.py validate-lock "artifacts/locks/${ARCHITECTURE}.json"

- name: Retain candidate for maintainer review
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: artifact-lock-candidate-${{ matrix.architecture }}
path: |
${{ matrix.architecture }}.lock.json
resolution-output/binary-inventory.tsv
resolution-output/source-inventory.tsv
path: artifacts/locks/${{ matrix.architecture }}.json
if-no-files-found: error
retention-days: 7

- name: Retain resolver inventories
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: resolution-inventories-${{ matrix.architecture }}
path: resolution-output/*-inventory.tsv
if-no-files-found: error
retention-days: 7

propose:
name: propose reviewed-input changes
needs: [bases, resolve]
if: github.ref == 'refs/heads/main' && (github.event_name == 'schedule' || inputs.propose)
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
actions: write
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Download base candidates
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: base-input-candidate

- name: Download both native locks
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: artifact-lock-candidate-*
path: artifacts/locks
merge-multiple: true

- name: Validate and open a pull request when inputs changed
env:
GH_TOKEN: ${{ secrets.LOCK_UPDATE_TOKEN || github.token }}
run: bash scripts/propose-lock-update.sh
4 changes: 2 additions & 2 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.7

ARG UBI_MINIMAL_IMAGE="registry.access.redhat.com/ubi9/ubi-minimal:9.8@sha256:7fbeae18dc9476399f565e68255f602a3374ea8614ba3d14843565131a13ff93"
ARG UBI_MICRO_IMAGE="registry.access.redhat.com/ubi9/ubi-micro:9.8@sha256:f332c99eb8f798a8486821c91937f10ad64ee83d7e739303be2df051040918f6"
ARG UBI_MINIMAL_IMAGE="registry.access.redhat.com/ubi9/ubi-minimal:9.8@sha256:4b79c93106c14ad1c234907f83441ff0e4f8d24e78426a36e159098e9f7e6fa5"
ARG UBI_MICRO_IMAGE="registry.access.redhat.com/ubi9/ubi-micro:9.8@sha256:6d9eff186ce3ccf399c1835265e7fd3f83bd112cc3422da2d39fd44e234aab59"

FROM ${UBI_MICRO_IMAGE} AS runtime-base

Expand Down
4 changes: 2 additions & 2 deletions artifacts/lock-inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"postgresql_rpm_version": "18.6-1PGDG.rhel9.8",
"ubi_release": "9.8",
"base_images": {
"builder": "registry.access.redhat.com/ubi9/ubi-minimal:9.8@sha256:7fbeae18dc9476399f565e68255f602a3374ea8614ba3d14843565131a13ff93",
"runtime": "registry.access.redhat.com/ubi9/ubi-micro:9.8@sha256:f332c99eb8f798a8486821c91937f10ad64ee83d7e739303be2df051040918f6"
"builder": "registry.access.redhat.com/ubi9/ubi-minimal:9.8@sha256:4b79c93106c14ad1c234907f83441ff0e4f8d24e78426a36e159098e9f7e6fa5",
"runtime": "registry.access.redhat.com/ubi9/ubi-micro:9.8@sha256:6d9eff186ce3ccf399c1835265e7fd3f83bd112cc3422da2d39fd44e234aab59"
},
"architectures": {
"amd64": {
Expand Down
Loading
Loading