Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add java 21. #649

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading