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

POC: GraalVM CI images #34

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
24 changes: 24 additions & 0 deletions jdk/graal21-ubuntu24/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Dockerizing a graal21 images with:
#
# - Graal VM 21
#
# build : docker build -t exoplatform/ci:graal21-ubuntu24 .
#
FROM exoplatform/ci:base-ubuntu24
LABEL MAINTAINER "eXo Platform <[email protected]>"

ENV TERM xterm

ENV JDK_MAJOR_VERSION 21

# Install OpenJDK Java 21 SDK
RUN apt-get -qq update && \
apt-get -qq -y install gnupg ca-certificates curl

RUN mkdir -p /usr/lib/jvm/graalvm${JDK_MAJOR_VERSION}
RUN curl -fsSL https://download.oracle.com/graalvm/${JDK_MAJOR_VERSION}/latest/graalvm-jdk-${JDK_MAJOR_VERSION}_linux-x64_bin.tar.gz \
| tar xzf - -C /usr/lib/jvm/graalvm${JDK_MAJOR_VERSION} --strip-components=1


ENV JAVA_HOME /usr/lib/jvm/graalvm${JDK_MAJOR_VERSION}
ENV PATH="${PATH}:${JAVA_HOME}/bin"
15 changes: 15 additions & 0 deletions jdk/graal21-ubuntu24/tests/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
file:
/usr/lib/jvm:
title: Validating the presence of JVM directory
exists: true
package:
git:
installed: true
title: Check that git is installed
command:
java -version:
exit-status: 0
stdout: []
stderr:
- graal version "21
timeout: 0
6 changes: 6 additions & 0 deletions jdk/graal21-ubuntu24/tests/test_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

i=0
time dgoss run -it exoplatform/ci:graal21-ubuntu24 /bin/cat || ((i++))

exit $i
46 changes: 46 additions & 0 deletions maven/graal21-maven39-ubuntu24/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Dockerizing a graal21-maven39-ubuntu24 images with:
# - ubuntu24
# - Graal VM 21
# - Maven 3.9
#
# build : docker build -t exoplatform/ci:graal21-maven39-ubuntu24 .
#
FROM exoplatform/ci:graal21-ubuntu24
LABEL MAINTAINER "eXo Platform <[email protected]>"

# CI Tools version
ENV MAVEN_VERSION 3.9.6
# Install Maven
RUN mkdir -p /usr/share/maven \
&& curl -fsSL http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz \
| tar xzf - -C /usr/share/maven --strip-components=1 \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

# Workaround to be able to execute others command than "mvn" as entrypoint
COPY docker-entrypoint.sh /usr/bin/docker-entrypoint
RUN chown ${EXO_CI_USER}:${EXO_GROUP} /usr/bin/docker-entrypoint \
&& chmod u+x /usr/bin/docker-entrypoint

USER ${EXO_CI_USER}

RUN mkdir -p ${HOME}/.web3j/solc
COPY releases.json ${HOME}/.web3j/solc/
RUN chown ${EXO_CI_USER}:${EXO_GROUP} ${HOME}/.web3j

# Custom configuration for Maven
ENV M2_HOME=/usr/share/maven
ENV MAVEN_OPTS="-Dmaven.repo.local=${HOME}/.m2/repository -Xms1G -Xmx2G -XX:MaxMetaspaceSize=1G -Dcom.sun.media.jai.disableMediaLib=true -Djava.io.tmpdir=${EXO_CI_TMP_DIR} -Dmaven.artifact.threads=10 -Djava.awt.headless=true --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.util.regex=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED"
ENV PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH

# Create needed directories for Maven & git
RUN mkdir -p ${HOME}/.m2/repository \
&& mkdir -p ${HOME}/.ssh \
&& mkdir -p ${HOME}/.gnupg \
&& chmod 700 ${HOME}/.gnupg

WORKDIR ${EXO_CI_DATA_DIR}

# Workaround to be able to execute others command than "mvn" as entrypoint
ENTRYPOINT ["/usr/bin/docker-entrypoint"]

CMD ["mvn", "--help"]
9 changes: 9 additions & 0 deletions maven/graal21-maven39-ubuntu24/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

# Hack for Jenkins Pipeline: authorize cat without absolute path
if [[ "$1" == "/"* ]] || [[ "$1" == "cat" ]]; then
exec "$@"
fi

exec mvn "$@"
Loading