Skip to content

Commit 27e60ef

Browse files
committed
Merge branch 'develop' into 9331-extract-bounding-box2 #9331
2 parents f5be4a8 + 90d76e9 commit 27e60ef

48 files changed

Lines changed: 1265 additions & 513 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
name: Application Container Image
3+
4+
on:
5+
# We are deliberately *not* running on push events here to avoid double runs.
6+
# Instead, push events will trigger from the base image and maven unit tests via workflow_call.
7+
workflow_call:
8+
pull_request:
9+
branches:
10+
- develop
11+
- master
12+
paths:
13+
- 'src/main/docker/**'
14+
- '.github/workflows/container_app_push.yml'
15+
16+
env:
17+
IMAGE_TAG: unstable
18+
BASE_IMAGE_TAG: unstable
19+
REGISTRY: "" # Empty means default to Docker Hub
20+
PLATFORMS: "linux/amd64,linux/arm64"
21+
22+
jobs:
23+
build:
24+
name: Build & deploy
25+
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
packages: write
29+
pull-requests: write
30+
# Only run in upstream repo - avoid unnecessary runs in forks
31+
if: ${{ github.repository_owner == 'IQSS' }}
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v3
36+
37+
- name: Set up JDK 11
38+
uses: actions/setup-java@v3
39+
with:
40+
java-version: "11"
41+
distribution: 'adopt'
42+
- name: Cache Maven packages
43+
uses: actions/cache@v3
44+
with:
45+
path: ~/.m2
46+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
47+
restore-keys: ${{ runner.os }}-m2
48+
49+
- name: Build app container image with local architecture
50+
run: mvn -Pct package
51+
52+
# Note: Accessing, pushing tags etc. to DockerHub or GHCR will only succeed in upstream because secrets.
53+
54+
# Run this when triggered via push or schedule as reused workflow from base / maven unit tests
55+
- if: ${{ github.event_name != 'pull_request' && github.ref_name == 'develop' }}
56+
name: Push description to DockerHub
57+
uses: peter-evans/dockerhub-description@v3
58+
with:
59+
username: ${{ secrets.DOCKERHUB_USERNAME }}
60+
password: ${{ secrets.DOCKERHUB_TOKEN }}
61+
repository: gdcc/dataverse
62+
short-description: "Dataverse Application Container Image providing the executable"
63+
readme-filepath: ./src/main/docker/README.md
64+
65+
- if: ${{ github.event_name != 'pull_request' }}
66+
name: Log in to Docker Hub registry
67+
uses: docker/login-action@v2
68+
with:
69+
username: ${{ secrets.DOCKERHUB_USERNAME }}
70+
password: ${{ secrets.DOCKERHUB_TOKEN }}
71+
- if: ${{ github.event_name == 'pull_request' }}
72+
name: Login to Github Container Registry
73+
uses: docker/login-action@v2
74+
with:
75+
registry: ghcr.io
76+
username: ${{ secrets.GHCR_USERNAME }}
77+
password: ${{ secrets.GHCR_TOKEN }}
78+
79+
- name: Set up QEMU for multi-arch builds
80+
uses: docker/setup-qemu-action@v2
81+
82+
- name: Re-set image tag based on branch (if master)
83+
if: ${{ github.ref_name == 'master' }}
84+
run: |
85+
echo "IMAGE_TAG=alpha" >> $GITHUB_ENV
86+
echo "BASE_IMAGE_TAG=alpha" >> $GITHUB_ENV
87+
- name: Re-set image tag and container registry when on PR
88+
if: ${{ github.event_name == 'pull_request' }}
89+
run: |
90+
echo "IMAGE_TAG=$(echo "$GITHUB_HEAD_REF" | tr '\\/_:&+,;#*' '-')" >> $GITHUB_ENV
91+
echo "REGISTRY='-Ddocker.registry=ghcr.io'" >> $GITHUB_ENV
92+
93+
- name: Deploy multi-arch application container image
94+
run: mvn -Pct deploy -Dapp.image.tag=${{ env.IMAGE_TAG }} -Dbase.image.tag=${{ env.BASE_IMAGE_TAG }} ${{ env.REGISTRY }} -Ddocker.platforms=${{ env.PLATFORMS }}
95+
96+
- uses: marocchino/sticky-pull-request-comment@v2
97+
if: ${{ github.event_name == 'pull_request' }}
98+
with:
99+
header: app-registry-push
100+
message: |
101+
Pushed preview application image as [`ghcr.io/gdcc/dataverse:${{ env.IMAGE_TAG }}`](https://github.com/orgs/gdcc/packages/container/package/dataverse).
102+
Use it by referencing it with its full name as printed above.

.github/workflows/container_base_push.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Container Base Module
2+
name: Base Container Image
33

44
on:
55
push:
@@ -18,9 +18,12 @@ on:
1818
- 'modules/container-base/**'
1919
- 'modules/dataverse-parent/pom.xml'
2020
- '.github/workflows/container_base_push.yml'
21+
schedule:
22+
- cron: '23 3 * * 0' # Run for 'develop' every Sunday at 03:23 UTC
2123

2224
env:
2325
IMAGE_TAG: unstable
26+
PLATFORMS: linux/amd64,linux/arm64
2427

2528
jobs:
2629
build:
@@ -79,7 +82,18 @@ jobs:
7982
uses: docker/setup-qemu-action@v2
8083
- name: Re-set image tag based on branch
8184
if: ${{ github.ref_name == 'master' }}
82-
run: echo "IMAGE_TAG=stable"
85+
run: echo "IMAGE_TAG=alpha" >> $GITHUB_ENV
8386
- if: ${{ github.event_name != 'pull_request' }}
8487
name: Deploy multi-arch base container image to Docker Hub
85-
run: mvn -f modules/container-base -Pct deploy -Dbase.image.tag=${{ env.IMAGE_TAG }}
88+
run: mvn -f modules/container-base -Pct deploy -Dbase.image.tag=${{ env.IMAGE_TAG }} -Ddocker.platforms=${{ env.PLATFORMS }}
89+
push-app-img:
90+
name: "Rebase & Publish App Image"
91+
permissions:
92+
contents: read
93+
packages: write
94+
pull-requests: write
95+
needs: build
96+
# We do not release a new base image for pull requests, so do not trigger.
97+
if: ${{ github.event_name != 'pull_request' }}
98+
uses: ./.github/workflows/container_app_push.yml
99+
secrets: inherit

.github/workflows/maven_unit_test.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,13 @@ jobs:
5151
env:
5252
CI_NAME: github
5353
COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }}
54-
run: mvn -V -B jacoco:report coveralls:report -DrepoToken=${COVERALLS_SECRET} -DpullRequest=${{ github.event.number }}
54+
run: mvn -V -B jacoco:report coveralls:report -DrepoToken=${COVERALLS_SECRET} -DpullRequest=${{ github.event.number }}
55+
push-app-img:
56+
name: Publish App Image
57+
permissions:
58+
contents: read
59+
packages: write
60+
pull-requests: write
61+
needs: unittest
62+
uses: ./.github/workflows/container_app_push.yml
63+
secrets: inherit
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
A date column has been added to the restricted file access request overview, indicating when the earliest request by that user was made.
2+
3+
An issue was fixed where where the request list was not updated when a request was approved or rejected.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
It is now possible to write external vocabulary scripts that target a single child field in a metadata block. Example scripts are now available at https://github.com/gdcc/dataverse-external-vocab-support that can be configured to support lookup from the Research Orgnaization Registry (ROR) for the Author Affiliation Field and for the CrossRef Funding Registry (Fundreg) in the Funding Information/Agency field, both in the standard Citation metadata block. Application if these scripts to other fields, and the development of other scripts targetting child fields are now possible.

doc/sphinx-guides/source/container/base-image.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ upstream branches:
3131

3232
- The ``unstable`` tag corresponds to the ``develop`` branch, where pull requests are merged.
3333
(`Dockerfile <https://github.com/IQSS/dataverse/tree/develop/modules/container-base/src/main/docker/Dockerfile>`__)
34-
- The ``stable`` tag corresponds to the ``master`` branch, where releases are cut from.
34+
- The ``alpha`` tag corresponds to the ``master`` branch, where releases are cut from.
3535
(`Dockerfile <https://github.com/IQSS/dataverse/tree/master/modules/container-base/src/main/docker/Dockerfile>`__)
3636

3737

@@ -108,13 +108,19 @@ AMD64 (Windows/Linux/...) and ARM64 (Apple M1/M2), by using `Maven Docker Plugin
108108
Building the image via ``mvn -Pct package`` or ``mvn -Pct install`` as above will only build for the architecture of
109109
the Docker machine's CPU.
110110

111-
Only ``mvn -Pct deploy`` will trigger building on all enabled architectures.
112-
Yet, to enable building with non-native code on your build machine, you will need to setup a cross-platform builder.
111+
Only ``mvn -Pct deploy`` will trigger building on all enabled architectures (and will try to push the images to a
112+
registry, which is Docker Hub by default).
113+
114+
You can specify which architectures you would like to build for and include by them as a comma separated list:
115+
``mvn -Pct deploy -Ddocker.platforms="linux/amd64,linux/arm64"``. The shown configuration is the default and may be omitted.
116+
117+
Yet, to enable building with non-native code on your build machine, you will need to setup a cross-platform builder!
113118

114119
On Linux, you should install `qemu-user-static <https://github.com/multiarch/qemu-user-static>`__ (preferably via
115120
your package management) on the host and run ``docker run --rm --privileged multiarch/qemu-user-static --reset -p yes``
116121
to enable that builder. The Docker plugin will setup everything else for you.
117122

123+
The upstream CI workflows publish images supporting AMD64 and ARM64 (see e.g. tag details on Docker Hub)
118124

119125
.. _base-tunables:
120126

modules/container-base/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ Adding basic functionality like executing scripts at container boot, monitoring,
77
at this layer. Application images building from this very base focus on adding deployable Dataverse code and
88
actual scripts.
99

10-
*Note:* Currently, there is no application image. Please watch https://github.com/IQSS/dataverse/issues/8934
10+
There is a community based [application image](https://hub.docker.com/r/gdcc/dataverse)
11+
([docs](https://guides.dataverse.org/en/latest/container/app-image.html)), but you may create your own or even reuse
12+
this image for other purposes than the Dataverse application.
1113

1214
## Quick Reference
1315

@@ -23,8 +25,8 @@ provides in-depth information about content, building, tuning and so on for this
2325
**Where to get help and ask questions:**
2426

2527
IQSS will not offer support on how to deploy or run it. Please reach out to the community for help on using it.
26-
You can join the Community Chat on Matrix at https://chat.dataverse.org or the Community Slack at
27-
https://dataversecommunity.slack.com to ask for help and guidance.
28+
You can join the Community Chat on Matrix at https://chat.dataverse.org and https://groups.google.com/g/dataverse-community
29+
to ask for help and guidance.
2830

2931
## Supported Image Tags
3032

@@ -34,7 +36,7 @@ happens there (again, by the community). Community-supported image tags are base
3436

3537
- The `unstable` tag corresponds to the `develop` branch, where pull requests are merged.
3638
([`Dockerfile`](https://github.com/IQSS/dataverse/tree/develop/modules/container-base/src/main/docker/Dockerfile))
37-
- The `stable` tag corresponds to the `master` branch, where releases are cut from.
39+
- The `alpha` tag corresponds to the `master` branch, where releases are cut from.
3840
([`Dockerfile`](https://github.com/IQSS/dataverse/tree/master/modules/container-base/src/main/docker/Dockerfile))
3941

4042
Within the main repository, you may find the base image files at `<git root>/modules/container-base`.

modules/container-base/pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<java.image>eclipse-temurin:${target.java.version}-jre</java.image>
4545
<base.image.uid>1000</base.image.uid>
4646
<base.image.gid>1000</base.image.gid>
47+
<docker.platforms>linux/amd64,linux/arm64</docker.platforms>
4748
</properties>
4849

4950
<build>
@@ -94,8 +95,8 @@
9495
<build>
9596
<buildx>
9697
<platforms>
97-
<platform>linux/arm64</platform>
98-
<platform>linux/amd64</platform>
98+
<!-- Will be empty by default, deactivating buildx -->
99+
<platform>${docker.platforms}</platform>
99100
</platforms>
100101
<dockerStateDir>${project.build.directory}/buildx-state</dockerStateDir>
101102
</buildx>

modules/container-base/src/main/docker/scripts/init_1_generate_deploy_commands.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@ find "$DEPLOY_DIR" -mindepth 1 -maxdepth 1 -name "*.rar" -print0 \
6161
| while IFS= read -r -d '' file; do deploy "$file"; done
6262

6363
# Then every other WAR, EAR, JAR or directory
64-
find "$DEPLOY_DIR" -mindepth 1 -maxdepth 1 ! -name "*.rar" -a -name "*.war" -o -name "*.ear" -o -name "*.jar" -o -type d -print0 \
65-
| while IFS= read -r -d '' file; do deploy "$file"; done
64+
find "$DEPLOY_DIR" -mindepth 1 -maxdepth 1 \
65+
\( ! -name "*.rar" -a -name "*.war" -o -name "*.ear" -o -name "*.jar" -o -type d \) \
66+
-print0 | while IFS= read -r -d '' file; do deploy "$file"; done

modules/dataverse-parent/pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
<maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
190190

191191
<!-- Container related -->
192-
<fabric8-dmp.version>0.42.0</fabric8-dmp.version>
192+
<fabric8-dmp.version>0.42.1</fabric8-dmp.version>
193193
</properties>
194194

195195
<pluginRepositories>
@@ -345,8 +345,9 @@
345345
<!--
346346
Payara 5.2022.3 has problems with postboot deployment scripts.
347347
Fixed in this release, see https://github.com/payara/Payara/pull/5991
348+
Payara 5.2022.4 has security issues.
348349
-->
349-
<payara.version>5.2022.4</payara.version>
350+
<payara.version>5.2022.5</payara.version>
350351
</properties>
351352

352353
<build>

0 commit comments

Comments
 (0)