Skip to content

Commit fe05169

Browse files
authored
CORE-4992: Create a ZIP artifact containing the YourKit profiler agent. (#1457)
* CORE-4992: Create a ZIP artifact containing the YourKit profiler agent. * Optionally add profiler agent to Docker images. * Refactor publishOSGiImage task into corda.docker-app convention plugin. * Add profiling support to the chart. * Add engineering-tools-maven repository for YourKit Java Profiler agent.
1 parent 6eb4f02 commit fe05169

File tree

20 files changed

+237
-59
lines changed

20 files changed

+237
-59
lines changed

applications/p2p-gateway/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'corda.common-publishing'
33
id 'corda.common-app'
4+
id 'corda.docker-app'
45
}
56

67
description 'Gateway Application'

applications/p2p-link-manager/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'corda.common-publishing'
33
id 'corda.common-app'
4+
id 'corda.docker-app'
45
}
56

67
description 'P2P Link Manager Application'
@@ -53,5 +54,5 @@ dependencies {
5354
implementation project(":libs:messaging:messaging")
5455
implementation project(":components:configuration:configuration-read-service")
5556

56-
image "io.opentelemetry.javaagent:opentelemetry-javaagent:$openTelemetryVersion"
57+
dockerImage "io.opentelemetry.javaagent:opentelemetry-javaagent:$openTelemetryVersion"
5758
}

applications/tools/p2p-test/app-simulator/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'corda.common-publishing'
33
id 'corda.common-app'
4+
id 'corda.docker-app'
45
}
56

67
description "P2P Testing tools - Application-level simulator"

applications/workers/release/combined-worker/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'corda.common-publishing'
33
id 'corda.quasar-app'
4+
id 'corda.docker-app'
45
}
56

67
description 'Combined Worker'

applications/workers/release/crypto-worker/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'corda.common-publishing'
33
id 'corda.common-app'
4+
id 'corda.docker-app'
45
}
56

67
description 'Crypto Worker'
@@ -30,5 +31,5 @@ dependencies {
3031
testRuntimeOnly "org.apache.felix:org.apache.felix.framework:$felixVersion"
3132
testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
3233

33-
image "io.opentelemetry.javaagent:opentelemetry-javaagent:$openTelemetryVersion"
34+
dockerImage "io.opentelemetry.javaagent:opentelemetry-javaagent:$openTelemetryVersion"
3435
}

applications/workers/release/db-worker/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'corda.common-publishing'
33
id 'corda.common-app'
4+
id 'corda.docker-app'
45
}
56

67
description 'DB Worker'
@@ -41,5 +42,5 @@ dependencies {
4142
exclude group: 'org.osgi'
4243
}
4344

44-
image "io.opentelemetry.javaagent:opentelemetry-javaagent:$openTelemetryVersion"
45+
dockerImage "io.opentelemetry.javaagent:opentelemetry-javaagent:$openTelemetryVersion"
4546
}

applications/workers/release/flow-worker/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'corda.common-publishing'
33
id 'corda.quasar-app'
4+
id 'corda.docker-app'
45
}
56

67
description 'Flow Worker'
@@ -41,5 +42,5 @@ dependencies {
4142
exclude group: 'org.osgi'
4243
}
4344

44-
image "io.opentelemetry.javaagent:opentelemetry-javaagent:$openTelemetryVersion"
45+
dockerImage "io.opentelemetry.javaagent:opentelemetry-javaagent:$openTelemetryVersion"
4546
}

applications/workers/release/member-worker/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'corda.common-publishing'
33
id 'corda.common-app'
4+
id 'corda.docker-app'
45
}
56

67
description 'Member Worker'
@@ -25,5 +26,5 @@ dependencies {
2526
runtimeOnly "org.apache.felix:org.apache.felix.configadmin:$felixConfigAdminVersion"
2627
runtimeOnly project(":libs:messaging:kafka-message-bus-impl")
2728

28-
image "io.opentelemetry.javaagent:opentelemetry-javaagent:$openTelemetryVersion"
29+
dockerImage "io.opentelemetry.javaagent:opentelemetry-javaagent:$openTelemetryVersion"
2930
}

applications/workers/release/rpc-worker/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'corda.common-publishing'
33
id 'corda.common-app'
4+
id 'corda.docker-app'
45
}
56

67
description 'RPC Worker'
@@ -56,7 +57,7 @@ dependencies {
5657
e2eTestImplementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion"
5758
e2eTestImplementation "com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion"
5859

59-
image "io.opentelemetry.javaagent:opentelemetry-javaagent:$openTelemetryVersion"
60+
dockerImage "io.opentelemetry.javaagent:opentelemetry-javaagent:$openTelemetryVersion"
6061
}
6162

6263
tasks.register('e2eTest', Test) {

build.gradle

Lines changed: 16 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ buildscript {
1111
}
1212

1313
plugins {
14-
id 'org.jetbrains.kotlin.jvm'
14+
id 'org.jetbrains.kotlin.jvm' apply false
1515
id 'org.jetbrains.kotlin.plugin.allopen' apply false
1616
id 'org.jetbrains.kotlin.plugin.jpa' apply false
1717
id 'io.gitlab.arturbosch.detekt' apply false
@@ -137,19 +137,31 @@ allprojects {
137137
//needed for C5 binaries
138138
maven {
139139
url = "$artifactoryContextUrl/corda-os-maven"
140+
authentication {
141+
basic(BasicAuthentication)
142+
}
140143
credentials {
141144
username = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME')
142145
password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD')
143146
}
144147
}
145148

146-
// needed for plugin-host dependencies
147149
maven {
148-
url = "$artifactoryContextUrl/engineering-tools-maven-unstable-local"
150+
url = "$artifactoryContextUrl/engineering-tools-maven"
151+
authentication {
152+
basic(BasicAuthentication)
153+
}
149154
credentials {
150155
username = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME')
151156
password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD')
152157
}
158+
content {
159+
// YourKit Java Profiler agent artifact.
160+
// To publish agent locally:
161+
// $ cd profiler
162+
// $ ../gradlew publishToMavenLocal
163+
includeGroup 'com.yourkit.corda'
164+
}
153165
}
154166

155167
def cordaUseCache = System.getenv("CORDA_USE_CACHE")
@@ -346,8 +358,6 @@ subprojects {
346358
task allDependencies(type: DependencyReportTask) {}
347359

348360
configurations {
349-
// configuration used by DeployableContainerBuilder to add dependencies to Docker images
350-
image { transitive = false }
351361
all {
352362
resolutionStrategy {
353363
// FORCE Gradle to use latest dynamic versions.
@@ -371,43 +381,6 @@ subprojects {
371381
"javax.persistence.MappedSuperclass"
372382
)
373383
}
374-
375-
// apply docker publishing to workers and select testing applications
376-
def nonWorkerImages = ['p2p-gateway', 'p2p-link-manager', 'app-simulator', 'configuration-publisher']
377-
if (it.toString().contains(":applications:workers:release:") || nonWorkerImages.contains(it.name)) {
378-
379-
tasks.register('publishOSGiImage', DeployableContainerBuilder) {
380-
// Bit of a hack to ensure we always get a flat list of tasks
381-
def sourceTasks = (List<Task>)[project.tasks.named("appJar").get()].flatten()
382-
dependsOn(sourceTasks)
383-
it.sourceTasks = sourceTasks
384-
it.useShortName = true
385-
if (project.hasProperty('jibRemotePublish')) {
386-
remotePublish = jibRemotePublish.toBoolean()
387-
}
388-
389-
if (project.hasProperty('isReleaseCandidate')) {
390-
releaseCandidate = isReleaseCandidate.toBoolean()
391-
}
392-
393-
if (project.hasProperty('isNightly')) {
394-
nightlyBuild = isNightly.toBoolean()
395-
}
396-
397-
if (project.hasProperty('isPreTest')) {
398-
preTest = isPreTest.toBoolean()
399-
}
400-
401-
if (project.hasProperty('baseImage')) {
402-
baseImageName = baseImage
403-
}
404-
405-
if(project.hasProperty('useDockerDaemon')){
406-
useDaemon = useDockerDaemon.toBoolean()
407-
}
408-
}
409-
410-
}
411384
}
412385

413386
// report updatable dependencies: gradle dependencyUpdates
@@ -416,6 +389,7 @@ def isNonStable = { String version ->
416389
def regex = /^[0-9,.v-]+(-r)?$/
417390
return !stableKeyword && !(version ==~ regex)
418391
}
392+
419393
tasks.named("dependencyUpdates").configure {
420394
rejectVersionIf {
421395
isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)

0 commit comments

Comments
 (0)