Skip to content

Commit

Permalink
Add Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Sep 23, 2023
1 parent f2b272e commit d8bae60
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
default_image: true
- jdk_version: java20
default_image: false
- jdk_version: java21
default_image: false
timeout-minutes: 45
steps:
- uses: actions/checkout@v2
Expand All @@ -33,7 +35,9 @@ jobs:
. ./settings.sh
./bin/test-base.sh
./bin/test-native.sh
./bin/test-polyglot.sh
if [ "${JDK_VERSION}" != "java21" ]; then
./bin/test-polyglot.sh
fi
env:
JDK_VERSION: ${{ matrix.jdk_version }}
DEFAULT_IMAGE: ${{ matrix.default_image }}
Expand Down
36 changes: 25 additions & 11 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,37 @@ docker build \
--tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-native" \
.

docker build \
--file Dockerfile.polyglot \
--build-arg "GRAAL_VERSION=${GRAAL_VERSION}" \
--build-arg "JDK_VERSION=${JDK_VERSION}" \
--cache-from "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-polyglot" \
--tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-polyglot" \
.
# Polyglot image depends on `gu` which is removed from Java21. While it's possible
# to provide equivalent functionality (e.g. `pyenv install graalpy-community-23.1.0`
# for Python), it not necessarily makes sense (bigger image). For now, don't build
# polyglot.
if [ "${JDK_VERSION}" != "java21" ]; then
docker build \
--file Dockerfile.polyglot \
--build-arg "GRAAL_VERSION=${GRAAL_VERSION}" \
--build-arg "JDK_VERSION=${JDK_VERSION}" \
--cache-from "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-polyglot" \
--tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-polyglot" \
.
fi

docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}" "${IMAGE_NAME}:${JDK_VERSION}"
docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-native" "${IMAGE_NAME}:${JDK_VERSION}-native"
docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-polyglot" "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-all"
docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-polyglot" "${IMAGE_NAME}:${JDK_VERSION}-polyglot"
docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-polyglot" "${IMAGE_NAME}:${JDK_VERSION}-all"

if [ "${JDK_VERSION}" != "java21" ]; then
docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-polyglot" "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-all"
docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-polyglot" "${IMAGE_NAME}:${JDK_VERSION}-polyglot"
docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-polyglot" "${IMAGE_NAME}:${JDK_VERSION}-all"
else
docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-native" "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-all"
docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-native" "${IMAGE_NAME}:${JDK_VERSION}-all"
fi

if [ "${DEFAULT_IMAGE}" = "true" ]; then
docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}" "${IMAGE_NAME}:latest"
docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-native" "${IMAGE_NAME}:native"
docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-polyglot" "${IMAGE_NAME}:polyglot"
if [ "${JDK_VERSION}" != "java21" ]; then
docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-polyglot" "${IMAGE_NAME}:polyglot"
fi
docker tag "${IMAGE_NAME}:${GRAAL_VERSION}-${JDK_VERSION}-all" "${IMAGE_NAME}:all"
fi
2 changes: 2 additions & 0 deletions settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ if [ "${JDK_VERSION}" = "java17" ]; then
GRAAL_JDK_VERSION="17.0.8"
elif [ "${JDK_VERSION}" = "java20" ]; then
GRAAL_JDK_VERSION="20.0.2"
elif [ "${JDK_VERSION}" = "java21" ]; then
GRAAL_JDK_VERSION="21.0.0"
else
echo "Unknown JDK_VERSION ${JDK_VERSION}" >&2
exit 1
Expand Down

0 comments on commit d8bae60

Please sign in to comment.