Skip to content

Commit 8ae094c

Browse files
Fix GraalVM native smoke-test OOM and configured MASS Gradle download for arm64. (#11698)
Cap quarkus-native native-image builder heap to fix arm64 OOM. Limit CPU usage on CI. Cap Quarkus app. Use L tier for GraalVM to avoid OOM. Cap CPU to 6. Removed 6 CPU cap. Added MASS for arm64. Tweaked comments. Merge branch 'master' into alexeyk/fixed-graalvm-arm64-ci-build Merge branch 'master' into alexeyk/fixed-graalvm-arm64-ci-build # Conflicts: # .gitlab-ci.yml Mirror MASS logic from amd64 to arm64. Merge branch 'master' into alexeyk/fixed-graalvm-arm64-ci-build Co-authored-by: alexey.kuznetsov <alexey.kuznetsov@datadoghq.com>
1 parent cc3000e commit 8ae094c

4 files changed

Lines changed: 31 additions & 7 deletions

File tree

.gitlab-ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,11 @@ muzzle-dep-report:
788788
# Apache Maven Wrapper supports MVNW_REPOURL for repository-manager downloads:
789789
# https://maven.apache.org/tools/wrapper/#Using_a_Maven_Repository_Manager
790790
- export MVNW_REPOURL=${MAVEN_REPOSITORY_PROXY%/}
791+
# Route Gradle distribution download through MASS pull-through cache
792+
- |
793+
mass_read_host="${MASS_READ_URL#https://}"
794+
mass_read_host="${mass_read_host%/}"
795+
sed -i "/^distributionUrl=/ s|services.gradle.org|${mass_read_host}/internal/artifact/services.gradle.org|" gradle/wrapper/gradle-wrapper.properties
791796
- *normalize_node_index
792797
- *prepare_test_env
793798
# Disable CDS in forked JVMs to avoid SIGSEGVs on Linux arm64.
@@ -1110,6 +1115,7 @@ test_smoke_graalvm:
11101115
needs: *needs_build_tests_smoke
11111116
tags: [ "arch:amd64" ]
11121117
variables:
1118+
<<: *tier_l_variables
11131119
GRADLE_TARGET: "stageMainDist :dd-smoke-test:spring-boot-3.0-native:test :dd-smoke-test:quarkus-native:test"
11141120
CACHE_TYPE: "smoke"
11151121
CI_NO_SPLIT: "true"
@@ -1122,6 +1128,7 @@ test_smoke_graalvm_arm64:
11221128
extends: .test_job_arm64
11231129
tags: [ "arch:arm64" ]
11241130
variables:
1131+
<<: *tier_l_variables
11251132
GRADLE_TARGET: "stageMainDist :dd-smoke-test:spring-boot-3.0-native:test :dd-smoke-test:quarkus-native:test"
11261133
CACHE_TYPE: "smoke"
11271134
CI_NO_SPLIT: "true"

dd-smoke-tests/quarkus-native/application/build.gradle

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ if (hasProperty('appBuildDir')) {
1515

1616
version = ""
1717

18+
// Avoid unlimited CPU usage on CI.
19+
def isCI = providers.environmentVariable("CI").isPresent()
20+
def ciBuildCpuCount = providers.environmentVariable("KUBERNETES_CPU_REQUEST").getOrElse("4")
21+
1822
dependencies {
1923
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
2024
implementation 'io.quarkus:quarkus-resteasy'
@@ -36,11 +40,15 @@ if (hasProperty('agentJar')) {
3640
// are not properly tracked by this nested gradle build cache, it needs to be tracked
3741
// from the outside (see smokeTestApp).
3842
final agentJar = property('agentJar')
39-
System.setProperty(
40-
'quarkus.native.additional-build-args',
41-
"-J-javaagent:${agentJar}," +
42-
"-J-Ddatadog.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd'T'HH:mm:ss.SSS'Z [dd.trace]'," +
43-
"-J-Ddd.profiling.enabled=true," +
44-
"-march=native"
45-
)
43+
def nativeBuildArgs = [
44+
"-J-javaagent:${agentJar}",
45+
"-J-Ddatadog.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd'T'HH:mm:ss.SSS'Z [dd.trace]'",
46+
"-J-Ddd.profiling.enabled=true",
47+
"-march=native",
48+
]
49+
if (isCI) {
50+
nativeBuildArgs.add("-H:NumberOfThreads=$ciBuildCpuCount")
51+
nativeBuildArgs.add("-J-XX:ActiveProcessorCount=$ciBuildCpuCount")
52+
}
53+
System.setProperty('quarkus.native.additional-build-args', nativeBuildArgs.join(','))
4654
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
quarkus.log.level=INFO
22
quarkus.log.category."datadog.smoketest".level=DEBUG
33
quarkus.log.console.format=%d %-5p [%c] '%t' |MT|%X{dd.trace_id}|MS|%X{dd.span_id}|%m%e%n
4+
quarkus.native.native-image-xmx=4g
45

dd-smoke-tests/spring-boot-3.0-native/application/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ apply from: "$sharedConfigDirectory/repositories.gradle"
1313

1414
ext.withProfiler = hasProperty('profiler')
1515

16+
// Avoid unlimited CPU usage on CI.
17+
def isCI = providers.environmentVariable("CI").isPresent()
18+
def ciBuildCpuCount = providers.environmentVariable("KUBERNETES_CPU_REQUEST").getOrElse("4")
19+
1620
if (hasProperty('appBuildDir')) {
1721
buildDir = property('appBuildDir')
1822
}
@@ -47,6 +51,10 @@ if (hasProperty('agentPath')) {
4751
buildArgs.add("-J-Ddd.profiling.scrub.enabled=true")
4852
buildArgs.add("-J-Ddd.profiling.start-force-first=true")
4953
}
54+
if (isCI) {
55+
buildArgs.add("-H:NumberOfThreads=$ciBuildCpuCount")
56+
buildArgs.add("-J-XX:ActiveProcessorCount=$ciBuildCpuCount")
57+
}
5058
jvmArgs.add("-Xmx4096M")
5159
}
5260
}

0 commit comments

Comments
 (0)