Skip to content

Commit f3e6581

Browse files
authored
Merge pull request #11647 from IQSS/develop
Merge the “develop” branch into “master” for 6.7 Release
2 parents c8fab55 + 23d47a3 commit f3e6581

File tree

390 files changed

+17789
-4463
lines changed

Some content is hidden

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

390 files changed

+17789
-4463
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/codeql.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "develop", "master" ]
17+
pull_request:
18+
branches: [ "develop", "master" ]
19+
schedule:
20+
- cron: '30 6 * * 4'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
39+
actions: read
40+
contents: read
41+
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
include:
46+
- language: actions
47+
build-mode: none
48+
- language: java-kotlin
49+
build-mode: none # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too.
50+
- language: javascript-typescript
51+
build-mode: none
52+
- language: python
53+
build-mode: none
54+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
55+
# Use `c-cpp` to analyze code written in C, C++ or both
56+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
57+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
58+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
59+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
60+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
61+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
62+
steps:
63+
- name: Checkout repository
64+
uses: actions/checkout@v4
65+
66+
# Add any setup steps before running the `github/codeql-action/init` action.
67+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
68+
# or others). This is typically only required for manual builds.
69+
# - name: Setup runtime (example)
70+
# uses: actions/setup-example@v1
71+
72+
# Initializes the CodeQL tools for scanning.
73+
- name: Initialize CodeQL
74+
uses: github/codeql-action/init@v3
75+
with:
76+
languages: ${{ matrix.language }}
77+
build-mode: ${{ matrix.build-mode }}
78+
# If you wish to specify custom queries, you can do so here or in a config file.
79+
# By default, queries listed here will override any specified in a config file.
80+
# Prefix the list here with "+" to use these queries and those in the config file.
81+
82+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
83+
# queries: security-extended,security-and-quality
84+
85+
# If the analyze step fails for one of the languages you are analyzing with
86+
# "We were unable to automatically build your code", modify the matrix above
87+
# to set the build mode to "manual" for that language. Then modify this step
88+
# to build your code.
89+
# ℹ️ Command-line programs to run using the OS shell.
90+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
91+
- if: matrix.build-mode == 'manual'
92+
shell: bash
93+
run: |
94+
echo 'If you are using a "manual" build mode for one or more of the' \
95+
'languages you are analyzing, replace this with the commands to build' \
96+
'your code, for example:'
97+
echo ' make bootstrap'
98+
echo ' make release'
99+
exit 1
100+
101+
- name: Perform CodeQL Analysis
102+
uses: github/codeql-action/analyze@v3
103+
with:
104+
category: "/language:${{matrix.language}}"

.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: 12 additions & 31 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' }}
56-
uses: webfactory/ssh-agent@v0.9.0
53+
uses: webfactory/ssh-agent@v0.9.1
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)