Skip to content

Commit a00c5c4

Browse files
committed
Merge remote-tracking branch 'iqss/develop' into npe-cvoc
2 parents 395efe2 + b3e1c78 commit a00c5c4

File tree

288 files changed

+10974
-3231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+10974
-3231
lines changed

.github/CODEOWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
# Any container related stuff should be assigned to / reviewed by Oliver and/or Phil
3+
modules/container-configbaker/** @poikilotherm @pdurbin
4+
modules/container-base/** @poikilotherm @pdurbin
5+
src/main/docker/** @poikilotherm @pdurbin
6+
docker-compose-dev.yml @poikilotherm @pdurbin
7+
.github/workflows/scripts/containers** @poikilotherm @pdurbin
8+
.github/workflows/container_* @poikilotherm @pdurbin

.github/workflows/container_app_pr.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
name: Preview Application Container Image
33

4+
# TODO: merge this workflow into the existing container_app_push.yaml flow - there's not much difference!
5+
46
on:
57
# We only run the push commands if we are asked to by an issue comment with the correct command.
68
# This workflow is always taken from the default branch and runs in repo context with access to secrets.
79
repository_dispatch:
810
types: [ push-image-command ]
911

1012
env:
11-
IMAGE_TAG: unstable
12-
BASE_IMAGE_TAG: unstable
1313
PLATFORMS: "linux/amd64,linux/arm64"
1414

1515
jobs:
@@ -65,10 +65,9 @@ jobs:
6565
install
6666
- name: Deploy multi-arch application and configbaker container image
6767
run: >
68-
mvn
69-
-Dapp.image.tag=${{ env.IMAGE_TAG }} -Dbase.image.tag=${{ env.BASE_IMAGE_TAG }}
68+
mvn -Pct deploy
69+
-Dapp.image.tag=${{ env.IMAGE_TAG }}
7070
-Ddocker.registry=ghcr.io -Ddocker.platforms=${{ env.PLATFORMS }}
71-
-Pct deploy
7271
7372
- uses: marocchino/sticky-pull-request-comment@v2
7473
with:

.github/workflows/container_app_push.yml

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ env:
2424
IMAGE_TAG: unstable
2525
REGISTRY: "" # Empty means default to Docker Hub
2626
PLATFORMS: "linux/amd64,linux/arm64"
27-
MASTER_BRANCH_TAG: alpha
2827

2928
jobs:
3029
build:
@@ -60,30 +59,6 @@ jobs:
6059
6160
# TODO: add smoke / integration testing here (add "-Pct -DskipIntegrationTests=false")
6261

63-
hub-description:
64-
needs: build
65-
name: Push image descriptions to Docker Hub
66-
# Run this when triggered via push or schedule as reused workflow from base / maven unit tests.
67-
# Excluding PRs here means we will have no trouble with secrets access. Also avoid runs in forks.
68-
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'develop' && github.repository_owner == 'IQSS' }}
69-
runs-on: ubuntu-latest
70-
steps:
71-
- uses: actions/checkout@v4
72-
- uses: peter-evans/dockerhub-description@v4
73-
with:
74-
username: ${{ secrets.DOCKERHUB_USERNAME }}
75-
password: ${{ secrets.DOCKERHUB_TOKEN }}
76-
repository: gdcc/dataverse
77-
short-description: "Dataverse Application Container Image providing the executable"
78-
readme-filepath: ./src/main/docker/README.md
79-
- uses: peter-evans/dockerhub-description@v4
80-
with:
81-
username: ${{ secrets.DOCKERHUB_USERNAME }}
82-
password: ${{ secrets.DOCKERHUB_TOKEN }}
83-
repository: gdcc/configbaker
84-
short-description: "Dataverse Config Baker Container Image providing setup tooling and more"
85-
readme-filepath: ./modules/container-configbaker/README.md
86-
8762
# Note: Accessing, pushing tags etc. to DockerHub or GHCR will only succeed in upstream because secrets.
8863
# We check for them here and subsequent jobs can rely on this to decide if they shall run.
8964
check-secrets:
@@ -107,13 +82,13 @@ jobs:
10782
needs: check-secrets
10883
name: "Package & Publish"
10984
runs-on: ubuntu-latest
110-
# Only run this job if we have access to secrets. This is true for events like push/schedule which run in
85+
# Only run this job if we have access to secrets. This is true for events like push/schedule which run in the
11186
# context of the main repo, but for PRs only true if coming from the main repo! Forks have no secret access.
11287
#
11388
# Note: The team's decision was to not auto-deploy an image on any git push where no PR exists (yet).
114-
# Accordingly, only run for push events on branches develop and master.
89+
# Accordingly, only run for push events on the 'develop' branch.
11590
if: needs.check-secrets.outputs.available == 'true' &&
116-
( github.event_name != 'push' || ( github.event_name == 'push' && contains(fromJSON('["develop", "master"]'), github.ref_name)))
91+
( github.event_name != 'push' || ( github.event_name == 'push' && github.ref_name == 'develop' ))
11792
steps:
11893
- name: Checkout and Setup Maven
11994
uses: IQSS/dataverse/.github/actions/setup-maven@develop
@@ -141,16 +116,15 @@ jobs:
141116
- name: Set up QEMU for multi-arch builds
142117
uses: docker/setup-qemu-action@v3
143118

144-
- name: Re-set image tag based on branch (if master)
145-
if: ${{ github.ref_name == 'master' }}
119+
- name: Add rolling image tag when pushing to develop
120+
if: ${{ github.event_name == 'push' && github.ref_name == 'develop' }}
146121
run: |
147-
echo "IMAGE_TAG=${{ env.MASTER_BRANCH_TAG }}" >> $GITHUB_ENV
148-
echo "BASE_IMAGE_TAG=${{ env.MASTER_BRANCH_TAG }}" >> $GITHUB_ENV
122+
echo "ADDITIONAL_TAGS=-Ddocker.tags.upcoming=$( mvn initialize help:evaluate -Pct -Dexpression=app.image.tag -Dapp.image.tag='${app.image.version}-${base.image.flavor}' -q -DforceStdout )" | tee -a "$GITHUB_ENV"
149123
- name: Re-set image tag and container registry when on PR
150124
if: ${{ github.event_name == 'pull_request' }}
151125
run: |
152-
echo "IMAGE_TAG=$(echo "$GITHUB_HEAD_REF" | tr '\\/_:&+,;#*' '-')" >> $GITHUB_ENV
153-
echo "REGISTRY='-Ddocker.registry=ghcr.io'" >> $GITHUB_ENV
126+
echo "IMAGE_TAG=$(echo "$GITHUB_HEAD_REF" | tr '\\/_:&+,;#*' '-')" | tee -a "$GITHUB_ENV"
127+
echo "REGISTRY='-Ddocker.registry=ghcr.io'" | tee -a "$GITHUB_ENV"
154128
155129
# Necessary to split as otherwise the submodules are not available (deploy skips install)
156130
- name: Build app and configbaker container image with local architecture and submodules (profile will skip tests)
@@ -162,7 +136,7 @@ jobs:
162136
- name: Deploy multi-arch application and configbaker container image
163137
run: >
164138
mvn
165-
-Dapp.image.tag=${{ env.IMAGE_TAG }}
139+
-Dapp.image.tag=${{ env.IMAGE_TAG }} ${{ env.ADDITIONAL_TAGS }}
166140
$( [[ -n "${{ inputs.base-image-ref }}" ]] && echo "-Dbase.image=${{ inputs.base-image-ref }}" )
167141
${{ env.REGISTRY }} -Ddocker.platforms=${{ env.PLATFORMS }}
168142
-P ct deploy

.github/workflows/container_base_push.yml

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
---
2-
name: Container Images Releasing
2+
name: Base Container Image
33

44
on:
55
push:
6-
tags:
7-
- 'v[6-9].**'
86
branches:
97
- 'develop'
108
# "Path filters are not evaluated for pushes of tags" https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore
@@ -33,7 +31,7 @@ jobs:
3331
# Only run in upstream repo - avoid unnecessary runs in forks
3432
if: ${{ github.repository_owner == 'IQSS' }}
3533
outputs:
36-
base-image-ref: ${{ steps.finalize.outputs.base-image-ref }}
34+
base-image-ref: ${{ steps.determine-name.outputs.full-ref }}
3735

3836
steps:
3937
- name: Checkout and Setup Maven
@@ -52,12 +50,10 @@ jobs:
5250
# In case this is a push to develop, we care about buildtime.
5351
# Configure a remote ARM64 build host in addition to the local AMD64 in two steps.
5452
- name: Setup SSH agent
55-
if: ${{ github.event_name != 'schedule' }}
5653
uses: webfactory/[email protected]
5754
with:
5855
ssh-private-key: ${{ secrets.BUILDER_ARM64_SSH_PRIVATE_KEY }}
5956
- name: Provide the known hosts key and the builder config
60-
if: ${{ github.event_name != 'schedule' }}
6157
run: |
6258
echo "${{ secrets.BUILDER_ARM64_SSH_HOST_KEY }}" > ~/.ssh/known_hosts
6359
mkdir -p modules/container-base/target/buildx-state/buildx/instances
@@ -81,40 +77,25 @@ jobs:
8177
8278
# Determine the base image name we are going to use from here on
8379
- name: Determine base image name
80+
id: determine-name
8481
run: |
85-
if [[ "${{ github.ref_name }}" = "${{ env.DEVELOPMENT_BRANCH }}" ]]; then
86-
echo "BASE_IMAGE=$( mvn initialize help:evaluate -Pct -f modules/container-base -Dexpression=base.image -q -DforceStdout )" | tee -a "${GITHUB_ENV}"
87-
echo "BASE_IMAGE_UPCOMING=$( mvn initialize help:evaluate -Pct -f modules/container-base -Dexpression=base.image -Dbase.image.tag.suffix="" -q -DforceStdout )" | tee -a "${GITHUB_ENV}"
88-
else
89-
echo "BASE_IMAGE=$( mvn initialize help:evaluate -Pct -f modules/container-base -Dexpression=base.image -Dbase.image.tag.suffix="" -q -DforceStdout )" | tee -a "${GITHUB_ENV}"
90-
fi
91-
- name: Calculate revision number for immutable tag (on release branches only)
92-
if: ${{ github.ref_name != env.DEVELOPMENT_BRANCH }}
93-
id: revision-tag
94-
uses: ./.github/actions/get-image-revision
95-
with:
96-
image-ref: ${{ env.BASE_IMAGE }}
97-
tag-options-prefix: "-Dbase.image.tag.suffix='' -Ddocker.tags.revision="
82+
BASE_IMAGE=$( mvn initialize help:evaluate -Pct -f modules/container-base -Dexpression=base.image -q -DforceStdout )
83+
BASE_IMAGE_UPCOMING=$( mvn initialize help:evaluate -Pct -f modules/container-base -Dexpression=base.image -Dbase.image.tag.suffix="" -q -DforceStdout )
84+
85+
echo "BASE_IMAGE=${BASE_IMAGE}" | tee -a "${GITHUB_ENV}"
86+
echo "BASE_IMAGE_UPCOMING=${BASE_IMAGE_UPCOMING}" | tee -a "${GITHUB_ENV}"
87+
echo "full-ref=${BASE_IMAGE_UPCOMING}" | tee -a "$GITHUB_OUTPUT"
88+
9889
- name: Configure update of "latest" tag for development branch
9990
id: develop-tag
100-
if: ${{ github.ref_name == env.DEVELOPMENT_BRANCH }}
10191
run: |
10292
echo "tag-options=-Ddocker.tags.develop=unstable -Ddocker.tags.upcoming=${BASE_IMAGE_UPCOMING#*:}" | tee -a "${GITHUB_OUTPUT}"
10393
10494
- name: Deploy multi-arch base container image to Docker Hub
10595
id: build
10696
run: |
10797
mvn -f modules/container-base -Pct deploy -Ddocker.noCache -Ddocker.platforms=${{ env.PLATFORMS }} \
108-
-Ddocker.imagePropertyConfiguration=override ${{ steps.develop-tag.outputs.tag-options }} ${{ steps.revision-tag.outputs.tag-options }}
109-
110-
- name: Determine appropriate base image ref for app image
111-
id: finalize
112-
run: |
113-
if [[ "${{ github.ref_name }}" = "${{ env.DEVELOPMENT_BRANCH }}" ]]; then
114-
echo "base-image-ref=${BASE_IMAGE_UPCOMING}" | tee -a "$GITHUB_OUTPUT"
115-
else
116-
echo "base-image-ref=gdcc/base:${{ steps.revision-tag.outputs.revision-tag }}" | tee -a "$GITHUB_OUTPUT"
117-
fi
98+
-Ddocker.imagePropertyConfiguration=override ${{ steps.develop-tag.outputs.tag-options }}
11899
119100
push-app-img:
120101
name: "Rebase & Publish App Image"

0 commit comments

Comments
 (0)