Skip to content
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0ba78bf
Bump cekit/actions-setup-cekit to v1.1.7
jmtd Mar 5, 2025
db72341
Merge pull request #567 from jmtd/gendocs-bump-cekit-action
jmtd Mar 5, 2025
e93fe56
Bump container version for next release
jmtd Mar 25, 2025
0f73dfe
Merge pull request #573 from jmtd/b1.22
jmtd Mar 25, 2025
4ef9f02
[OPENJDK-3696] Remove JDK11 modules/descriptors
jmtd Apr 11, 2025
d72c2cd
Merge pull request #576 from jmtd/OPENJDK-3696-rm-jdk11
jmtd Apr 28, 2025
18ee5a6
[OPENJDK-3655] test for files with u+x and not o+x
jmtd Apr 11, 2025
20a5342
[OPENJDK-3655] change script permissions to permit o+x
jmtd Apr 11, 2025
a8f82bf
Merge pull request #583 from jmtd/OPENJDK-3655-scriptperms-alt
jmtd May 1, 2025
8492d7c
[OPENJDK-3142] Maven 3.9.9
jmtd Feb 20, 2025
fae7b37
Bump versions for next release
jmtd May 19, 2025
73e8c60
Merge pull request #588 from jmtd/ubi9-v1.23
jmtd Jun 3, 2025
64575a6
Merge pull request #557 from jmtd/3142-maven-3.9.9
jmtd Jun 3, 2025
6bb2140
[OPENJDK-3935] Fix script permissions for artifacts
jmtd Jul 4, 2025
c7f38c1
[OPENJDK-3935] tests for specific script permissions
jmtd Jul 4, 2025
6cc4abb
Merge pull request #592 from jmtd/OPENJDK-3935-artifact-permissions
jmtd Jul 15, 2025
ad2f2d6
[OPENJDK-4003] label images with opencontainers 'source' label
jmtd Jul 23, 2025
2011eaa
Revert "[OPENJDK-3655] change script permissions to permit o+x"
jmtd Jul 31, 2025
36cbe4a
[OPENJDK-3655] alternative fix for script permissions
jmtd Jul 31, 2025
50cd494
Merge pull request #595 from jmtd/OPENJDK-4008-revert-artifacts
jmtd Aug 4, 2025
10cd5e0
[OPENJDK-3975] tests for custom configuration and data
jmtd Jul 15, 2025
e2f1d59
[OPENJDK-3975] refactor rsync calls into common function
jmtd Jul 15, 2025
b27c895
Add org.opencontainers.image.revision
jmtd Aug 5, 2025
9151fdf
Merge pull request #476 from jmtd/opencontainers-source
jmtd Aug 5, 2025
c664d52
Merge pull request #593 from jmtd/OPENJDK-3975-rsync-data-configuration
jmtd Aug 5, 2025
9bfedfe
[OPENJDK-4024] adjust permissions on jboss-settings.xml
jmtd Aug 27, 2025
88fe6a2
Add an action to label/unlabel PRs with JIRA URIs
jmtd Aug 28, 2025
8c47580
Merge pull request #601 from jmtd/OPENJDK-4024-permsonly
jmtd Sep 2, 2025
9303fe3
Merge pull request #599 from rh-openjdk/gha-label-issues-no-jira
jmtd Sep 3, 2025
2b0f7c4
Merge remote-tracking branch 'origin/ubi9' into ubi10
jmtd Sep 3, 2025
e8f75ea
update "org.opencontainers.image.revision" label
jmtd Sep 3, 2025
76fb69e
Adjust install line to reflect only one file
jmtd Sep 3, 2025
3bddd69
re-do of OPENJDK-3661/PR 555
jmtd Sep 3, 2025
d590976
Adjust test-tagging for ubi10
jmtd Sep 4, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/gendocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
fetch-depth: 0 # all branches and tags

- name: Install CEKit
uses: cekit/[email protected].5
uses: cekit/[email protected].7

- name: Setup required packages for docs
run: |
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/jiralabels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Ensure GH PRs have a corresponding JIRA issue

on:
pull_request:
types: [opened, edited]

permissions:
contents: read
pull-requests: write

env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUM: ${{ github.event.pull_request.number }}

jobs:
check-jira-uri:
runs-on: ubuntu-latest
steps:
- name: Check for required URI pattern
id: check_uri
env:
PR_BODY: ${{ github.event.pull_request.body }}
URIPAT: "https://issues.redhat.com/browse/OPENJDK-"
run: |
if echo "$PR_BODY" | grep -q "$URIPAT"; then
echo "missing=false" >> $GITHUB_OUTPUT
else
echo "missing=true" >> $GITHUB_OUTPUT
fi

- name: Apply label if URI missing
if: steps.check_uri.outputs.missing == 'true'
run: |
gh pr edit "$NUM" --add-label "needs-jira-issue"
exit 1 # fail workflow; must be resolved to green-light PR

- name: Remove label if URI present
if: steps.check_uri.outputs.missing == 'false'
run: gh pr edit "$NUM" --remove-label "needs-jira-issue"

label-branch:
runs-on: ubuntu-latest
steps:
- name: Add branch label if missing
run: gh pr edit "$NUM" --add-label "$GITHUB_BASE_REF"
8 changes: 1 addition & 7 deletions modules/jdk/21/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ set -e
SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jdk/*

pushd ${ARTIFACTS_DIR}
cp -pr * /
popd
install -m 0644 -D {${ARTIFACTS_DIR},}/opt/jboss/container/openjdk/jdk/jvm-options

# Update securerandom.source for quicker starts (must be done after removing jdk 8, or it will hit the wrong files)
JAVA_SECURITY_FILE=/usr/lib/jvm/java/conf/security/java.security
Expand Down
15 changes: 3 additions & 12 deletions modules/jre/21/configure.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
#!/bin/sh
# Configure module
set -e
#!/bin/bash
set -euo pipefail

SCRIPT_DIR=$(dirname $0)
echo $SCRIPT_DIR
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts
echo $ARTIFACTS_DIR

chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jre/*

pushd ${ARTIFACTS_DIR}
cp -pr * /
popd
install -m 0644 -D {${ARTIFACTS_DIR},}/opt/jboss/container/openjdk/jre/jvm-options
Empty file.
Empty file.
14 changes: 4 additions & 10 deletions modules/jvm/configure.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
#!/bin/sh
# Configure module
set -e
#!/bin/bash
set -euo pipefail

SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/java/jvm/*

pushd ${ARTIFACTS_DIR}
cp -pr * /
popd
install -D -t /opt/jboss/container/java/jvm \
${ARTIFACTS_DIR}/opt/jboss/container/java/jvm/*
3 changes: 3 additions & 0 deletions modules/jvm/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ description: ^
execute:
- script: configure.sh

execute:
- script: configure.sh

modules:
install:
- name: jboss.container.user
Expand Down
9 changes: 9 additions & 0 deletions modules/jvm/tests/features/files.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Feature: test file properties for JVM module

@ubi9
Scenario: Ensure image scripts are executable (OPENJDK-3935)
When container is started with args
| arg | value |
| command | find /opt/jboss/container/java/ -type f -printf "%h/%f %M\n" |
Then available container log should contain /opt/jboss/container/java/jvm/debug-options -rwxr-xr-x
And available container log should contain /opt/jboss/container/java/jvm/java-default-options -rwxr-xr-x
17 changes: 5 additions & 12 deletions modules/maven/default/configure.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
#!/bin/sh
# Configure module
set -e
#!/bin/bash
set -euo pipefail

SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

# configure artifact permissions
chown -R $USER:root $ARTIFACTS_DIR
chmod -R ug+rwX $ARTIFACTS_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/maven/default/maven.sh

# install artifacts
pushd ${ARTIFACTS_DIR}
cp -pr * /
popd
install -m 0644 -D {${ARTIFACTS_DIR},}/opt/jboss/container/maven/default/maven.sh
# 0664: OPENJDK-4024
install -m 0664 -D {${ARTIFACTS_DIR},}/opt/jboss/container/maven/default/jboss-settings.xml

# install default settings.xml file in user home
mkdir -p $HOME/.m2
Expand Down
2 changes: 1 addition & 1 deletion modules/maven/module/artifacts/maven.module
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[maven]
name=maven
stream=3.8
stream=3.9
profiles=
state=enabled
16 changes: 5 additions & 11 deletions modules/maven/s2i/configure.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#!/bin/sh
# Configure module
set -e
#!/bin/bash
set -euo pipefail

SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/maven/s2i/*
chmod ug+x ${ARTIFACTS_DIR}/usr/libexec/s2i/*

pushd ${ARTIFACTS_DIR}
cp -pr * /
popd
install -D {${ARTIFACTS_DIR},}/usr/libexec/s2i/save-artifacts
install -m 0644 -D -t /opt/jboss/container/maven/s2i \
${ARTIFACTS_DIR}/opt/jboss/container/maven/s2i/*
3 changes: 3 additions & 0 deletions modules/maven/s2i/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ modules:
- name: jboss.container.maven.default
- name: jboss.container.util.logging

execute:
- script: configure.sh

packages:
install:
- tar
10 changes: 10 additions & 0 deletions modules/maven/s2i/tests/features/files.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Feature: test file properties for Maven S2I module

# builder-only test
@ubi9/openjdk-17
@ubi9/openjdk-21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do those tags need an update? for @ubi10?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they do, thanks for catching!

Scenario: Ensure save-artifacts script is executable (OPENJDK-3935)
When container is started with args
| arg | value |
| command | find /usr/local/s2i -type f -printf "%f %M\n" |
Then available container log should contain save-artifacts -rwxr-xr-x
14 changes: 4 additions & 10 deletions modules/proxy/configure.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
#!/bin/sh
# Configure module
set -e
#!/bin/bash
set -euo pipefail

SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/java/proxy*

pushd ${ARTIFACTS_DIR}
cp -pr * /
popd
install -m 0644 -D -t /opt/jboss/container/java/proxy \
${ARTIFACTS_DIR}/opt/jboss/container/java/proxy/*
Empty file modified modules/run/artifacts/opt/jboss/container/java/run/run-java.sh
100644 → 100755
Empty file.
16 changes: 6 additions & 10 deletions modules/run/configure.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#!/bin/sh
# Configure module
set -e
#!/bin/bash
set -euo pipefail

SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/java/run/*

pushd ${ARTIFACTS_DIR}
cp -pr * /
popd
install -D {${ARTIFACTS_DIR},}/opt/jboss/container/java/run/run-java.sh

mkdir -p /deployments/data \
&& chmod -R "ug+rwX" /deployments/data \
Expand All @@ -29,3 +22,6 @@ else
javasecurity="${JAVA_HOME}/conf/security/java.security"
fi
sed -i 's/\(networkaddress.cache.negative.ttl\)=[0-9]\+$/\1=0/' "$javasecurity"

# OPENJDK-3695: force +x for scripts
chmod 0755 /opt/jboss/container/java/run/run-java.sh
5 changes: 5 additions & 0 deletions modules/run/tests/features/run.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ Feature: OpenJDK run script tests
| JAVA_OPTS_APPEND | -Djavax.net.ssl.trustStorePassword=sensitiveString |
Then container log should not contain sensitiveString

Scenario: Ensure image scripts are executable (OPENJDK-3935)
When container is started with args
| arg | value |
| command | find /opt/jboss/container/java/ -type f -printf "%h/%f %M\n" |
Then available container log should contain /opt/jboss/container/java/run/run-java.sh -rwxr-xr-x
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

source "${JBOSS_CONTAINER_UTIL_LOGGING_MODULE}/logging.sh"
source "${JBOSS_CONTAINER_S2I_CORE_MODULE}/s2i-core"

# inject our overridden maven_*() functions
function maven_s2i_source_maven_overrides() {
Expand Down Expand Up @@ -30,11 +31,7 @@ function maven_s2i_custom_binary_build() {
fi
log_info "Copying binaries from ${binary_dir} to ${S2I_TARGET_DEPLOYMENTS_DIR} ..."

( # OPENJDK-2850: use glob (dotglob to match hidden files) to stop rsync altering
# timestamps of S2I_TARGET_DEPLOYMENTS_DIR. Don't alter parent shell's dotglob.
shopt -s dotglob
rsync --archive --out-format='%n' "${binary_dir}"/* "${S2I_TARGET_DEPLOYMENTS_DIR}"
)
recursive_copy_files "${binary_dir}" "${S2I_TARGET_DEPLOYMENTS_DIR}"
}

function maven_s2i_deploy_artifacts_override() {
Expand Down
16 changes: 5 additions & 11 deletions modules/s2i/bash/configure.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#!/bin/sh
# Configure module
set -e
#!/bin/bash
set -euo pipefail

SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/java/s2i/*
chmod ug+x ${ARTIFACTS_DIR}/usr/libexec/s2i/*

pushd ${ARTIFACTS_DIR}
cp -pr * /
popd
install -D ${ARTIFACTS_DIR}/usr/libexec/s2i/* /usr/libexec/s2i
install -m 0644 -D -t /opt/jboss/container/java/s2i \
${ARTIFACTS_DIR}/opt/jboss/container/java/s2i/*
1 change: 1 addition & 0 deletions modules/s2i/bash/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ modules:
- name: jboss.container.maven.s2i
- name: jboss.container.java.run
- name: jboss.container.util.logging
- name: jboss.container.s2i.core

packages:
install:
Expand Down
12 changes: 12 additions & 0 deletions modules/s2i/bash/tests/features/files.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# builder-only test
@ubi9/openjdk-17
@ubi9/openjdk-21
Feature: OpenJDK S2I bash module tests

Scenario: Ensure image scripts are executable (OPENJDK-3935)
When container is started with args
| arg | value |
| command | find /usr/local/s2i/ -type f -printf "%h/%f %M\n" |
Then available container log should contain run -rwxr-xr-x
And available container log should contain assemble -rwxr-xr-x
And available container log should contain usage -rwxr-xr-x
18 changes: 16 additions & 2 deletions modules/s2i/core/artifacts/opt/jboss/container/s2i/core/s2i-core
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ function s2i_core_env_init_hook() {
:
}

# Copy files from a source path to a destination path
# Do not attempt to change metadata of the destination path, which we
# may not own
function recursive_copy_files() {
src="$1"
dst="$2"
( # OPENJDK-2850: use glob (dotglob to match hidden files) to stop rsync altering
# timestamps of $dst, which we might not own. Subshell to not alter parent shell's
# dotglob setting.
shopt -s dotglob
rsync --archive --out-format='%n' "${src}"/* "${dst}"
)
}

# copy configuration files
# $1 - the base directory to which $S2I_SOURCE_CONFIGURATION_DIR is appended
function s2i_core_copy_configuration() {
Expand All @@ -53,7 +67,7 @@ function s2i_core_copy_configuration() {
mkdir -pm 775 "${S2I_TARGET_CONFIGURATION_DIR}"
fi
log_info "Copying configuration from $(realpath --relative-to ${S2I_SOURCE_DIR} ${1}/${S2I_SOURCE_CONFIGURATION_DIR}) to ${S2I_TARGET_CONFIGURATION_DIR}..."
rsync --archive --out-format='%n' "${1}/${S2I_SOURCE_CONFIGURATION_DIR}"/ "${S2I_TARGET_CONFIGURATION_DIR}"
recursive_copy_files "${1}/${S2I_SOURCE_CONFIGURATION_DIR}" "${S2I_TARGET_CONFIGURATION_DIR}"
fi
fi
}
Expand All @@ -70,7 +84,7 @@ function s2i_core_copy_data() {
mkdir -pm 775 "${S2I_TARGET_DATA_DIR}"
fi
log_info "Copying app data from $(realpath --relative-to ${S2I_SOURCE_DIR} ${1}/${S2I_SOURCE_DATA_DIR}) to ${S2I_TARGET_DATA_DIR}..."
rsync --archive --out-format='%n' "${1}/${S2I_SOURCE_DATA_DIR}"/ "${S2I_TARGET_DATA_DIR}"
recursive_copy_files "${1}/${S2I_SOURCE_DATA_DIR}" "${S2I_TARGET_DATA_DIR}"
# s2i used to be more forgiving, but the build will fail if this call
# fails. emit a warning and allow the build to succeed
chmod -R g+rwX "${S2I_TARGET_DATA_DIR}" || log_warning "Errors occurred while adding read/write permissions to S2I_TARGET_DATA_DIR ($S2I_TARGET_DATA_DIR)."
Expand Down
9 changes: 3 additions & 6 deletions modules/s2i/core/configure.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#!/bin/sh
# Configure module
set -e
#!/bin/bash
set -euo pipefail

SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/s2i/core/*
install -m 0644 -D {${ARTIFACTS_DIR},}/opt/jboss/container/s2i/core/s2i-core

pushd ${ARTIFACTS_DIR}
cp -pr * /
Expand Down
18 changes: 18 additions & 0 deletions modules/s2i/core/tests/features/s2i-core.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,21 @@ Feature: Openshift S2I tests
Then s2i build log should not contain rsync: [generator] failed to set permissions on "/var/tmp/.": Operation not permitted
And s2i build log should contain appsrc-provided s2i assemble script executed
And run stat /var/tmp/spring-boot-sample-simple-1.5.0.BUILD-SNAPSHOT.jar in container and check its output for Access:

# as above, for OPENJDK-3975: handling configuration
Scenario: Ensure copying custom configuration doesn't fail trying to chmod destination directory (OPENJDK-3975)
Given s2i build https://github.com/rh-openjdk/openjdk-container-test-applications.git from OPENJDK-2408-bin-custom-s2i-assemble with env
| variable | value |
| S2I_TARGET_CONFIGURATION_DIR | /var/tmp |
Then s2i build log should not contain rsync: [generator] failed to set permissions on "/var/tmp/.": Operation not permitted
And s2i build log should contain appsrc-provided s2i assemble script executed
And run stat /var/tmp/example.ini in container and check its output for Access:

# as above, for OPENJDK-3975: handling data
Scenario: Ensure copying custom data doesn't fail trying to chmod destination directory (OPENJDK-3975)
Given s2i build https://github.com/rh-openjdk/openjdk-container-test-applications.git from OPENJDK-2408-bin-custom-s2i-assemble with env
| variable | value |
| S2I_TARGET_DATA_DIR | /var/tmp |
Then s2i build log should not contain rsync: [generator] failed to set permissions on "/var/tmp/.": Operation not permitted
And s2i build log should contain appsrc-provided s2i assemble script executed
And run stat /var/tmp/sample.txt in container and check its output for Access:
Loading
Loading