Skip to content

Commit

Permalink
NH-37575: move benchmarking to Push workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cleverchuk committed Jul 1, 2024
1 parent 682a0c0 commit 9dbda8f
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 54 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ jobs:
docker buildx build --tag $IMAGE_ID_XK6 --push xk6/
- name: Docker logout
if: always()
run: docker logout

test:
Expand Down Expand Up @@ -190,6 +191,7 @@ jobs:
name: lambda-release-test

- name: Docker logout
if: always()
run: docker logout

lambda-publish-stage:
Expand Down Expand Up @@ -380,4 +382,40 @@ jobs:
name: release-test

- name: Docker logout
if: always()
run: docker logout

benchmark:
runs-on: ubuntu-latest
needs:
- s3-stage-upload
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Docker login
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $GITHUB_USERNAME --password-stdin

- name: Benchmark test
working-directory: benchmark
run: ./gradlew test

- uses: actions/upload-artifact@v4
with:
path: benchmark/results/release/summary.txt
name: benchmark-summary

- uses: actions/upload-artifact@v4
if: always()
with:
path: benchmark/build/reports/tests/test/
name: benchmark-test

- name: Docker logout
if: always()
run: docker logout
32 changes: 0 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -285,35 +285,3 @@ jobs:
with:
path: arns.txt
name: arns

benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Docker login
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $GITHUB_USERNAME --password-stdin

- name: Benchmark test
run: |
cd benchmark
./gradlew test
- uses: actions/upload-artifact@v4
with:
path: benchmark/results/release/summary.txt
name: benchmark-summary

- uses: actions/upload-artifact@v4
with:
path: benchmark/build/reports/tests/test/
name: benchmark-test

- name: Docker logout
run: docker logout
23 changes: 13 additions & 10 deletions benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("java")
id("com.diffplug.spotless") version "6.1.2"
id("com.diffplug.spotless") version "6.25.0"
}

spotless {
Expand All @@ -16,15 +16,18 @@ repositories {
}

dependencies {
testImplementation("org.testcontainers:testcontainers:1.16.2")
testImplementation("org.testcontainers:postgresql:1.15.3")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.2")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.7.2")
testImplementation("com.squareup.okhttp3:okhttp:4.9.1")
testImplementation("org.jooq:joox:1.6.2")
testImplementation("com.jayway.jsonpath:json-path:2.6.0")
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.0.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.2")
implementation(enforcedPlatform("org.junit:junit-bom:5.10.3"))

testImplementation("org.testcontainers:testcontainers:1.19.8")
testImplementation("org.testcontainers:postgresql:1.19.8")
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-params")
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")
testImplementation("org.jooq:joox:2.0.1")
testImplementation("com.jayway.jsonpath:json-path:2.9.0")
testImplementation("org.slf4j:slf4j-simple:2.0.13")

testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}

tasks {
Expand Down
2 changes: 2 additions & 0 deletions benchmark/src/test/java/io/opentelemetry/OverheadTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ public class OverheadTests {
static void setUp() {
collector = CollectorContainer.build(NETWORK);
collector.start();

aoCollector = AOTestCollectorContainer.build(NETWORK);
aoCollector.start();
}

@AfterAll
static void tearDown() {
collector.close();
aoCollector.close();
}

@TestFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ public class AOTestCollectorContainer {

private static final Logger logger = LoggerFactory.getLogger(CollectorContainer.class);

static {
// needs to be executed, before Docker images are resolved
if (System.getenv("GITHUB_USERNAME") != null && System.getenv("GITHUB_TOKEN") != null) {
System.setProperty("registry.username", System.getenv("GITHUB_USERNAME"));
System.setProperty("registry.password", System.getenv("GITHUB_TOKEN"));
} else {
throw new RuntimeException("GP_USERNAME and GP_TOKEN are needed.");
}
}

public static GenericContainer<?> build(Network network) {
return new GenericContainer<>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
import io.opentelemetry.agents.AgentResolver;
import io.opentelemetry.agents.LatestSolarwindsAgentResolver;
import io.opentelemetry.util.NamingConventions;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -99,6 +96,7 @@ private String[] buildCommandline(Optional<Path> agentJar) {
"-Dotel.traces.exporter=otlp",
"-Dotel.imr.export.interval=5000",
"-Dotel.exporter.otlp.insecure=true",
"-Dotel.exporter.otlp.protocol=grpc",
"-Dotel.exporter.otlp.endpoint=http://collector:4317",
"-Dotel.resource.attributes=service.name=petclinic-otel-overhead"));
} else {
Expand Down

0 comments on commit 9dbda8f

Please sign in to comment.