-
Notifications
You must be signed in to change notification settings - Fork 1k
Adds Graal hints for the shaded dependencies #4832
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7f50996
Adds Graal hints for the shaded dependencies
marcingrzejszczak 70b3ce1
Moved the file to the proper location
marcingrzejszczak 92e0379
Added Graal VM Github Action build
marcingrzejszczak f22a024
Polish
marcingrzejszczak d304a94
Updated graal plugin
marcingrzejszczak 85ef541
Updated graal plugin to 0.9.14
marcingrzejszczak 79cde35
Updated graal native plugin
marcingrzejszczak 0910f7a
Applied changes following the review
marcingrzejszczak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: GraalVM Community Edition build | ||
| on: [push, pull_request] | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: graalvm/setup-graalvm@v1 | ||
| with: | ||
| version: 'latest' | ||
| java-version: '11' | ||
| components: 'native-image' | ||
| - name: Running test | ||
| run: | | ||
| echo "GRAALVM_HOME: $GRAALVM_HOME" | ||
| echo "JAVA_HOME: $JAVA_HOME" | ||
| java --version | ||
| gu --version | ||
| native-image --version | ||
| ./gradlew nativeTest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| plugins { | ||
| id("otel.java-conventions") | ||
| id("org.graalvm.buildtools.native") | ||
| } | ||
|
|
||
| description = "OpenTelemetry Graal Integration Tests" | ||
| otelJava.moduleName.set("io.opentelemetry.graal.integration.tests") | ||
|
|
||
| sourceSets { | ||
| main { | ||
| // We need to ensure that we have the shadowed classes on the classpath, without this | ||
| // we will get the <:sdk:trace-shaded-deps> classes only, without the shadowed ones | ||
| val traceShadedDeps = project(":sdk:trace-shaded-deps") | ||
| output.dir(traceShadedDeps.file("build/extracted/shadow"), "builtBy" to ":sdk:trace-shaded-deps:extractShadowJar") | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(project(path = ":sdk:trace-shaded-deps")) | ||
| } | ||
|
|
||
| graalvmNative { | ||
| binaries { | ||
| named("main") { | ||
| verbose.set(true) | ||
| } | ||
| } | ||
| toolchainDetection.set(false) | ||
| } | ||
2 changes: 2 additions & 0 deletions
2
integration-tests/graal/src/main/resources/simplelogger.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| org.slf4j.simpleLogger.defaultLogLevel=info | ||
| org.slf4j.simpleLogger.log.org.eclipse.jetty=warn |
26 changes: 26 additions & 0 deletions
26
...ration-tests/graal/src/test/java/io/opentelemetry/integrationtests/graal/JcToolsTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package io.opentelemetry.integrationtests.graal; | ||
|
|
||
| import static org.assertj.core.api.Assertions.assertThat; | ||
|
|
||
| import io.opentelemetry.sdk.trace.internal.JcTools; | ||
| import java.util.Queue; | ||
| import org.junit.jupiter.api.Test; | ||
| import org.junit.jupiter.api.condition.EnabledInNativeImage; | ||
|
|
||
| class JcToolsTest { | ||
|
|
||
| @Test | ||
| @EnabledInNativeImage | ||
| void insert_oneElementToTheQueue() { | ||
| Queue<Object> objects = JcTools.newFixedSizeQueue(10); | ||
|
|
||
| objects.add(new Object()); | ||
|
|
||
| assertThat(objects).hasSize(1); | ||
| } | ||
| } |
35 changes: 35 additions & 0 deletions
35
...ources/META-INF/native-image/io.opentelemetry/opentelemetry-sdk-trace/reflect-config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| [ | ||
| { | ||
| "condition": { | ||
| "typeReachable": "io.opentelemetry.internal.shaded.jctools.queues.MpscArrayQueueConsumerIndexField" | ||
| }, | ||
| "name": "io.opentelemetry.internal.shaded.jctools.queues.MpscArrayQueueConsumerIndexField", | ||
| "fields": [ | ||
| { | ||
| "name": "consumerIndex" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "condition": { | ||
| "typeReachable": "io.opentelemetry.internal.shaded.jctools.queues.MpscArrayQueueProducerIndexField" | ||
| }, | ||
| "name": "io.opentelemetry.internal.shaded.jctools.queues.MpscArrayQueueProducerIndexField", | ||
| "fields": [ | ||
| { | ||
| "name": "producerIndex" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "condition": { | ||
| "typeReachable": "io.opentelemetry.internal.shaded.jctools.queues.MpscArrayQueueProducerLimitField" | ||
| }, | ||
| "name": "io.opentelemetry.internal.shaded.jctools.queues.MpscArrayQueueProducerLimitField", | ||
| "fields": [ | ||
| { | ||
| "name": "producerLimit" | ||
| } | ||
| ] | ||
| } | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.