Skip to content

Commit

Permalink
Cleanup for release v1.19.0 (#242)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
rapphil authored Oct 20, 2022
1 parent 3e31ad4 commit 9af3d5d
Show file tree
Hide file tree
Showing 12 changed files with 150 additions and 76 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ jobs:
with:
java-version: 17
- uses: gradle/wrapper-validation-action@v1
- name: Build with Gradle with Integration tests
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: gradle/gradle-build-action@v2
with:
arguments: build integrationTests --stacktrace -PenableCoverage=true -PlocalDocker=true
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
if: ${{ matrix.os != 'ubuntu-latest' }}
with:
arguments: build --stacktrace -PenableCoverage=true
- uses: codecov/codecov-action@v1
12 changes: 12 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
plugins {
`kotlin-dsl`
}
repositories {
mavenCentral()
gradlePluginPortal()
mavenLocal()
}

dependencies {
implementation("com.google.cloud.tools:jib-gradle-plugin:3.3.0")
}
37 changes: 37 additions & 0 deletions buildSrc/src/main/kotlin/software/amazon/adot/GradleUtils.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package software.amazon.adot

import com.google.cloud.tools.jib.gradle.JibExtension

/**
* Utilitary extension function used to configure jib according to flags. Used to avoid having branching in each build
* script.
*/
fun JibExtension.configureImages(sourceImage:String, destinationImage: String, localDocker: Boolean, multiPlatform: Boolean, tags: Set<String> = setOf<String>()) {
to {
image = destinationImage
if (!tags.isEmpty()) {
this.tags = tags;
}
}

from {
if (localDocker) {
image = "docker://$sourceImage"
} else {
image = sourceImage
}

if (multiPlatform) {
platforms {
platform {
architecture = "amd64"
os = "linux"
}
platform {
architecture = "arm64"
os = "linux"
}
}
}
}
}
4 changes: 2 additions & 2 deletions dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ val otelSnapshotVersion = "1.20.0"

val DEPENDENCY_BOMS = listOf(
"com.amazonaws:aws-java-sdk-bom:1.12.322",
"com.fasterxml.jackson:jackson-bom:2.14.0-rc2",
"com.fasterxml.jackson:jackson-bom:2.13.4.20221013",
"com.google.guava:guava-bom:31.1-jre",
"com.google.protobuf:protobuf-bom:3.21.7",
"com.linecorp.armeria:armeria-bom:1.20.1",
Expand All @@ -60,7 +60,7 @@ val DEPENDENCY_SETS = listOf(
),
DependencySet(
"org.slf4j",
"2.0.3",
"1.7.36",
listOf(
"slf4j-api",
"slf4j-simple"
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ org.gradle.jvmargs= \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED

# Flag used in the jib plugin to inform if we should use multi platform and pull from local docker.
localDocker=false
25 changes: 8 additions & 17 deletions otelagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

import software.amazon.adot.configureImages
plugins {
java
`maven-publish`
Expand Down Expand Up @@ -131,22 +131,13 @@ tasks {
}

jib {
to {
image = "public.ecr.aws/u0d6r4y4/aws-opentelemetry-java-base:alpha"
}
from {
image = "gcr.io/distroless/java17-debian11:debug"
platforms {
platform {
architecture = "amd64"
os = "linux"
}
platform {
architecture = "arm64"
os = "linux"
}
}
}
configureImages(
"gcr.io/distroless/java17-debian11:debug",
"public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha",
localDocker = false,
multiPlatform = !rootProject.property("localDocker")!!.equals("true")
)

container {
appRoot = "/aws-observability"
setEntrypoint("INHERIT")
Expand Down
27 changes: 11 additions & 16 deletions sample-apps/spark-awssdkv1/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import software.amazon.adot.configureImages

plugins {
java

Expand All @@ -19,27 +21,20 @@ application {
}

jib {
to {
image = "public.ecr.aws/aws-otel-test/aws-otel-java-spark-awssdkv1"
configureImages(
"public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha",
"public.ecr.aws/aws-otel-test/aws-otel-java-spark-awssdkv1",
localDocker = rootProject.property("localDocker")!!.equals("true"),
multiPlatform = !rootProject.property("localDocker")!!.equals("true"),
tags = setOf("latest", "${System.getenv("COMMIT_HASH")}")
}
from {
image = "public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha"
platforms {
platform {
architecture = "amd64"
os = "linux"
}
platform {
architecture = "arm64"
os = "linux"
}
}
}
)
}

tasks {
named("jib") {
dependsOn(":otelagent:jib")
}
named("jibDockerBuild") {
dependsOn(":otelagent:jibDockerBuild")
}
}
27 changes: 11 additions & 16 deletions sample-apps/spark/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import software.amazon.adot.configureImages

plugins {
java

Expand All @@ -22,27 +24,20 @@ application {
}

jib {
to {
image = "public.ecr.aws/aws-otel-test/aws-otel-java-spark"
configureImages(
"public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha",
"public.ecr.aws/aws-otel-test/aws-otel-java-spark",
localDocker = rootProject.property("localDocker")!!.equals("true"),
multiPlatform = !rootProject.property("localDocker")!!.equals("true"),
tags = setOf("latest", "${System.getenv("COMMIT_HASH")}")
}
from {
image = "public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha"
platforms {
platform {
architecture = "amd64"
os = "linux"
}
platform {
architecture = "arm64"
os = "linux"
}
}
}
)
}

tasks {
named("jib") {
dependsOn(":otelagent:jib")
}
named("jibDockerBuild") {
dependsOn(":otelagent:jibDockerBuild")
}
}
28 changes: 12 additions & 16 deletions sample-apps/springboot/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import software.amazon.adot.configureImages

plugins {
java
id("org.springframework.boot")
Expand All @@ -14,27 +16,21 @@ dependencies {
}

jib {
to {
image = "public.ecr.aws/aws-otel-test/aws-otel-java-springboot"
configureImages(
"public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha",
"public.ecr.aws/aws-otel-test/aws-otel-java-springboot",
rootProject.property("localDocker")!!.equals("true"),
!rootProject.property("localDocker")!!.equals("true"),
tags = setOf("latest", "${System.getenv("COMMIT_HASH")}")
}
from {
image = "public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha"
platforms {
platform {
architecture = "amd64"
os = "linux"
}
platform {
architecture = "arm64"
os = "linux"
}
}
}
)
}

tasks {
named("jib") {
dependsOn(":otelagent:jib")
}

named("jibDockerBuild") {
dependsOn(":otelagent:jibDockerBuild")
}
}
17 changes: 17 additions & 0 deletions smoke-tests/runner/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,21 @@ tasks {
.getAsFile().absolutePath}"
)
}

register("jibDockerBuildAll")
register("integrationTests")

named("integrationTests") {
dependsOn("test")
dependsOn("jibDockerBuildAll")
findByName("test")?.mustRunAfter("jibDockerBuildAll")
}

named("jibDockerBuildAll") {
// Make sure that images used during tests are available locally.
dependsOn(":sample-apps:spark:jibDockerBuild")
dependsOn(":sample-apps:springboot:jibDockerBuild")
dependsOn(":smoke-tests:spring-boot:jibDockerBuild")
dependsOn(":smoke-tests:fakebackend:jibDockerBuild")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public ExportTraceServiceRequest deserialize(

@Container
private static final GenericContainer<?> backend =
new GenericContainer<>("public.ecr.aws/u0d6r4y4/aws-otel-java-test-fakebackend:alpha")
new GenericContainer<>("public.ecr.aws/aws-otel-test/aws-otel-java-test-fakebackend:alpha")
.withExposedPorts(8080)
.waitingFor(Wait.forHttp("/health").forPort(8080))
.withLogConsumer(new Slf4jLogConsumer(backendLogger))
Expand All @@ -107,7 +107,8 @@ public ExportTraceServiceRequest deserialize(

@Container
private static final GenericContainer<?> application =
new GenericContainer<>("public.ecr.aws/u0d6r4y4/aws-otel-java-smoketests-springboot:latest")
new GenericContainer<>(
"public.ecr.aws/aws-otel-test/aws-otel-java-smoketests-springboot:latest")
.dependsOn(backend)
.withExposedPorts(8080)
.withNetwork(network)
Expand All @@ -122,7 +123,8 @@ public ExportTraceServiceRequest deserialize(

@Container
private static final GenericContainer<?> applicationXraySampler =
new GenericContainer<>("public.ecr.aws/u0d6r4y4/aws-otel-java-smoketests-springboot:latest")
new GenericContainer<>(
"public.ecr.aws/aws-otel-test/aws-otel-java-smoketests-springboot:latest")
.dependsOn(backend)
.withExposedPorts(8080)
.withNetwork(network)
Expand Down
32 changes: 26 additions & 6 deletions smoke-tests/spring-boot/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Copyright Amazon.com, Inc. or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

import software.amazon.adot.configureImages

/*
* Copyright Amazon.com, Inc. or its affiliates.
*
Expand Down Expand Up @@ -29,16 +46,19 @@ dependencies {
}

jib {
to {
image = "public.ecr.aws/u0d6r4y4/aws-otel-java-smoketests-springboot"
}
from {
image = "public.ecr.aws/u0d6r4y4/aws-opentelemetry-java-base:alpha"
}
configureImages(
"public.ecr.aws/aws-otel-test/aws-opentelemetry-java-base:alpha",
"public.ecr.aws/aws-otel-test/aws-otel-java-smoketests-springboot",
localDocker = rootProject.property("localDocker")!!.equals("true"),
multiPlatform = false
)
}

tasks {
named("jib") {
dependsOn(":otelagent:jib")
}
named("jibDockerBuild") {
dependsOn(":otelagent:jibDockerBuild")
}
}

0 comments on commit 9af3d5d

Please sign in to comment.