Skip to content

Commit 9af3d5d

Browse files
authored
Cleanup for release v1.19.0 (#242)
* Update jackson to latest stable version * Fix regression caused by the update in the sl4j dependency. * Fix approval workflow to execute idempotent integration tests. * Fix approval to only run integration tests in ubuntu
1 parent 3e31ad4 commit 9af3d5d

File tree

12 files changed

+150
-76
lines changed

12 files changed

+150
-76
lines changed

.github/workflows/pr-build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ jobs:
2020
with:
2121
java-version: 17
2222
- uses: gradle/wrapper-validation-action@v1
23+
- name: Build with Gradle with Integration tests
24+
if: ${{ matrix.os == 'ubuntu-latest' }}
25+
uses: gradle/gradle-build-action@v2
26+
with:
27+
arguments: build integrationTests --stacktrace -PenableCoverage=true -PlocalDocker=true
2328
- name: Build with Gradle
2429
uses: gradle/gradle-build-action@v2
30+
if: ${{ matrix.os != 'ubuntu-latest' }}
2531
with:
2632
arguments: build --stacktrace -PenableCoverage=true
2733
- uses: codecov/codecov-action@v1

buildSrc/build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
plugins {
2+
`kotlin-dsl`
3+
}
4+
repositories {
5+
mavenCentral()
6+
gradlePluginPortal()
7+
mavenLocal()
8+
}
9+
10+
dependencies {
11+
implementation("com.google.cloud.tools:jib-gradle-plugin:3.3.0")
12+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package software.amazon.adot
2+
3+
import com.google.cloud.tools.jib.gradle.JibExtension
4+
5+
/**
6+
* Utilitary extension function used to configure jib according to flags. Used to avoid having branching in each build
7+
* script.
8+
*/
9+
fun JibExtension.configureImages(sourceImage:String, destinationImage: String, localDocker: Boolean, multiPlatform: Boolean, tags: Set<String> = setOf<String>()) {
10+
to {
11+
image = destinationImage
12+
if (!tags.isEmpty()) {
13+
this.tags = tags;
14+
}
15+
}
16+
17+
from {
18+
if (localDocker) {
19+
image = "docker://$sourceImage"
20+
} else {
21+
image = sourceImage
22+
}
23+
24+
if (multiPlatform) {
25+
platforms {
26+
platform {
27+
architecture = "amd64"
28+
os = "linux"
29+
}
30+
platform {
31+
architecture = "arm64"
32+
os = "linux"
33+
}
34+
}
35+
}
36+
}
37+
}

dependencyManagement/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ val otelSnapshotVersion = "1.20.0"
3434

3535
val DEPENDENCY_BOMS = listOf(
3636
"com.amazonaws:aws-java-sdk-bom:1.12.322",
37-
"com.fasterxml.jackson:jackson-bom:2.14.0-rc2",
37+
"com.fasterxml.jackson:jackson-bom:2.13.4.20221013",
3838
"com.google.guava:guava-bom:31.1-jre",
3939
"com.google.protobuf:protobuf-bom:3.21.7",
4040
"com.linecorp.armeria:armeria-bom:1.20.1",
@@ -60,7 +60,7 @@ val DEPENDENCY_SETS = listOf(
6060
),
6161
DependencySet(
6262
"org.slf4j",
63-
"2.0.3",
63+
"1.7.36",
6464
listOf(
6565
"slf4j-api",
6666
"slf4j-simple"

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ org.gradle.jvmargs= \
1515
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
1616
--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
1717
--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
18+
19+
# Flag used in the jib plugin to inform if we should use multi platform and pull from local docker.
20+
localDocker=false

otelagent/build.gradle.kts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515

1616
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
17-
17+
import software.amazon.adot.configureImages
1818
plugins {
1919
java
2020
`maven-publish`
@@ -131,22 +131,13 @@ tasks {
131131
}
132132

133133
jib {
134-
to {
135-
image = "public.ecr.aws/u0d6r4y4/aws-opentelemetry-java-base:alpha"
136-
}
137-
from {
138-
image = "gcr.io/distroless/java17-debian11:debug"
139-
platforms {
140-
platform {
141-
architecture = "amd64"
142-
os = "linux"
143-
}
144-
platform {
145-
architecture = "arm64"
146-
os = "linux"
147-
}
148-
}
149-
}
134+
configureImages(
135+
"gcr.io/distroless/java17-debian11:debug",
136+
"public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha",
137+
localDocker = false,
138+
multiPlatform = !rootProject.property("localDocker")!!.equals("true")
139+
)
140+
150141
container {
151142
appRoot = "/aws-observability"
152143
setEntrypoint("INHERIT")
Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import software.amazon.adot.configureImages
2+
13
plugins {
24
java
35

@@ -19,27 +21,20 @@ application {
1921
}
2022

2123
jib {
22-
to {
23-
image = "public.ecr.aws/aws-otel-test/aws-otel-java-spark-awssdkv1"
24+
configureImages(
25+
"public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha",
26+
"public.ecr.aws/aws-otel-test/aws-otel-java-spark-awssdkv1",
27+
localDocker = rootProject.property("localDocker")!!.equals("true"),
28+
multiPlatform = !rootProject.property("localDocker")!!.equals("true"),
2429
tags = setOf("latest", "${System.getenv("COMMIT_HASH")}")
25-
}
26-
from {
27-
image = "public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha"
28-
platforms {
29-
platform {
30-
architecture = "amd64"
31-
os = "linux"
32-
}
33-
platform {
34-
architecture = "arm64"
35-
os = "linux"
36-
}
37-
}
38-
}
30+
)
3931
}
4032

4133
tasks {
4234
named("jib") {
4335
dependsOn(":otelagent:jib")
4436
}
37+
named("jibDockerBuild") {
38+
dependsOn(":otelagent:jibDockerBuild")
39+
}
4540
}

sample-apps/spark/build.gradle.kts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import software.amazon.adot.configureImages
2+
13
plugins {
24
java
35

@@ -22,27 +24,20 @@ application {
2224
}
2325

2426
jib {
25-
to {
26-
image = "public.ecr.aws/aws-otel-test/aws-otel-java-spark"
27+
configureImages(
28+
"public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha",
29+
"public.ecr.aws/aws-otel-test/aws-otel-java-spark",
30+
localDocker = rootProject.property("localDocker")!!.equals("true"),
31+
multiPlatform = !rootProject.property("localDocker")!!.equals("true"),
2732
tags = setOf("latest", "${System.getenv("COMMIT_HASH")}")
28-
}
29-
from {
30-
image = "public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha"
31-
platforms {
32-
platform {
33-
architecture = "amd64"
34-
os = "linux"
35-
}
36-
platform {
37-
architecture = "arm64"
38-
os = "linux"
39-
}
40-
}
41-
}
33+
)
4234
}
4335

4436
tasks {
4537
named("jib") {
4638
dependsOn(":otelagent:jib")
4739
}
40+
named("jibDockerBuild") {
41+
dependsOn(":otelagent:jibDockerBuild")
42+
}
4843
}
Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import software.amazon.adot.configureImages
2+
13
plugins {
24
java
35
id("org.springframework.boot")
@@ -14,27 +16,21 @@ dependencies {
1416
}
1517

1618
jib {
17-
to {
18-
image = "public.ecr.aws/aws-otel-test/aws-otel-java-springboot"
19+
configureImages(
20+
"public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha",
21+
"public.ecr.aws/aws-otel-test/aws-otel-java-springboot",
22+
rootProject.property("localDocker")!!.equals("true"),
23+
!rootProject.property("localDocker")!!.equals("true"),
1924
tags = setOf("latest", "${System.getenv("COMMIT_HASH")}")
20-
}
21-
from {
22-
image = "public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha"
23-
platforms {
24-
platform {
25-
architecture = "amd64"
26-
os = "linux"
27-
}
28-
platform {
29-
architecture = "arm64"
30-
os = "linux"
31-
}
32-
}
33-
}
25+
)
3426
}
3527

3628
tasks {
3729
named("jib") {
3830
dependsOn(":otelagent:jib")
3931
}
32+
33+
named("jibDockerBuild") {
34+
dependsOn(":otelagent:jibDockerBuild")
35+
}
4036
}

smoke-tests/runner/build.gradle.kts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,21 @@ tasks {
4444
.getAsFile().absolutePath}"
4545
)
4646
}
47+
48+
register("jibDockerBuildAll")
49+
register("integrationTests")
50+
51+
named("integrationTests") {
52+
dependsOn("test")
53+
dependsOn("jibDockerBuildAll")
54+
findByName("test")?.mustRunAfter("jibDockerBuildAll")
55+
}
56+
57+
named("jibDockerBuildAll") {
58+
// Make sure that images used during tests are available locally.
59+
dependsOn(":sample-apps:spark:jibDockerBuild")
60+
dependsOn(":sample-apps:springboot:jibDockerBuild")
61+
dependsOn(":smoke-tests:spring-boot:jibDockerBuild")
62+
dependsOn(":smoke-tests:fakebackend:jibDockerBuild")
63+
}
4764
}

0 commit comments

Comments
 (0)