-
Notifications
You must be signed in to change notification settings - Fork 324
Remove remaining use of JAVA_X_HOME
#10340
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
base: master
Are you sure you want to change the base?
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 56 metrics, 9 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.59.0-SNAPSHOT~e55a0a4bc5, baseline=1.59.0-SNAPSHOT~671cc8cdbf
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.084 s) : 0, 1083739
Total [baseline] (8.75 s) : 0, 8750130
Agent [candidate] (1.088 s) : 0, 1088127
Total [candidate] (8.783 s) : 0, 8783091
section iast
Agent [baseline] (1.219 s) : 0, 1219263
Total [baseline] (9.325 s) : 0, 9324805
Agent [candidate] (1.233 s) : 0, 1233069
Total [candidate] (9.367 s) : 0, 9366888
gantt
title insecure-bank - break down per module: candidate=1.59.0-SNAPSHOT~e55a0a4bc5, baseline=1.59.0-SNAPSHOT~671cc8cdbf
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.186 ms) : 0, 1186
crashtracking [candidate] (1.177 ms) : 0, 1177
BytebuddyAgent [baseline] (651.612 ms) : 0, 651612
BytebuddyAgent [candidate] (653.402 ms) : 0, 653402
GlobalTracer [baseline] (282.346 ms) : 0, 282346
GlobalTracer [candidate] (284.505 ms) : 0, 284505
AppSec [baseline] (32.666 ms) : 0, 32666
AppSec [candidate] (32.814 ms) : 0, 32814
Debugger [baseline] (67.182 ms) : 0, 67182
Debugger [candidate] (67.212 ms) : 0, 67212
Remote Config [baseline] (617.149 µs) : 0, 617
Remote Config [candidate] (635.57 µs) : 0, 636
Telemetry [baseline] (8.906 ms) : 0, 8906
Telemetry [candidate] (9.051 ms) : 0, 9051
Flare Poller [baseline] (3.768 ms) : 0, 3768
Flare Poller [candidate] (3.86 ms) : 0, 3860
section iast
crashtracking [baseline] (1.179 ms) : 0, 1179
crashtracking [candidate] (1.189 ms) : 0, 1189
BytebuddyAgent [baseline] (788.801 ms) : 0, 788801
BytebuddyAgent [candidate] (797.345 ms) : 0, 797345
GlobalTracer [baseline] (256.195 ms) : 0, 256195
GlobalTracer [candidate] (258.569 ms) : 0, 258569
IAST [baseline] (26.843 ms) : 0, 26843
IAST [candidate] (27.206 ms) : 0, 27206
AppSec [baseline] (34.079 ms) : 0, 34079
AppSec [candidate] (32.984 ms) : 0, 32984
Debugger [baseline] (64.532 ms) : 0, 64532
Debugger [candidate] (67.427 ms) : 0, 67427
Remote Config [baseline] (528.456 µs) : 0, 528
Remote Config [candidate] (594.684 µs) : 0, 595
Telemetry [baseline] (8.344 ms) : 0, 8344
Telemetry [candidate] (8.552 ms) : 0, 8552
Flare Poller [baseline] (3.542 ms) : 0, 3542
Flare Poller [candidate] (3.642 ms) : 0, 3642
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.59.0-SNAPSHOT~e55a0a4bc5, baseline=1.59.0-SNAPSHOT~671cc8cdbf
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.084 s) : 0, 1083861
Total [baseline] (10.758 s) : 0, 10757551
Agent [candidate] (1.086 s) : 0, 1086088
Total [candidate] (10.866 s) : 0, 10866215
section appsec
Agent [baseline] (1.274 s) : 0, 1274143
Total [baseline] (11.064 s) : 0, 11063978
Agent [candidate] (1.271 s) : 0, 1270805
Total [candidate] (11.055 s) : 0, 11055371
section iast
Agent [baseline] (1.24 s) : 0, 1239852
Total [baseline] (11.248 s) : 0, 11248229
Agent [candidate] (1.225 s) : 0, 1224701
Total [candidate] (11.189 s) : 0, 11188674
section profiling
Agent [baseline] (1.206 s) : 0, 1206280
Total [baseline] (10.946 s) : 0, 10945820
Agent [candidate] (1.215 s) : 0, 1214879
Total [candidate] (10.901 s) : 0, 10900864
gantt
title petclinic - break down per module: candidate=1.59.0-SNAPSHOT~e55a0a4bc5, baseline=1.59.0-SNAPSHOT~671cc8cdbf
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.172 ms) : 0, 1172
crashtracking [candidate] (1.195 ms) : 0, 1195
BytebuddyAgent [baseline] (650.676 ms) : 0, 650676
BytebuddyAgent [candidate] (651.704 ms) : 0, 651704
GlobalTracer [baseline] (282.475 ms) : 0, 282475
GlobalTracer [candidate] (283.073 ms) : 0, 283073
AppSec [baseline] (32.72 ms) : 0, 32720
AppSec [candidate] (32.764 ms) : 0, 32764
Debugger [baseline] (68.1 ms) : 0, 68100
Debugger [candidate] (68.473 ms) : 0, 68473
Remote Config [baseline] (642.237 µs) : 0, 642
Remote Config [candidate] (636.683 µs) : 0, 637
Telemetry [baseline] (8.937 ms) : 0, 8937
Telemetry [candidate] (8.982 ms) : 0, 8982
Flare Poller [baseline] (3.777 ms) : 0, 3777
Flare Poller [candidate] (3.792 ms) : 0, 3792
section appsec
crashtracking [baseline] (1.189 ms) : 0, 1189
crashtracking [candidate] (1.187 ms) : 0, 1187
BytebuddyAgent [baseline] (696.321 ms) : 0, 696321
BytebuddyAgent [candidate] (694.594 ms) : 0, 694594
GlobalTracer [baseline] (260.072 ms) : 0, 260072
GlobalTracer [candidate] (259.596 ms) : 0, 259596
IAST [baseline] (24.906 ms) : 0, 24906
IAST [candidate] (24.85 ms) : 0, 24850
AppSec [baseline] (173.474 ms) : 0, 173474
AppSec [candidate] (172.494 ms) : 0, 172494
Debugger [baseline] (68.385 ms) : 0, 68385
Debugger [candidate] (68.548 ms) : 0, 68548
Remote Config [baseline] (780.274 µs) : 0, 780
Remote Config [candidate] (753.824 µs) : 0, 754
Telemetry [baseline] (9.553 ms) : 0, 9553
Telemetry [candidate] (9.418 ms) : 0, 9418
Flare Poller [baseline] (3.885 ms) : 0, 3885
Flare Poller [candidate] (3.83 ms) : 0, 3830
section iast
crashtracking [baseline] (1.2 ms) : 0, 1200
crashtracking [candidate] (1.175 ms) : 0, 1175
BytebuddyAgent [baseline] (803.154 ms) : 0, 803154
BytebuddyAgent [candidate] (791.301 ms) : 0, 791301
GlobalTracer [baseline] (259.137 ms) : 0, 259137
GlobalTracer [candidate] (256.459 ms) : 0, 256459
IAST [baseline] (27.322 ms) : 0, 27322
IAST [candidate] (26.951 ms) : 0, 26951
AppSec [baseline] (34.687 ms) : 0, 34687
AppSec [candidate] (34.54 ms) : 0, 34540
Debugger [baseline] (65.993 ms) : 0, 65993
Debugger [candidate] (66.129 ms) : 0, 66129
Remote Config [baseline] (583.808 µs) : 0, 584
Remote Config [candidate] (593.399 µs) : 0, 593
Telemetry [baseline] (8.6 ms) : 0, 8600
Telemetry [candidate] (8.552 ms) : 0, 8552
Flare Poller [baseline] (3.552 ms) : 0, 3552
Flare Poller [candidate] (3.594 ms) : 0, 3594
section profiling
crashtracking [baseline] (1.217 ms) : 0, 1217
crashtracking [candidate] (1.225 ms) : 0, 1225
BytebuddyAgent [baseline] (703.857 ms) : 0, 703857
BytebuddyAgent [candidate] (708.776 ms) : 0, 708776
GlobalTracer [baseline] (221.18 ms) : 0, 221180
GlobalTracer [candidate] (223.078 ms) : 0, 223078
AppSec [baseline] (32.195 ms) : 0, 32195
AppSec [candidate] (32.537 ms) : 0, 32537
Debugger [baseline] (67.888 ms) : 0, 67888
Debugger [candidate] (68.883 ms) : 0, 68883
Remote Config [baseline] (690.38 µs) : 0, 690
Remote Config [candidate] (675.434 µs) : 0, 675
Telemetry [baseline] (8.945 ms) : 0, 8945
Telemetry [candidate] (8.918 ms) : 0, 8918
Flare Poller [baseline] (3.757 ms) : 0, 3757
Flare Poller [candidate] (3.77 ms) : 0, 3770
ProfilingAgent [baseline] (96.716 ms) : 0, 96716
ProfilingAgent [candidate] (96.8 ms) : 0, 96800
Profiling [baseline] (97.295 ms) : 0, 97295
Profiling [candidate] (97.378 ms) : 0, 97378
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 16 metrics, 19 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~e55a0a4bc5, baseline=1.59.0-SNAPSHOT~671cc8cdbf
dateFormat X
axisFormat %s
section baseline
no_agent (18.252 ms) : 18060, 18444
. : milestone, 18252,
appsec (18.5 ms) : 18312, 18687
. : milestone, 18500,
code_origins (18.174 ms) : 17993, 18355
. : milestone, 18174,
iast (17.868 ms) : 17691, 18045
. : milestone, 17868,
profiling (18.875 ms) : 18681, 19070
. : milestone, 18875,
tracing (17.899 ms) : 17723, 18076
. : milestone, 17899,
section candidate
no_agent (17.243 ms) : 17068, 17418
. : milestone, 17243,
appsec (18.806 ms) : 18612, 19000
. : milestone, 18806,
code_origins (17.649 ms) : 17473, 17825
. : milestone, 17649,
iast (17.683 ms) : 17508, 17858
. : milestone, 17683,
profiling (18.546 ms) : 18361, 18731
. : milestone, 18546,
tracing (17.486 ms) : 17316, 17656
. : milestone, 17486,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~e55a0a4bc5, baseline=1.59.0-SNAPSHOT~671cc8cdbf
dateFormat X
axisFormat %s
section baseline
no_agent (1.186 ms) : 1175, 1198
. : milestone, 1186,
iast (3.198 ms) : 3159, 3238
. : milestone, 3198,
iast_FULL (5.71 ms) : 5654, 5767
. : milestone, 5710,
iast_GLOBAL (3.592 ms) : 3539, 3645
. : milestone, 3592,
profiling (2.048 ms) : 2030, 2065
. : milestone, 2048,
tracing (1.804 ms) : 1789, 1819
. : milestone, 1804,
section candidate
no_agent (1.196 ms) : 1184, 1208
. : milestone, 1196,
iast (3.418 ms) : 3375, 3460
. : milestone, 3418,
iast_FULL (5.765 ms) : 5708, 5822
. : milestone, 5765,
iast_GLOBAL (3.621 ms) : 3568, 3673
. : milestone, 3621,
profiling (1.986 ms) : 1969, 2002
. : milestone, 1986,
tracing (1.802 ms) : 1787, 1817
. : milestone, 1802,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~e55a0a4bc5, baseline=1.59.0-SNAPSHOT~671cc8cdbf
dateFormat X
axisFormat %s
section baseline
no_agent (14.985 s) : 14985000, 14985000
. : milestone, 14985000,
appsec (14.669 s) : 14669000, 14669000
. : milestone, 14669000,
iast (18.153 s) : 18153000, 18153000
. : milestone, 18153000,
iast_GLOBAL (17.905 s) : 17905000, 17905000
. : milestone, 17905000,
profiling (15.627 s) : 15627000, 15627000
. : milestone, 15627000,
tracing (14.591 s) : 14591000, 14591000
. : milestone, 14591000,
section candidate
no_agent (15.149 s) : 15149000, 15149000
. : milestone, 15149000,
appsec (14.457 s) : 14457000, 14457000
. : milestone, 14457000,
iast (18.207 s) : 18207000, 18207000
. : milestone, 18207000,
iast_GLOBAL (17.749 s) : 17749000, 17749000
. : milestone, 17749000,
profiling (14.891 s) : 14891000, 14891000
. : milestone, 14891000,
tracing (14.826 s) : 14826000, 14826000
. : milestone, 14826000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~e55a0a4bc5, baseline=1.59.0-SNAPSHOT~671cc8cdbf
dateFormat X
axisFormat %s
section baseline
no_agent (1.47 ms) : 1459, 1481
. : milestone, 1470,
appsec (3.646 ms) : 3430, 3863
. : milestone, 3646,
iast (2.208 ms) : 2143, 2273
. : milestone, 2208,
iast_GLOBAL (2.253 ms) : 2188, 2319
. : milestone, 2253,
profiling (2.082 ms) : 2028, 2136
. : milestone, 2082,
tracing (2.037 ms) : 1985, 2088
. : milestone, 2037,
section candidate
no_agent (1.466 ms) : 1455, 1478
. : milestone, 1466,
appsec (3.7 ms) : 3480, 3919
. : milestone, 3700,
iast (2.199 ms) : 2135, 2264
. : milestone, 2199,
iast_GLOBAL (2.24 ms) : 2175, 2306
. : milestone, 2240,
profiling (2.078 ms) : 2024, 2131
. : milestone, 2078,
tracing (2.036 ms) : 1985, 2088
. : milestone, 2036,
|
a1e732b to
e6e93dd
Compare
…A_*_HOME env vars
ad686ad to
bea5f86
Compare
sarahchen6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow this is cool! Left a few small wording nits, but otherwise looks good!
I was wondering -- how were you able to test this? My guess is by removing local Java installations and confirming that non-JDK 21 tests can still run.
| } | ||
|
|
||
| // "stable" is calculated as the largest X found in JAVA_X_HOME | ||
| // "stable" is calculated as the largest Java version found via toolchains or JAVA_X_HOME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
misc: I still do not like stable name... can we rename it to latest or something similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not change it in this PR.
AlexeyKuznetsov-DD
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just have a question - would it be possible to have JVMs from various vendors to test for example Oracle 8 and Zulu on my laptop?
PerfectSlayer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Erf, I just notice my review was left in draft. Submitting now
docs/how_instrumentations_work.md
Outdated
| ``` | ||
|
|
||
| Running tests that require JDK-21 will require the `JAVA_21_HOME` env var set and can be done like this: | ||
| Running tests that require JDK-21 to be installed, use the `-PtestJvm=21` flag, for example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 suggestion: How will it work to run with a specific JVM?
For JDK version based criteria, we can set the version number. But what happens for the case where you want to run against a JDK installed in a specific path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The toolchain will be automatically downloaded with a number or (zulu11) e.g. :
// -------------> 1% CONFIGURING [10s]
// > :dd-java-agent > :dd-java-agent:agent-iast > Downloading toolchain from URI https://api.foojay.io/disco/v3.0/ids/dc9716d3e8f8baffc294fb182ceca2c2/redirect > https://api.foojay.io/disco/v3.0/ids/dc9716d3e8f8baffc294fb182ceca2c2/redirect > 80 MiB/104.5 MiB downloaded
That said provisioning won't work oracle as it cannot be provisonned automatically, so it has to be installed manually in a location that Gradle know about.
About JVM paths, this was already handled with the dd-trace-java.test-jvm-contraints plugin, so passing -PtestJvm=/path/to/fancy/jvm/ will use that jvm for tests.
dd-trace-java/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmSpec.kt
Lines 159 to 161 in f13392e
| private val Project.javaToolchains: JavaToolchainService | |
| get() = | |
| extensions.getByName("javaToolchains") as JavaToolchainService |
CONTRIBUTING.md
Outdated
| For IntelliJ IDEA, we suggest the following settings and plugin. | ||
|
|
||
| The default JVM to build and run tests from the command line should be Java 8. | ||
| The default JVM to build and run tests from the command line should be Java 21. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❔ question: Is this still needed? Won't it be picked automatically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your comment made me realize the gradle-daemon-jvm.properties was missing something for this to work. Next commit fixes that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm removing this line as it shouldn't be a concern anymore.
BUILDING.md
Outdated
| #### macOS | ||
|
|
||
|
|
||
| Use your JDK manager ([mise](https://mise.jdx.dev/), [sdkman](https://sdkman.io/), etc.) or set-up the required JDKs with `brew` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 thought: This is confusing as the next section gives explanations for brew. We choose to explain the brew way as it is the simplest as already available tools for most MacOS users not accustomed to Java development. For the others, they already know how to install a JDK and use their preferred tool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reworded
| check-jvm "JAVA_21_HOME" "21" | ||
| check-jvm "JAVA_25_HOME" "25" | ||
| check-jvm "JAVA_GRAALVM17_HOME" "17" | ||
| echo "ℹ️ Other JDK versions will be automatically downloaded by Gradle toolchain resolver." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like some part of my review were lost at some point but I had a comment about the onboarded script that was lost.
Here is a follow up PR to address what I originally posted: #10384
We can proceed with yours first and I will update / resolve conflict on mine after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, is this even necessary as JAVA_HOME is not strictly required anymore ?
| return launcher | ||
| } as Closure<Provider<JavaLauncher>> | ||
|
|
||
| ext.getLazyJavaHomeFor = (int javaVersionInteger, boolean hasNativeImage = false) -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Eventually this should be moved to the test-jvm-contraints plugin.
Just use |
URLs are acquired from the foojay resolver, when running this task ./gradlew updateDaemonJvm --jvm-version=21 See https://docs.gradle.org/8.14.3/userguide/gradle_daemon.html#configuring_the_daemon_jvm
fd1d2a7 to
e55a0a4
Compare
What Does This Do
This PR allows to completely get rid of setting up JAVA_X_HOME on local dev environment.
The
stablespecial word has special handling though, that is using Gradle internal toolchain registry, and fallback to env vars. However, this mainly affect CI.Motivation
Easier project setup
Additional Notes
After this PR, setting up JAVA_X_HOME won't be needed anymore. One can use
-PtestJvm=..., e.g.-PtestJvm=11,-PtestJvm=graalvm17, ...