Skip to content

Commit

Permalink
Add java 21. (#649)
Browse files Browse the repository at this point in the history
* Add java 21.

* [BOT] Set version for this branch

---------

Co-authored-by: julien bignon <[email protected]>
Co-authored-by: GitHub Action Bot <[email protected]>
  • Loading branch information
3 people authored Aug 19, 2024
1 parent 9f99f67 commit d1adc7e
Show file tree
Hide file tree
Showing 9 changed files with 185 additions and 3 deletions.
21 changes: 21 additions & 0 deletions technologies/job/java-scala/java-scala-21/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM openjdk:21-slim-bookworm

ENV HADOOP_CONF_DIR=/etc/hadoop/conf

ENV DEBIAN_FRONTEND noninteractive

# LIGHT DEPENDENCIES START
RUN apt update -qq && apt install -yqq --no-install-recommends \
ftp wget curl unzip telnet openssh-client krb5-user && \
rm -rf /var/lib/apt/lists/*
# LIGHT DEPENDENCIES END

ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib/hadoop/lib/native"

# Move scripts and frequently changing directive to the end of the build
COPY entrypoint /entrypoint
RUN chmod 755 /entrypoint

WORKDIR /sandbox

ENTRYPOINT ["bash","/entrypoint"]
22 changes: 22 additions & 0 deletions technologies/job/java-scala/java-scala-21/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2019-2021.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import com.bmuschko.gradle.docker.DockerRemoteApiPlugin
import com.saagie.technologies.SaagieTechnologiesGradlePlugin

apply<DockerRemoteApiPlugin>()
apply<SaagieTechnologiesGradlePlugin>()
1 change: 1 addition & 0 deletions technologies/job/java-scala/java-scala-21/buildMe
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
true
19 changes: 19 additions & 0 deletions technologies/job/java-scala/java-scala-21/context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
id: "21"
label: "21"
available: true
recommended: true
trustLevel: stable
job:
features:
- type: COMMAND_LINE
label: Command line
mandatory: true
comment: Linux shell command to launch the job.
defaultValue: java -jar {file} arg1 arg2
- type: ARTIFACT
label: Package
mandatory: true
comment: "Compatible upload file : .jar"
- type: SCHEDULER
label: Scheduled
mandatory: true
4 changes: 4 additions & 0 deletions technologies/job/java-scala/java-scala-21/dockerInfo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
image: saagie/java-scala
baseTag: 21
dynamicVersion: 1.185.0_java-21
version: 21-1.185.0_java-21
9 changes: 9 additions & 0 deletions technologies/job/java-scala/java-scala-21/entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -euo pipefail


if test -f main_script;
then sh ./main_script;
else exec "$@"
fi;
83 changes: 83 additions & 0 deletions technologies/job/java-scala/java-scala-21/image_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
schemaVersion: "2.0.0"

metadataTest:
env:
- key: LANG
value: "C.UTF-8"
- key: JAVA_HOME
value: "/usr/local/openjdk-21"
- key: "HADOOP_CONF_DIR"
value: "/etc/hadoop/conf"

fileExistenceTests:
- name: "entrypoint"
path: "/entrypoint"
shouldExist: true
permissions: "-rwxr-xr-x"
- name: "kinit"
path: "/usr/bin/kinit"
shouldExist: true
permissions: "-rwxr-xr-x"

fileContentTests:
- name: "entrypoint"
path: "/entrypoint"
expectedContents: ["sh ./main_script"]

commandTests:
- name: "ftp"
args: ["-h"]
command: "ftp"
expectedError: ["ftp: invalid option -- 'h'"]
exitCode: 1

- name: "wget"
args: ["--help"]
command: "wget"
exitCode: 0

- name: "curl"
args: ["--help"]
command: "curl"
exitCode: 0

- name: "unzip"
args: ["--help"]
command: "unzip"
exitCode: 0

- name: "tar"
args: ["--help"]
command: "tar"
exitCode: 0

- name: "telnet"
command: "which"
args: ["telnet"]
expectedOutput: ["/usr/bin/telnet"]
exitCode: 0

- name: "scp"
command: "which"
args: ["scp"]
expectedOutput: ["/usr/bin/scp"]
exitCode: 0

- name: "java installation"
command: "which"
args: ["java"]
expectedOutput: ["/usr/local/openjdk-21/bin/java"]

- name: "java version"
command: "java"
args: ["-version"]
expectedError: ['openjdk version "21']

- name: "krb5-user installation"
command: "kinit"
expectedError: ['kinit: Configuration file does not specify default realm when parsing name root']
exitCode: 1

- name: "Workdir"
command: "pwd"
expectedOutput: ["/sandbox"]
25 changes: 24 additions & 1 deletion technologies/job/java-scala/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,27 @@ contexts:
dockerInfo:
image: "saagie/java-scala"
baseTag: "17"
version: "17-1.132.0"
version: "17-1.132.0"
- id: "21"
label: "21"
available: true
recommended: true
trustLevel: stable
job:
features:
- type: COMMAND_LINE
label: Command line
mandatory: true
comment: Linux shell command to launch the job.
defaultValue: java -jar {file} arg1 arg2
- type: ARTIFACT
label: Package
mandatory: true
comment: "Compatible upload file : .jar"
- type: SCHEDULER
label: Scheduled
mandatory: true
dockerInfo:
image: "saagie/java-scala"
baseTag: "21"
version: "21-1.185.0_java-21"
4 changes: 2 additions & 2 deletions version.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version.buildmeta=
version.buildmeta=java-21
version.major=1
version.minor=185
version.patch=0
version.prerelease=
version.semver=1.185.0
version.semver=1.185.0+java-21

0 comments on commit d1adc7e

Please sign in to comment.