Repository navigation
Run TornadoVM from Maven Central; TORNADOVM_HOME becomes optional - #87
Merged
Merged
Conversation
TornadoVM 8.2.0 on Maven Central binds OpenCL, CUDA and Metal through java.lang.foreign, so its jars are a complete runtime on a stock JDK. Users no longer need to install the SDK or export TORNADOVM_HOME (launchctl on macOS) for dynamic inspection or for running Tornadify's kernels. - MavenTornado downloads tornado-runtime, tornado-matrices and the drivers with the IDE's resolver into the local Maven repository, in the -jdk21 or -jdk22plus build for the project JDK. - TornadoToolchain prepares it: a driver whose native library is missing fails TornadoVM as a whole, so each candidate backend (OpenCL and Metal on macOS, CUDA and OpenCL elsewhere) lists its devices first, and only those that start are passed in -Dtornado.enabled.backends. - TornadoRunner runs it with the project JDK's java (--enable-preview, --enable-native-access, -Dtornado.printKernel, TornadoDeviceQuery) and without TORNADOVM_HOME in the child environment. - TORNADOVM_HOME, when set, still selects that SDK and its tornado launcher. The startup warning and settings banner now appear only when it is set but is not an SDK; Run Dynamic Inspection is always enabled. - tornado-unittests.jar is no longer required; the suggested tornado-api version is 8.2.0. - README, plugin description and DEVELOPMENT.md describe the new setup. - TornadoToolchainTest uses ProgressIndicatorBase, so it no longer depends on another test having started the application.
A daily workflow (also run by hand) finds the newest TornadoVM release that every artifact the plugin downloads has on Maven Central, in both the -jdk21 and the -jdk22plus build. If it is newer than MavenTornado.RELEASE, it writes it there, in the README and in the plugin description (not the change notes), checks that the artifacts resolve, runs the tests and buildPlugin, and opens a pull request from bot/tornadovm-<release>. A release whose branch exists already is skipped. - .github/scripts/bump_tornadovm.py does the lookup and the rewrite; its tests run against a fake Maven repository on disk, here and in Build. - A manual run is a dry run by default; pretend_current makes it act as if the plugin downloaded an older release, to test the whole workflow. - The Java tests read MavenTornado.RELEASE instead of 8.2.0, so a bump does not break them.
TornadoVM comes from the SDK of TORNADOVM_HOME only when the variable points at a TornadoVM SDK (TornadoSdk.isUsed); when it points at something without the tornado-api jar, dynamic inspection and Tornadify use TornadoVM from Maven Central instead of stopping. The notification at project open, the settings banner and a new console line say so, and how to point the variable at an SDK or unset it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TornadoVM 8.2.0 on Maven Central binds OpenCL, CUDA and Metal through
java.lang.foreign, so its jars are a complete runtime on a stock JDK. With this change, users no longer need to install the TornadoVM SDK or setTORNADOVM_HOME(withlaunchctl setenvon macOS) for dynamic inspection or for running Tornadify's kernels.Run TornadoVM from Maven Central
MavenTornadofetchestornado-runtime,tornado-matricesand the drivers with the IDE's Maven resolver into~/.m2/repository, from the repositories in Remote Jar Repositories. It picks8.2.0-jdk21for JDK 21 and8.2.0-jdk22plusfor JDK 22 and newer.libcudais not found. SoTornadoToolchainfirst lists the devices of each candidate backend on its own: OpenCL and Metal on macOS, CUDA and OpenCL elsewhere. Only the backends that start go into-Dtornado.enabled.backends.TornadoRunneruses the project JDK'sjavawith--enable-preview,--enable-native-access=ALL-UNNAMEDand-Dtornado.printKernel=True, and lists devices withTornadoDeviceQuery.TORNADOVM_HOMEis removed from the child process's environment, so TornadoVM keeps its settings in~/.tornadovm.TORNADOVM_HOMEis now an override: when it points at a TornadoVM SDK, the plugin still uses that SDK and itstornadolauncher. When it is set but is not an SDK (notornado-apijar), the plugin uses Maven Central instead, and says so in a notification at project open, a banner in the settings and a line in the console. Run Dynamic Inspection is always enabled, and the settings page says which TornadoVM will run.tornado-unittests.jaris no longer required, and the suggestedtornado-apiversion is now 8.2.0.DEVELOPMENT.mddescribe the new setup; thelaunchctlinstructions now cover only using an SDK.TornadoToolchainTestusesProgressIndicatorBase. It used to fail when run on its own and passed only because of test order.Bump TornadoVM workflow
A daily workflow, also run by hand, finds the newest release that every downloaded artifact has on Maven Central in both builds. If it is newer than
MavenTornado.RELEASE, it:test buildPlugin,bot/tornadovm-<release>.A manual run is a dry run by default, and
pretend_current(e.g.8.1.0) tests the whole flow while there is no newer release. The script's tests use a fake Maven repository on disk and run in Build as well.After merging:
GITHUB_TOKENdo not start Build. The bump workflow runs the tests and the build itself.Testing
./gradlew test buildPluginpasses, and so do the script's 8 unit tests.TORNADOVM_HOMEunset, on JDK 25 (-jdk22plus) and on GraalVM 21 (-jdk21):javac, then the printed kernel and correct results, with and without program arguments.since-build231 still holds.verifyPluginagainst the recommended IDEs) passes.Not tested
runIde.Before the next release, add a change note to
plugin.xml.