Closed jurriaan closed 1 year ago
As I noted in the PR that added the images (#245), the latest (8.1.1) release notes say
Gradle now supports using Java 20 for compiling, testing, and starting other Java programs. This can be accomplished by configuring your build or task to use a Java 20 toolchain.
You cannot currently run Gradle on Java 20 because Kotlin lacks support for JDK 20. However, you can expect support for running Gradle with Java 20 in a future version.
They also note this in their compatibility guide. This is why I have not yet published the Java 20 images to Docker Hub.
So In order to compile targeting Java 20, you'd need a Docker image with both Java 8, 11, or 17 and Java 20. This Docker image hasn't ever published images with multiple versions of Java on it. My hope was that full Java 20 support was coming soon, but it sounds like it might not be until 8.2 (July). See the issue here. You can also follow the Kotlin issue issue. I'm not sure which Scala issue(s) are relevant yet. I'ts possibly scala/scala/pull/10359 and scala/scala/pull/10184. They mention Java 20 support in their 2.13.11 release planning here.
Ah, sorry! Thanks for the info!
No problem! If Java 20 is something folks need, we can open another ticket to figure out how to do a dual or multi JDK image. Offhand, it seems like I'd have to copy (with some small edits) what the Temurin folks have.
I think a 17-based image that has 20 also installed for use with a toolchain actually isn't as complicated to do as I originally thought (once the idea of a multi-stage image occurred to me). #248 If there's interest, let me know.
@keeganwitt the jdk20 images are still missing and my CI for SirixDB currently fails, because I forgot to check if the images are there before merging my PR (and missed to update the Dockerfile of course). There were however jdk19 images... so I'd imagine supporting jdk20 should be a no brainer? :-)
They're not published into Docker Hub yet because
I was trying to avoid merging #248 since it's another image to maintain and Gradle 8.3 wasn't far off. But if there are folks that really need it, I can. Just let me know.
To clarify what's needed for Java 20 with Gradle 8.1/8.2: You have to start Gradle with Java 11/17, then use Java 20 in a toolchain to target Java 20 bytecode. That's what the image in #248 was about: an image that ships multiple JDKs.
Hmm, wasn't aware of this, but the gradle wrapper with Gradle 8.2.1 seems to work with Java 20... but have only tried with IntelliJ so far and executing the unit tests / integration tests.
This is the Dockerfile: https://github.com/sirixdb/sirix/blob/master/Dockerfile
I'd also go with a GraalVM based image as in tests the new version for Java 20 was really way faster in one test with a huge import file (meaning 60s instead of roughly 100s to import a close to 4Gb JSON file). Still, with async flushes to disk in the future it should be faster, but at least we managed to import also with only 8Gb RAM on one machine, whereas with MongoDB it doesn't seem possible to import at all.
Hmm, wasn't aware of this, but the gradle wrapper with Gradle 8.2.1 seems to work with Java 20... but have only tried with IntelliJ so far and executing the unit tests / integration tests.
I've heard similar anecdotes, though I can't speak to it from personal experience. As an official image, my policy has to follow the official recommendations/statements from the Gradle team themselves. If I were to publish the Java 20 image that I have in this repo, it'd have to be to an unofficial location in Docker Hub. They exist here mostly so I'm ready to rock and roll when 8.3 gets released.
This is the Dockerfile: https://github.com/sirixdb/sirix/blob/master/Dockerfile
Also keep in mind, Java 19 is EOL, which is why this project is no longer publishing updates to those images.
I'd also go with a GraalVM based image as in tests the new version for Java 20 was really way faster in one test with a huge import file (meaning 60s instead of roughly 100s to import a close to 4Gb JSON file). Still, with async flushes to disk in the future it should be faster, but at least we managed to import also with only 8Gb RAM on one machine, whereas with MongoDB it doesn't seem possible to import at all.
Once https://github.com/docker-library/official-images/pull/15214 is merged, GraalVM Gradle images should be in a usable state.
Is it GraalVM for Java 20 and Gradle 8.2.1? The GraalVM images as of now don't seem to have a Java version in the tag name IIRC. All in all it seems I have to wait for Gradle 8.3 (luckily it's a spare time project since the last 10 years ;-))
Is it GraalVM for Java 20 and Gradle 8.2.1? The GraalVM images as of now don't seem to have a Java version in the tag name IIRC. All in all it seems I have to wait for Gradle 8.3 (luckily it's a spare time project since the last 10 years ;-))
No. There are no Java 20 images of any kind yet because Gradle doesn't support it until 8.3. The only other option is the dual-JDK of #248. If that's a solution that's appealing to you, lemme know and I'll work on merging and publishing it.
I don't know if that means I'd have to change other parts of the Dockerfile
in SirixDB. Maybe not, but otherwise I'd leave it for now, as I yesterday started a new job as an embedded software engineer, meaning I will not have much time to work on Sirix right now...
I don't know if that means I'd have to change other parts of the
Dockerfile
in SirixDB. Maybe not, but otherwise I'd leave it for now, as I yesterday started a new job as an embedded software engineer, meaning I will not have much time to work on Sirix right now...
The Dockerfile no, but the Gradle files yes (for some users). It looks like you have that change already though. See here.
8.3 just got released this morning!
https://docs.gradle.org/8.3/release-notes.html#full-support-for-java-20
Yay, do you push the images?
Yay, do you push the images?
https://github.com/docker-library/official-images/pull/15221
I've updated the Dockerfile, but I guess it needs some time until they are on docker.io
I've updated the Dockerfile, but I guess it needs some time until they are on docker.io
They haven't merged my PR yet that will kick off the build and push.
The jdk20 images are missing on dockerhub, can they be released?