Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate updater to use jinja templating #447

Merged
merged 6 commits into from
Oct 25, 2023
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
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Jinja CI
on:
pull_request:
paths:
- generate_dockerfiles.py
- test_generate_dockerfiles.py
branches: [ main ]

permissions:
contents: read

jobs:
CI:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: "3.x"

- name: Install dependencies
run: "pip3 install -r requirements.txt"

- name: Run tests
run: "python3 test_generate_dockerfiles.py"
2 changes: 1 addition & 1 deletion .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Run Sanity Check Script
run: " bash sanity.sh"
run: "bash sanity.sh"
9 changes: 8 additions & 1 deletion .github/workflows/updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ jobs:
with:
persist-credentials: false

- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: "3.x"

- name: Install dependencies
run: "pip3 install -r requirements.txt"

- name: Run updater
run: " bash update_all.sh"
run: "python3 generate_dockerfiles.py"

- uses: gr2m/create-or-update-pull-request-action@dc1726cbf4dd3ce766af4ec29cfb660e0125e8ee # v1
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ official-eclipse-temurin
*hotspot.txt
library/
.vscode/
__pycache__/
4 changes: 4 additions & 0 deletions 11/jdk/ubi/ubi9-minimal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ RUN set -eux; \
ESUM='262ff98d6d88a7c7cc522cb4ec4129491a0eb04f5b17dcca0da57cfcdcf3830d'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.21_9.tar.gz'; \
;; \
s390x|s390:64-bit) \
ESUM='bc67f79fb82c4131d9dcea32649c540a16aa380a9726306b9a67c5ec9690c492'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.21_9.tar.gz'; \
;; \
amd64|i386:x86-64) \
ESUM='60ea98daa09834fdd3162ca91ddc8d92a155ab3121204f6f643176ee0c2d0d5e'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.21_9.tar.gz'; \
Expand Down
4 changes: 4 additions & 0 deletions 11/jdk/ubuntu/focal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ RUN set -eux; \
ESUM='262ff98d6d88a7c7cc522cb4ec4129491a0eb04f5b17dcca0da57cfcdcf3830d'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.21_9.tar.gz'; \
;; \
s390x|s390:64-bit) \
ESUM='bc67f79fb82c4131d9dcea32649c540a16aa380a9726306b9a67c5ec9690c492'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.21_9.tar.gz'; \
;; \
amd64|i386:x86-64) \
ESUM='60ea98daa09834fdd3162ca91ddc8d92a155ab3121204f6f643176ee0c2d0d5e'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.21_9.tar.gz'; \
Expand Down
4 changes: 4 additions & 0 deletions 11/jdk/ubuntu/jammy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ RUN set -eux; \
ESUM='262ff98d6d88a7c7cc522cb4ec4129491a0eb04f5b17dcca0da57cfcdcf3830d'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.21_9.tar.gz'; \
;; \
s390x|s390:64-bit) \
ESUM='bc67f79fb82c4131d9dcea32649c540a16aa380a9726306b9a67c5ec9690c492'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.21_9.tar.gz'; \
;; \
amd64|i386:x86-64) \
ESUM='60ea98daa09834fdd3162ca91ddc8d92a155ab3121204f6f643176ee0c2d0d5e'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.21_9.tar.gz'; \
Expand Down
4 changes: 4 additions & 0 deletions 11/jre/ubi/ubi9-minimal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ RUN set -eux; \
ESUM='286e37ce06316185377eea847d2aa9f1523b9f1428684e59e772f2f6055e89b9'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jre_ppc64le_linux_hotspot_11.0.21_9.tar.gz'; \
;; \
s390x|s390:64-bit) \
ESUM='78f18503970715c03b8e6e70191d9001c883edab23d9f51ff434e4a03c6237bd'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jre_s390x_linux_hotspot_11.0.21_9.tar.gz'; \
;; \
amd64|i386:x86-64) \
ESUM='156861bb901ef18759e05f6f008595220c7d1318a46758531b957b0c950ef2c3'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jre_x64_linux_hotspot_11.0.21_9.tar.gz'; \
Expand Down
4 changes: 4 additions & 0 deletions 11/jre/ubuntu/focal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ RUN set -eux; \
ESUM='286e37ce06316185377eea847d2aa9f1523b9f1428684e59e772f2f6055e89b9'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jre_ppc64le_linux_hotspot_11.0.21_9.tar.gz'; \
;; \
s390x|s390:64-bit) \
ESUM='78f18503970715c03b8e6e70191d9001c883edab23d9f51ff434e4a03c6237bd'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jre_s390x_linux_hotspot_11.0.21_9.tar.gz'; \
;; \
amd64|i386:x86-64) \
ESUM='156861bb901ef18759e05f6f008595220c7d1318a46758531b957b0c950ef2c3'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jre_x64_linux_hotspot_11.0.21_9.tar.gz'; \
Expand Down
4 changes: 4 additions & 0 deletions 11/jre/ubuntu/jammy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ RUN set -eux; \
ESUM='286e37ce06316185377eea847d2aa9f1523b9f1428684e59e772f2f6055e89b9'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jre_ppc64le_linux_hotspot_11.0.21_9.tar.gz'; \
;; \
s390x|s390:64-bit) \
ESUM='78f18503970715c03b8e6e70191d9001c883edab23d9f51ff434e4a03c6237bd'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jre_s390x_linux_hotspot_11.0.21_9.tar.gz'; \
;; \
amd64|i386:x86-64) \
ESUM='156861bb901ef18759e05f6f008595220c7d1318a46758531b957b0c950ef2c3'; \
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jre_x64_linux_hotspot_11.0.21_9.tar.gz'; \
Expand Down
4 changes: 2 additions & 2 deletions 21/jdk/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ RUN set -eux; \
ARCH="$(apk --print-arch)"; \
case "${ARCH}" in \
aarch64|arm64) \
ESUM='3f8e5b0447d2dd711f12edda611ed1cf9aab4ca53c8fe32fca8fb1e6fee41c12'; \
BINARY_URL='https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35/OpenJDK21U-jdk_aarch64_alpine-linux_hotspot_21_35.tar.gz'; \
ESUM='77006c0a753808c2a6662007906eb6eb230f2fb6eb9d201a39cc46113e68f82c'; \
BINARY_URL='https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_aarch64_alpine-linux_hotspot_21.0.1_12.tar.gz'; \
;; \
amd64|x86_64) \
ESUM='422f23f5109056cacb9227247bebf8532e2dc3c9d505e71637ba610569d6b3ff'; \
Expand Down
4 changes: 2 additions & 2 deletions 21/jre/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ RUN set -eux; \
ARCH="$(apk --print-arch)"; \
case "${ARCH}" in \
aarch64|arm64) \
ESUM='ff4102e2aa0b35f337d579f0d19aff1aa4a10bee9ab0951137affdb50dd8f3e2'; \
BINARY_URL='https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35/OpenJDK21U-jre_aarch64_alpine-linux_hotspot_21_35.tar.gz'; \
ESUM='2898ea1ddf6f70f09b09cf99d928f6d4c862f78f81104f5dce3e44a832b8444a'; \
BINARY_URL='https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jre_aarch64_alpine-linux_hotspot_21.0.1_12.tar.gz'; \
;; \
amd64|x86_64) \
ESUM='a8fcc43927664ba191c9a77d1013f1f32fec1acc22fe6f0c29d687221f2cc95d'; \
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,15 @@ This section is for maintainers of the containers repository.
### Hourly automated Job

A [Updater GitHub Action](.github/workflows/updater.yml) runs every 30 mins which triggers the
[`./update_all.sh`](./update_all.sh) script to update the Dockerfiles by creating a Pull Request containing any changes.
[`./generate_dockerfiles.py`](./generate_dockerfiles.py) script to update the Dockerfiles by creating a Pull Request containing any changes.

#### update_all.sh
#### generate_dockerfiles.py

[`./update_all.sh`](./update_all.sh) is a wrapper script to control what is passed into [`./update_multiarch.sh`](./update_multiarch.sh).

#### update_multiarch.sh

[`./update_multiarch.sh`](./update_multiarch.sh) loops around the configuration for which versions and architectures are supported in [`./common_functions.sh`](./common_functions.sh) and uses a bunch of small functions in [`./dockerfile_functions.sh`](./dockerfile_functions.sh) to write the Dockerfiles.

### Manual Release

During a release you can also run [`./update_all.sh`](./update_all.sh) manually by heading to The [GitHub Action definition](https://github.com/adoptium/containers/actions/workflows/updater.yml) and clicking the **Run Workflow** button and making sure the `main` (default) branch is selected, then click the next **Run Workflow** button.
During a release you can also run [`./generate_dockerfiles.py`](./generate_dockerfiles.py) manually by heading to The [GitHub Action definition](https://github.com/adoptium/containers/actions/workflows/updater.yml) and clicking the **Run Workflow** button and making sure the `main` (default) branch is selected, then click the next **Run Workflow** button.

### Review and Merge PR

Expand Down
Loading