Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c4ad0ed
Support GitLab test execution on Linux arm64.
AlexeyKuznetsov-DD May 8, 2026
2901752
Fixed netty on arm64
AlexeyKuznetsov-DD May 8, 2026
3506190
Fixed Java crashes on arm64 Linux during CDS
AlexeyKuznetsov-DD May 8, 2026
bf4f3fb
Fixed RestletTest on arm64 Linux
AlexeyKuznetsov-DD May 8, 2026
75eaaf7
Fixed debugger on Linux arm64
AlexeyKuznetsov-DD May 8, 2026
50c71e5
Fixed ByteBuddy issue on arm64: `Could not self-attach to current VM`.
AlexeyKuznetsov-DD May 8, 2026
71c1bb0
Optimize K8s resources.
AlexeyKuznetsov-DD May 8, 2026
7971586
Fixed netty on arm64
AlexeyKuznetsov-DD May 8, 2026
0384ca2
Fix for play gradle plugin on arm64
AlexeyKuznetsov-DD May 8, 2026
5dca385
Revert changes and simply skip netty test on arm64 linux.
AlexeyKuznetsov-DD May 9, 2026
b12efea
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD May 9, 2026
c1e5e52
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD May 14, 2026
a88aa89
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD May 18, 2026
49adff8
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD May 20, 2026
8865f78
Changes to test on multi-arch docker image.
AlexeyKuznetsov-DD May 20, 2026
0cfbcc8
Fixed rule for GraalVM.
AlexeyKuznetsov-DD May 20, 2026
9fe822a
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD May 21, 2026
978c998
Minor polishing.
AlexeyKuznetsov-DD May 21, 2026
5292b38
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD May 22, 2026
e292092
Fixed review comments about `isArm64()`
AlexeyKuznetsov-DD May 22, 2026
0bedeff
Fixed review comments about `ProcessBuilderHelper`.
AlexeyKuznetsov-DD May 22, 2026
72188c6
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD May 22, 2026
a850d45
Polishing GitLab script.
AlexeyKuznetsov-DD May 22, 2026
89df26a
Running on non default JDKs.
AlexeyKuznetsov-DD May 22, 2026
51d5ec0
Fixed non-default JVMs.
AlexeyKuznetsov-DD May 22, 2026
eab7ecd
Workarounds for Oracle 8 and Semeru JDKs.
AlexeyKuznetsov-DD May 23, 2026
fe65096
Testing Oracle 8 not crashed on arm64 without profiling.
AlexeyKuznetsov-DD May 24, 2026
0331109
Attempt to fix Oracle 8 crash on arm64.
AlexeyKuznetsov-DD May 24, 2026
9408976
Attempt to fix crashing play smoke tests on Linux arm64.
AlexeyKuznetsov-DD May 24, 2026
4a6c5a5
Fix reworked.
AlexeyKuznetsov-DD May 24, 2026
f3162e4
Ignore Oracle8 arm64.
AlexeyKuznetsov-DD May 25, 2026
2d60350
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD May 26, 2026
a0fa2ed
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD May 28, 2026
083d588
Use docker image from master.
AlexeyKuznetsov-DD May 28, 2026
3564022
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD May 29, 2026
2afdc21
Tweaked build after merge with master.
AlexeyKuznetsov-DD May 29, 2026
5cfacae
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD Jun 2, 2026
27de013
Code cleanup
AlexeyKuznetsov-DD Jun 3, 2026
be77791
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD Jun 3, 2026
8e27f79
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD Jun 3, 2026
240fc3c
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD Jun 4, 2026
7ecf0b6
Merge branch 'master' into alexeyk/arm64-test
AlexeyKuznetsov-DD Jun 9, 2026
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
230 changes: 223 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ stages:
- shared-pipeline
- benchmarks
- tests
- tests-arm64
Comment on lines 37 to +38

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: I believe it might be coherent to rename test to test-amd64, or x86_64.

- test-summary
- exploration-tests
- ci-visibility-tests
Expand All @@ -53,7 +54,7 @@ variables:
MAVEN_REPOSITORY_PROXY: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/"
GRADLE_PLUGIN_PROXY: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/"
BUILDER_IMAGE_REPO: "registry.ddbuild.io/images/mirror/dd-trace-java-docker-build" # images are pinned in images/mirror.lock.yaml in the DataDog/images repo
BUILDER_IMAGE_VERSION_PREFIX: "ci-" # use either an empty string (e.g. "") for latest images or a version followed by a hyphen (e.g. "ci-" or "123_merge-")
BUILDER_IMAGE_VERSION_PREFIX: "163_merge-" # use either an empty string (e.g. "") for latest images or a version followed by a hyphen (e.g. "ci-" or "123_merge-")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: Remove before merge ?

Comment thread
AlexeyKuznetsov-DD marked this conversation as resolved.
Outdated
REPO_NOTIFICATION_CHANNEL: "#apm-java-escalations"
DEFAULT_TEST_JVMS: /^(8|11|17|21|25|tip)$/ # the latest "tip" version is 26
PROFILE_TESTS:
Expand Down Expand Up @@ -163,6 +164,24 @@ default:
echo -e "${TEXT_BOLD}${TEXT_YELLOW} Containers:${TEXT_CLEAR} https://app.datadoghq.com/containers?${TIME_PARAMS}query=image_name%3A%2A%2Fdatadog%2Fdd-trace-java-docker-build%20AND%20pod_name%3A${POD_NAME}&live=false"
echo -e "${TEXT_BOLD}${TEXT_YELLOW} Processes:${TEXT_CLEAR} https://app.datadoghq.com/process?${TIME_PARAMS}query=image_name%3A%2A%2Fdatadog%2Fdd-trace-java-docker-build%20AND%20pod_name%3A${POD_NAME}&live=false"

.tier_m:
variables: &tier_m_variables
GRADLE_WORKERS: 4
GRADLE_MEMORY_MIN: 1G
GRADLE_MEMORY_MAX: 5G
KUBERNETES_CPU_REQUEST: 6
KUBERNETES_MEMORY_REQUEST: 16Gi
KUBERNETES_MEMORY_LIMIT: 16Gi

.tier_l:
variables: &tier_l_variables
GRADLE_WORKERS: 6
GRADLE_MEMORY_MIN: 1G
GRADLE_MEMORY_MAX: 6G
KUBERNETES_CPU_REQUEST: 10
KUBERNETES_MEMORY_REQUEST: 20Gi
KUBERNETES_MEMORY_LIMIT: 20Gi
Comment on lines +168 to +184

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Do tiers have special meaning ? Is there a reason to name them l, m ? Or is is it just factoring out variables uses in the same gitlab "stage" ?

Also. Given there's not much differences between the two set, what do you think about just using the larger values only in the .gradle_build which inherited by the test jobs.


.gitlab_base_ref_params: &gitlab_base_ref_params
- |
export GIT_BASE_REF=$(.gitlab/find-gh-base-ref.sh)
Expand All @@ -176,13 +195,8 @@ default:
image: ${BUILDER_IMAGE_REPO}:${BUILDER_IMAGE_VERSION_PREFIX}base
stage: build
variables:
<<: *tier_m_variables
Comment thread
AlexeyKuznetsov-DD marked this conversation as resolved.
MAVEN_OPTS: "-Xms256M -Xmx1024M"
GRADLE_WORKERS: 6
GRADLE_MEMORY_MIN: 1G
GRADLE_MEMORY_MAX: 4G
KUBERNETES_CPU_REQUEST: 10
KUBERNETES_MEMORY_REQUEST: 20Gi
KUBERNETES_MEMORY_LIMIT: 20Gi
CACHE_TYPE: "lib" #default
FF_USE_FASTZIP: "true"
CACHE_COMPRESSION_LEVEL: "slowest"
Expand Down Expand Up @@ -626,6 +640,7 @@ muzzle-dep-report:
needs: [ build_tests ]
stage: tests
variables:
<<: *tier_m_variables
GRADLE_PARAMS: "-PskipFlakyTests"
CONTINUE_ON_FAILURE: "false"
TESTCONTAINERS_CHECKS_DISABLE: "true"
Expand Down Expand Up @@ -693,6 +708,122 @@ muzzle-dep-report:
- scheduler_failure
- data_integrity_failure

.test_job_arm64:
image: ${BUILDER_IMAGE_REPO}:${BUILDER_IMAGE_VERSION_PREFIX}$testJvm
Comment thread
AlexeyKuznetsov-DD marked this conversation as resolved.
tags: [ "docker-in-docker:arm64" ]
stage: tests-arm64
needs: []
variables:
<<: *tier_m_variables
# arm64 does not include JDK 7 or ibm8 (upstream images not published for arm64).
Comment thread
AlexeyKuznetsov-DD marked this conversation as resolved.
DEFAULT_TEST_JVMS: /^(8|11|17|21|25|tip)$/
GRADLE_PARAMS: "-PskipFlakyTests"
TESTCONTAINERS_CHECKS_DISABLE: "true"
TESTCONTAINERS_RYUK_DISABLED: "true"
TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX: "registry.ddbuild.io/images/mirror/"
JETTY_AVAILABLE_PROCESSORS: 4
GIT_SUBMODULE_STRATEGY: normal
GIT_SUBMODULE_DEPTH: 1
rules:
- if: $testJvm =~ $DEFAULT_TEST_JVMS
when: manual
allow_failure: true
- if: '$NON_DEFAULT_JVMS == "true" && $testJvm != "ibm8" && $testJvm != "oracle8"'
when: manual
allow_failure: true
cache:
- key: dependency-$CACHE_TYPE
paths:
- .gradle/wrapper
- .gradle/caches
- .gradle/notifications
- .mvn/caches
policy: pull
fallback_keys:
- dependency-base
- dependency-lib
unprotect: true
before_script:
- git config --global --add safe.directory "$CI_PROJECT_DIR"
# Akka token added to SSM from https://account.akka.io/token
- export ORG_GRADLE_PROJECT_akkaRepositoryToken=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.akka_repo_token --with-decryption --query "Parameter.Value" --out text)
- export ORG_GRADLE_PROJECT_mavenRepositoryProxy=$MAVEN_REPOSITORY_PROXY
- export ORG_GRADLE_PROJECT_gradlePluginProxy=$GRADLE_PLUGIN_PROXY
- |
JAVA_HOMES=$(env | grep -E '^JAVA_[A-Z0-9_]+_HOME=' | sed 's/=.*//' | paste -sd,)
cat >> gradle.properties <<EOF
org.gradle.java.installations.auto-detect=false
org.gradle.java.installations.auto-download=false
org.gradle.java.installations.fromEnv=$JAVA_HOMES
EOF
- mkdir -p .gradle .mvn/caches
# GitLab's cache helper restores .gradle as root, but we run as non-root-user (uid 1001),
# and Gradle does `chmod 700 .gradle` on startup which requires user ownership.
- sudo chown -R 1001:1001 .gradle
- export GRADLE_USER_HOME=$(pwd)/.gradle
- sed -i "s|https://repo.maven.apache.org/maven2/|$MAVEN_REPOSITORY_PROXY|g" .mvn/wrapper/maven-wrapper.properties
- *normalize_node_index
- *prepare_test_env
# Disable CDS in forked JVMs to avoid SIGSEGVs on Linux arm64.
- export GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xshare:off -Xms$GRADLE_MEMORY_MIN -Xmx$GRADLE_MEMORY_MAX -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -Djava.util.prefs.userRoot=/tmp/.java/.userPrefs-${CI_JOB_ID}' -Ddatadog.forkedMinHeapSize=128M -Ddatadog.forkedMaxHeapSize=1024M"
- export GRADLE_ARGS="--build-cache --stacktrace --no-daemon --parallel --max-workers=$GRADLE_WORKERS"
- ./gradlew --version
script:
- *gitlab_base_ref_params
- ./gradlew $GRADLE_TARGET $GRADLE_PARAMS -PtestJvm=$testJvm -Pslot=$CI_NODE_INDEX/$CI_NODE_TOTAL $GRADLE_ARGS --continue
after_script:
- *restore_pretest_env
- *set_datadog_api_keys
- *container_info
- *cgroup_info
- source .gitlab/gitlab-utils.sh
- gitlab_section_start "collect-reports" "Collecting reports"
- .gitlab/collect_reports.sh
- .gitlab/collect_results.sh
- .gitlab/upload_ciapp.sh $CACHE_TYPE $testJvm
- gitlab_section_end "collect-reports"
- .gitlab/count_tests.sh "$GRADLE_TARGET" "$testJvm" "./results" "./test_counts_${CI_JOB_ID}.json"
- URL_ENCODED_JOB_NAME=$(jq -rn --arg x "$CI_JOB_NAME" '$x|@uri')
- echo -e "${TEXT_BOLD}${TEXT_YELLOW}See test results in Datadog:${TEXT_CLEAR} https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40test.service%3Add-trace-java%20%40ci.pipeline.id%3A${CI_PIPELINE_ID}%20%40ci.job.name%3A%22${URL_ENCODED_JOB_NAME}%22"
artifacts:
when: always
paths:
- ./reports.tar
- ./profiles.tar
- ./results
- './test_counts_*.json'
- '.gradle/daemon/*/*.out.log'
reports:
junit: results/*.xml
retry:
max: 2
when:
- unknown_failure
- stuck_or_timeout_failure
- runner_system_failure
- unmet_prerequisites
- scheduler_failure
- data_integrity_failure
Comment thread
AlexeyKuznetsov-DD marked this conversation as resolved.

.test_job_arm64_with_test_agent:
extends: .test_job_arm64
variables:
CI_USE_TEST_AGENT: "true"
CI_AGENT_HOST: local-agent
services:
- name: registry.ddbuild.io/images/mirror/dd-apm-test-agent/ddapm-test-agent:v1.44.0
alias: local-agent
variables:
LOG_LEVEL: "DEBUG"
TRACE_LANGUAGE: "java"
DD_SUPPRESS_TRACE_PARSE_ERRORS: "true"
DD_POOL_TRACE_CHECK_FAILURES: "true"
DD_DISABLE_ERROR_RESPONSES: "true"
ENABLED_CHECKS: "trace_content_length,trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service,trace_dd_service"
script:
- !reference [.test_job_arm64, script]
- .gitlab/check_test_agent_results.sh

.test_job_with_test_agent:
extends: .test_job
variables:
Expand Down Expand Up @@ -740,9 +871,27 @@ test_base:
- if [ "$testJvm" == "8" ]; then export GRADLE_PARAMS="-PskipFlakyTests -PcheckCoverage"; fi
- !reference [.test_job, script]

test_base_arm64:
extends: .test_job_arm64
variables:
GRADLE_TARGET: ":baseTest"
CACHE_TYPE: "base"
parallel:
matrix: *test_matrix_4

test_inst:
extends: .test_job_with_test_agent
variables:
<<: *tier_l_variables
GRADLE_TARGET: ":instrumentationTest"
CACHE_TYPE: "inst"
parallel:
matrix: *test_matrix_8

test_inst_arm64:
extends: .test_job_arm64_with_test_agent
variables:
<<: *tier_l_variables
GRADLE_TARGET: ":instrumentationTest"
CACHE_TYPE: "inst"
parallel:
Expand All @@ -751,6 +900,20 @@ test_inst:
test_inst_latest:
extends: .test_job_with_test_agent
variables:
<<: *tier_l_variables
GRADLE_TARGET: ":instrumentationLatestDepTest"
CACHE_TYPE: "latestdep"
parallel:
matrix:
- testJvm: ["8", "17", "21", "25"] # the latest "tip" version is LTS v25
# Gitlab doesn't support "parallel" and "parallel:matrix" at the same time
# This emulates "parallel" by including it in the matrix
CI_SPLIT: [ "1/6", "2/6", "3/6", "4/6", "5/6", "6/6"]

test_inst_latest_arm64:
extends: .test_job_arm64_with_test_agent
variables:
<<: *tier_l_variables
GRADLE_TARGET: ":instrumentationLatestDepTest"
CACHE_TYPE: "latestdep"
parallel:
Expand Down Expand Up @@ -800,6 +963,14 @@ test_profiling:
parallel:
matrix: *test_matrix

test_profiling_arm64:
extends: .test_job_arm64
variables:
GRADLE_TARGET: ":profilingTest"
CACHE_TYPE: "profiling"
parallel:
matrix: *test_matrix

# specific jvms list for debugger project because J9-based JVMs have issues with local vars
# so need to test at least against one J9-based JVM
test_debugger:
Expand All @@ -811,9 +982,28 @@ test_debugger:
parallel:
matrix: *test_matrix

test_debugger_arm64:
extends: .test_job_arm64
variables:
GRADLE_TARGET: ":debuggerTest"
CACHE_TYPE: "base"
parallel:
matrix: *test_matrix

test_smoke:
extends: .test_job
variables:
<<: *tier_l_variables
GRADLE_TARGET: "stageMainDist :smokeTest"
GRADLE_PARAMS: "-PskipFlakyTests"
CACHE_TYPE: "smoke"
parallel:
matrix: *test_matrix_8

test_smoke_arm64:
extends: .test_job_arm64
variables:
<<: *tier_l_variables
GRADLE_TARGET: "stageMainDist :smokeTest"
GRADLE_PARAMS: "-PskipFlakyTests"
CACHE_TYPE: "smoke"
Expand All @@ -830,6 +1020,18 @@ test_ssi_smoke:
- if: '$CI_COMMIT_BRANCH =~ /^gh-readonly-queue/'
when: on_success
variables:
<<: *tier_l_variables
GRADLE_TARGET: "stageMainDist :smokeTest"
CACHE_TYPE: "smoke"
DD_INJECT_FORCE: "true"
DD_INJECTION_ENABLED: "tracer"
parallel:
matrix: *test_matrix_8

test_ssi_smoke_arm64:
extends: .test_job_arm64
variables:
<<: *tier_l_variables
GRADLE_TARGET: "stageMainDist :smokeTest"
CACHE_TYPE: "smoke"
DD_INJECT_FORCE: "true"
Expand All @@ -841,6 +1043,20 @@ test_smoke_graalvm:
extends: .test_job
tags: [ "arch:amd64" ]
variables:
<<: *tier_l_variables
GRADLE_TARGET: "stageMainDist :dd-smoke-test:spring-boot-3.0-native:test"
CACHE_TYPE: "smoke"
CI_NO_SPLIT: "true"
NON_DEFAULT_JVMS: "true"
parallel:
matrix:
- testJvm: ["graalvm17", "graalvm21", "graalvm25"]

test_smoke_graalvm_arm64:
extends: .test_job_arm64
image: ${BUILDER_IMAGE_REPO}:${BUILDER_IMAGE_VERSION_PREFIX}$testJvm
variables:
<<: *tier_l_variables
Comment thread
AlexeyKuznetsov-DD marked this conversation as resolved.
Outdated
GRADLE_TARGET: "stageMainDist :dd-smoke-test:spring-boot-3.0-native:test"
CACHE_TYPE: "smoke"
CI_NO_SPLIT: "true"
Expand Down
17 changes: 17 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import datadog.gradle.plugin.HostPlatform
import datadog.gradle.plugin.ci.testAggregate

plugins {
Expand Down Expand Up @@ -82,6 +83,8 @@ allprojects {
dependsOn(tasks.withType<AbstractCompile>())
}

val isLinuxArm64 = HostPlatform.isLinuxArm64()

tasks.configureEach {
if (this is JavaForkOptions) {
maxHeapSize = System.getProperty("datadog.forkedMaxHeapSize")
Expand All @@ -91,6 +94,20 @@ allprojects {
"-XX:+HeapDumpOnOutOfMemoryError",
"-XX:HeapDumpPath=/tmp"
)
if (isLinuxArm64) {
// Disable CDS to avoid SIGSEGVs on Linux arm64.
jvmArgs("-Xshare:off")
}
}
}

// Disable CDS to avoid SIGSEGVs on Linux arm64.
if (isLinuxArm64) {
tasks.withType<JavaCompile>().configureEach {
options.forkOptions.jvmArgs?.add("-Xshare:off")
}
tasks.withType<GroovyCompile>().configureEach {
groovyOptions.forkOptions.jvmArgs?.add("-Xshare:off")
}
}
}
Expand Down
21 changes: 21 additions & 0 deletions buildSrc/src/main/kotlin/datadog/gradle/plugin/HostPlatform.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package datadog.gradle.plugin

import java.util.Locale

object HostPlatform {
Comment thread
AlexeyKuznetsov-DD marked this conversation as resolved.
@JvmStatic
fun isLinuxArm64(): Boolean = isExpectedOs("linux") && isArm64()

@JvmStatic
fun isMacArm64(): Boolean = isExpectedOs("mac") && isArm64()

private fun isExpectedOs(expectedOs: String): Boolean {
val osName = System.getProperty("os.name", "").lowercase(Locale.ROOT)
return osName.contains(expectedOs)
}

private fun isArm64(): Boolean {
val osArch = System.getProperty("os.arch", "").lowercase(Locale.ROOT)
return osArch.contains("aarch64") || osArch.contains("arm64")
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package datadog.gradle.plugin.instrument

import datadog.gradle.plugin.HostPlatform
import datadog.gradle.plugin.instrument.BuildTimeInstrumentationPlugin.Companion.BUILD_TIME_INSTRUMENTATION_PLUGIN_CONFIGURATION
import org.gradle.api.Action
import org.gradle.api.Project
Expand Down Expand Up @@ -73,6 +74,10 @@ abstract class InstrumentPostProcessingAction @Inject constructor(
return workerExecutor.processIsolation {
forkOptions {
setExecutable(javaLauncher.executablePath.asFile.absolutePath)
if (HostPlatform.isLinuxArm64()) {
// Disable CDS to avoid SIGSEGVs on Linux arm64.
jvmArgs("-Xshare:off")
}
Comment thread
AlexeyKuznetsov-DD marked this conversation as resolved.
}
}
}
Expand Down
Loading