-
Notifications
You must be signed in to change notification settings - Fork 312
Add custom ImageNameSubstitutor
implementation that rewrites Docker image names to use Datadog’s internal registry registry.ddbuild.io
when running in a CI environment.
#9679
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
… image names to use Datadog’s internal registry `registry.ddbuild.io` when running in a CI environment.
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 7 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.55.0-SNAPSHOT~ea791bf387, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.026 s) : 0, 1025568
Total [baseline] (8.742 s) : 0, 8742181
Agent [candidate] (1.027 s) : 0, 1026931
Total [candidate] (8.663 s) : 0, 8662764
section iast
Agent [baseline] (1.157 s) : 0, 1157443
Total [baseline] (9.316 s) : 0, 9316019
Agent [candidate] (1.154 s) : 0, 1154431
Total [candidate] (9.249 s) : 0, 9248678
gantt
title insecure-bank - break down per module: candidate=1.55.0-SNAPSHOT~ea791bf387, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.482 ms) : 0, 1482
crashtracking [candidate] (1.477 ms) : 0, 1477
BytebuddyAgent [baseline] (699.102 ms) : 0, 699102
BytebuddyAgent [candidate] (700.5 ms) : 0, 700500
GlobalTracer [baseline] (243.33 ms) : 0, 243330
GlobalTracer [candidate] (244.001 ms) : 0, 244001
AppSec [baseline] (33.104 ms) : 0, 33104
AppSec [candidate] (33.127 ms) : 0, 33127
Debugger [baseline] (6.443 ms) : 0, 6443
Debugger [candidate] (6.483 ms) : 0, 6483
Remote Config [baseline] (703.52 µs) : 0, 704
Remote Config [candidate] (698.173 µs) : 0, 698
Telemetry [baseline] (9.305 ms) : 0, 9305
Telemetry [candidate] (9.345 ms) : 0, 9345
Flare Poller [baseline] (10.958 ms) : 0, 10958
Flare Poller [candidate] (10.086 ms) : 0, 10086
section iast
crashtracking [baseline] (1.469 ms) : 0, 1469
crashtracking [candidate] (1.47 ms) : 0, 1470
BytebuddyAgent [baseline] (817.278 ms) : 0, 817278
BytebuddyAgent [candidate] (817.659 ms) : 0, 817659
GlobalTracer [baseline] (234.814 ms) : 0, 234814
GlobalTracer [candidate] (232.531 ms) : 0, 232531
AppSec [baseline] (35.694 ms) : 0, 35694
AppSec [candidate] (34.543 ms) : 0, 34543
Debugger [baseline] (6.156 ms) : 0, 6156
Debugger [candidate] (6.185 ms) : 0, 6185
Remote Config [baseline] (621.938 µs) : 0, 622
Remote Config [candidate] (620.29 µs) : 0, 620
Telemetry [baseline] (8.837 ms) : 0, 8837
Telemetry [candidate] (8.607 ms) : 0, 8607
Flare Poller [baseline] (4.234 ms) : 0, 4234
Flare Poller [candidate] (4.208 ms) : 0, 4208
IAST [baseline] (27.078 ms) : 0, 27078
IAST [candidate] (27.385 ms) : 0, 27385
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.55.0-SNAPSHOT~ea791bf387, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.017 s) : 0, 1017197
Total [baseline] (10.7 s) : 0, 10700140
Agent [candidate] (1.016 s) : 0, 1016056
Total [candidate] (10.673 s) : 0, 10673367
section appsec
Agent [baseline] (1.204 s) : 0, 1203536
Total [baseline] (10.969 s) : 0, 10969106
Agent [candidate] (1.201 s) : 0, 1201097
Total [candidate] (11.084 s) : 0, 11084116
section iast
Agent [baseline] (1.15 s) : 0, 1149840
Total [baseline] (10.97 s) : 0, 10970298
Agent [candidate] (1.159 s) : 0, 1158524
Total [candidate] (10.902 s) : 0, 10902324
section profiling
Agent [baseline] (1.164 s) : 0, 1164467
Total [baseline] (11.027 s) : 0, 11026923
Agent [candidate] (1.167 s) : 0, 1167472
Total [candidate] (10.972 s) : 0, 10972242
gantt
title petclinic - break down per module: candidate=1.55.0-SNAPSHOT~ea791bf387, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.47 ms) : 0, 1470
crashtracking [candidate] (1.469 ms) : 0, 1469
BytebuddyAgent [baseline] (693.149 ms) : 0, 693149
BytebuddyAgent [candidate] (694.11 ms) : 0, 694110
GlobalTracer [baseline] (241.565 ms) : 0, 241565
GlobalTracer [candidate] (241.137 ms) : 0, 241137
AppSec [baseline] (32.572 ms) : 0, 32572
AppSec [candidate] (32.689 ms) : 0, 32689
Debugger [baseline] (6.351 ms) : 0, 6351
Debugger [candidate] (6.375 ms) : 0, 6375
Remote Config [baseline] (702.336 µs) : 0, 702
Remote Config [candidate] (687.093 µs) : 0, 687
Telemetry [baseline] (9.155 ms) : 0, 9155
Telemetry [candidate] (9.12 ms) : 0, 9120
Flare Poller [baseline] (11.143 ms) : 0, 11143
Flare Poller [candidate] (9.279 ms) : 0, 9279
section appsec
crashtracking [baseline] (1.498 ms) : 0, 1498
crashtracking [candidate] (1.469 ms) : 0, 1469
BytebuddyAgent [baseline] (724.169 ms) : 0, 724169
BytebuddyAgent [candidate] (722.265 ms) : 0, 722265
GlobalTracer [baseline] (235.673 ms) : 0, 235673
GlobalTracer [candidate] (235.401 ms) : 0, 235401
AppSec [baseline] (176.695 ms) : 0, 176695
AppSec [candidate] (176.539 ms) : 0, 176539
Debugger [baseline] (6.078 ms) : 0, 6078
Debugger [candidate] (6.141 ms) : 0, 6141
Remote Config [baseline] (638.05 µs) : 0, 638
Remote Config [candidate] (653.879 µs) : 0, 654
Telemetry [baseline] (8.459 ms) : 0, 8459
Telemetry [candidate] (8.461 ms) : 0, 8461
Flare Poller [baseline] (3.958 ms) : 0, 3958
Flare Poller [candidate] (3.983 ms) : 0, 3983
IAST [baseline] (25.033 ms) : 0, 25033
IAST [candidate] (25.049 ms) : 0, 25049
section iast
crashtracking [baseline] (1.462 ms) : 0, 1462
crashtracking [candidate] (1.479 ms) : 0, 1479
BytebuddyAgent [baseline] (814.324 ms) : 0, 814324
BytebuddyAgent [candidate] (820.464 ms) : 0, 820464
GlobalTracer [baseline] (231.535 ms) : 0, 231535
GlobalTracer [candidate] (232.854 ms) : 0, 232854
AppSec [baseline] (35.25 ms) : 0, 35250
AppSec [candidate] (35.799 ms) : 0, 35799
Debugger [baseline] (6.165 ms) : 0, 6165
Debugger [candidate] (6.208 ms) : 0, 6208
Remote Config [baseline] (602.906 µs) : 0, 603
Remote Config [candidate] (613.225 µs) : 0, 613
Telemetry [baseline] (8.658 ms) : 0, 8658
Telemetry [candidate] (8.771 ms) : 0, 8771
Flare Poller [baseline] (4.22 ms) : 0, 4220
Flare Poller [candidate] (4.241 ms) : 0, 4241
IAST [baseline] (26.306 ms) : 0, 26306
IAST [candidate] (26.725 ms) : 0, 26725
section profiling
ProfilingAgent [baseline] (107.378 ms) : 0, 107378
ProfilingAgent [candidate] (107.824 ms) : 0, 107824
crashtracking [baseline] (1.437 ms) : 0, 1437
crashtracking [candidate] (1.451 ms) : 0, 1451
BytebuddyAgent [baseline] (722.803 ms) : 0, 722803
BytebuddyAgent [candidate] (726.001 ms) : 0, 726001
GlobalTracer [baseline] (218.018 ms) : 0, 218018
GlobalTracer [candidate] (217.881 ms) : 0, 217881
AppSec [baseline] (33.158 ms) : 0, 33158
AppSec [candidate] (33.08 ms) : 0, 33080
Debugger [baseline] (6.434 ms) : 0, 6434
Debugger [candidate] (7.236 ms) : 0, 7236
Remote Config [baseline] (706.223 µs) : 0, 706
Remote Config [candidate] (695.372 µs) : 0, 695
Telemetry [baseline] (16.619 ms) : 0, 16619
Telemetry [candidate] (15.756 ms) : 0, 15756
Flare Poller [baseline] (4.185 ms) : 0, 4185
Flare Poller [candidate] (4.12 ms) : 0, 4120
Profiling [baseline] (109.063 ms) : 0, 109063
Profiling [candidate] (108.945 ms) : 0, 108945
LoadParameters
See matching parameters
SummaryFound 3 performance improvements and 2 performance regressions! Performance is the same for 7 metrics, 12 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~ea791bf387, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section baseline
no_agent (4.399 ms) : 4350, 4448
. : milestone, 4399,
iast (9.623 ms) : 9465, 9782
. : milestone, 9623,
iast_FULL (14.575 ms) : 14290, 14860
. : milestone, 14575,
iast_GLOBAL (10.892 ms) : 10696, 11088
. : milestone, 10892,
profiling (8.713 ms) : 8581, 8845
. : milestone, 8713,
tracing (7.61 ms) : 7495, 7725
. : milestone, 7610,
section candidate
no_agent (4.292 ms) : 4243, 4341
. : milestone, 4292,
iast (9.151 ms) : 8994, 9308
. : milestone, 9151,
iast_FULL (15.278 ms) : 14976, 15581
. : milestone, 15278,
iast_GLOBAL (10.739 ms) : 10550, 10928
. : milestone, 10739,
profiling (8.494 ms) : 8367, 8622
. : milestone, 8494,
tracing (8.216 ms) : 8093, 8339
. : milestone, 8216,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~ea791bf387, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section baseline
no_agent (37.375 ms) : 37079, 37671
. : milestone, 37375,
appsec (49.557 ms) : 49109, 50006
. : milestone, 49557,
code_origins (45.041 ms) : 44659, 45424
. : milestone, 45041,
iast (45.604 ms) : 45209, 46000
. : milestone, 45604,
profiling (48.205 ms) : 47735, 48674
. : milestone, 48205,
tracing (43.77 ms) : 43407, 44133
. : milestone, 43770,
section candidate
no_agent (35.9 ms) : 35614, 36186
. : milestone, 35900,
appsec (48.267 ms) : 47843, 48691
. : milestone, 48267,
code_origins (45.285 ms) : 44900, 45670
. : milestone, 45285,
iast (44.397 ms) : 44032, 44762
. : milestone, 44397,
profiling (46.431 ms) : 46008, 46853
. : milestone, 46431,
tracing (44.417 ms) : 44040, 44794
. : milestone, 44417,
DacapoParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 1 unstable metrics.
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.55.0-SNAPSHOT~ea791bf387, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section baseline
no_agent (15.027 s) : 15027000, 15027000
. : milestone, 15027000,
appsec (14.861 s) : 14861000, 14861000
. : milestone, 14861000,
iast (18.778 s) : 18778000, 18778000
. : milestone, 18778000,
iast_GLOBAL (17.945 s) : 17945000, 17945000
. : milestone, 17945000,
profiling (15.62 s) : 15620000, 15620000
. : milestone, 15620000,
tracing (15.291 s) : 15291000, 15291000
. : milestone, 15291000,
section candidate
no_agent (15.47 s) : 15470000, 15470000
. : milestone, 15470000,
appsec (15.086 s) : 15086000, 15086000
. : milestone, 15086000,
iast (18.47 s) : 18470000, 18470000
. : milestone, 18470000,
iast_GLOBAL (18.286 s) : 18286000, 18286000
. : milestone, 18286000,
profiling (15.608 s) : 15608000, 15608000
. : milestone, 15608000,
tracing (15.004 s) : 15004000, 15004000
. : milestone, 15004000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.55.0-SNAPSHOT~ea791bf387, baseline=1.55.0-SNAPSHOT~37454135e4
dateFormat X
axisFormat %s
section baseline
no_agent (1.483 ms) : 1472, 1495
. : milestone, 1483,
appsec (3.713 ms) : 3493, 3933
. : milestone, 3713,
iast (2.213 ms) : 2149, 2276
. : milestone, 2213,
iast_GLOBAL (2.269 ms) : 2204, 2334
. : milestone, 2269,
profiling (2.081 ms) : 2028, 2134
. : milestone, 2081,
tracing (2.04 ms) : 1990, 2090
. : milestone, 2040,
section candidate
no_agent (1.48 ms) : 1468, 1491
. : milestone, 1480,
appsec (2.526 ms) : 2472, 2580
. : milestone, 2526,
iast (2.216 ms) : 2152, 2279
. : milestone, 2216,
iast_GLOBAL (2.255 ms) : 2191, 2319
. : milestone, 2255,
profiling (2.509 ms) : 2339, 2680
. : milestone, 2509,
tracing (2.039 ms) : 1989, 2089
. : milestone, 2039,
|
...a-agent/instrumentation/jdbc/src/test/groovy/test/DataDogRegistryImageNameSubstitutor.groovy
Show resolved
Hide resolved
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.
Cool!
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.
Nice improvement !
By the way since our registry mirrors docker hub do you think we could use the mirror of the build image in .gitlab-ci.yaml
? I remember pull failures in our GL runner.
name = name.replace( | ||
'mcr.microsoft.com/mssql/server:', | ||
'registry.ddbuild.io/images/mirror/sqlserver:' | ||
) |
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: For consistency shouldn't we do that for all images. Also while writing this comment I noticed that the prefix is not exactly the same, i.e. one cannot simply replace mcr.microsoft.com
by registry.ddbuild.io/images/mirror
.
Also, what about logging / printing image names that are unknown ?
(POSTGRESQL): "jdbc:postgresql://localhost:5432/" + dbName.get(POSTGRESQL), | ||
(MYSQL) : "jdbc:mysql://localhost:3306/" + dbName.get(MYSQL), | ||
(SQLSERVER) : "jdbc:sqlserver://localhost:1433/" + dbName.get(SQLSERVER), | ||
(ORACLE) : "jdbc:oracle:thin:@//localhost:1521/" + dbName.get(ORACLE), |
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.
(POSTGRESQL): "jdbc:postgresql://localhost:5432/" + dbName.get(POSTGRESQL), | |
(MYSQL) : "jdbc:mysql://localhost:3306/" + dbName.get(MYSQL), | |
(SQLSERVER) : "jdbc:sqlserver://localhost:1433/" + dbName.get(SQLSERVER), | |
(ORACLE) : "jdbc:oracle:thin:@//localhost:1521/" + dbName.get(ORACLE), | |
(POSTGRESQL): "jdbc:postgresql://localhost:5432/${dbName.get(POSTGRESQL)}", | |
(MYSQL) : "jdbc:mysql://localhost:3306/${dbName.get(MYSQL)}", | |
(SQLSERVER) : "jdbc:sqlserver://localhost:1433/${dbName.get(SQLSERVER)}", | |
(ORACLE) : "jdbc:oracle:thin:@//localhost:1521/${dbName.get(ORACLE)}", |
PortUtils.waitForPortToOpen(mysql.getHost(), mysql.getMappedPort(MySQLContainer.MYSQL_PORT), 5, TimeUnit.SECONDS) | ||
jdbcUrls.put(MYSQL, "${mysql.getJdbcUrl()}") | ||
sqlserver = new MSSQLServerContainer(MSSQLServerContainer.IMAGE).acceptLicense().withPassword(jdbcPasswords.get(SQLSERVER)) | ||
sqlserver = new MSSQLServerContainer("mcr.microsoft.com/mssql/server:2022-latest").acceptLicense().withPassword(jdbcPasswords.get(SQLSERVER)) |
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: I think it's fine to keep MSSQLServerContainer.IMAGE
.
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.
Forgot to approve
What Does This Do
Implements a custom
ImageNameSubstitutor
that rewrites Docker image names to use Datadog’s internal registry (registry.ddbuild.io
) when running in a CI environment.Motivation
Improve CI reliability.
Some tests were failing on CI with the following error:
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image mcr.microsoft.com/mssql/server:latest
.Datadog’s internal registry mirrors DockerHub images by default (via
TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX
), but not images from other registries.By introducing a custom
ImageNameSubstitutor
, we can rewrite image names to use our internal registry in CI, ensuring consistent availability and faster pulls.Additional Notes
Tested locally by toggling the
CI
environment variable:CI
is unset, the image is pulled from the Microsoft registry.CI
is set, the image is pulled from the internal registry.