Skip to content
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

[Feature] GraalVM Native Image support (Experimental). #11365

Merged
merged 28 commits into from
Oct 30, 2023

Conversation

yswdqz
Copy link
Member

@yswdqz yswdqz commented Sep 29, 2023

  • If this is non-trivial feature, paste the links/URLs to the design doc.

  • Update the documentation to include this new feature.

  • Tests(including UT, IT, E2E) are added to verify the new feature.

  • If it's UI related, attach the screenshots below.

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes [Feature] GraalVM Build for OAP server #11279 .

  • Update the CHANGES log.

@yswdqz yswdqz added core feature Core and important feature. Sometimes, break backwards compatibility. backend OAP backend related. labels Sep 29, 2023
@yswdqz yswdqz added this to the 9.7.0 milestone Sep 29, 2023
@@ -48,7 +48,7 @@ public Iterator<SearchHit> iterator() {
return getHits().iterator();
}

static final class TotalDeserializer extends JsonDeserializer<Integer> {
public static final class TotalDeserializer extends JsonDeserializer<Integer> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an unexpected change? Why public?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

II want to simply reference this class in another class, but maybe I should use a different approach.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an inner class, it should be accessible outside. Where do you use?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In SkyWalkingFeature, but I'm hesitating on whether to keep this class. I'll take a look after the CI for my repository finishes running.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Let's continue the discussion after you have more conclusions.

<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>23.0.1</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please manage the version from the bom.

import java.util.Arrays;
import java.util.List;

public class SkywalkingFeature implements Feature {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add comments to explain what this is about.

Suggested change
public class SkywalkingFeature implements Feature {
public class SkyWalkingFeature implements Feature {

skywalking should always be SkyWalking.

@yswdqz yswdqz marked this pull request as ready for review October 19, 2023 18:50

## Current Limitations
Native-image supports reflection and other dynamic features through some JSON-formatted configuration files. SkyWalking currently provides a set of configuration files for basic support. You can find them [here](https://github.com/apache/skywalking/tree/master/graal/graal-server-starter/src/main/resources/META-INF/native-image).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path you are using here should use the relative path. The website compiling could translate it to the correct path binding in the version(commit ID).

@wu-sheng
Copy link
Member

Notice, that the OSPP is reaching the deadline. SkyWalking community would not accept the PR until it is qualified.
Only two days left, and I can't be sure your PR can be merged at the last minute.

Comment on lines 76 to 83
Mockito.when(telemetryProvider.getService(MetricsCreator.class))
.thenReturn(new MetricsCreatorNoop());
TelemetryModule telemetryModule = Mockito.spy(TelemetryModule.class);
Whitebox.setInternalState(telemetryModule, "loadedProvider", telemetryProvider);
Mockito.when(moduleManager.find(TelemetryModule.NAME)).thenReturn(telemetryModule);

CoreModule coreModule = Mockito.spy(CoreModule.class);
Mockito.when(coreModuleProvider.getService(SourceReceiver.class)).thenReturn(new SourceReceiverImpl());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe a lot of mock codes are repeated in many UTs, right?

Could you move these mock codes into server-testing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meanwhile, due to all these tests are for Graal mostly, as you would not put the verification codes in these UTs, right?
You should reference UT-IT, and separate these UTs to run in the Graal package(such as GRAAL-PACKAGE-IT) only.
For now, you seem to make every UT-IT developer suffer extra time for nothing.

kezhenxu94
kezhenxu94 previously approved these changes Oct 30, 2023
Copy link
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits, otherwise look good to me

@@ -22,7 +22,7 @@ on:
- cron: "0 18 * * *" # TimeZone: UTC 0

concurrency:
group: skywalking-${{ github.event.pull_request.number || github.ref }}
group: skywalking-graalvm-${{ github.event.pull_request.number || github.ref }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you changed the wrong place, this file is skywalking.yaml, you should change the one in file .github/workflows/native-image.yaml

Suggested change
group: skywalking-graalvm-${{ github.event.pull_request.number || github.ref }}
group: skywalking-${{ github.event.pull_request.number || github.ref }}

push:

concurrency:
group: skywalking-${{ github.event.pull_request.number || github.ref }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
group: skywalking-${{ github.event.pull_request.number || github.ref }}
group: skywalking-graalvm-${{ github.event.pull_request.number || github.ref }}

name: E2E test
needs: [build]
runs-on: ${{ 'ubuntu-latest' }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
runs-on: ${{ 'ubuntu-latest' }}
runs-on: ubuntu-latest


FROM apache/skywalking-cli:$SKYWALKING_CLI_VERSION as cli

FROM --platform=linux/amd64 ubuntu:latest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we only support amd64 architecture in our Docker images? We don't have to add arm support in this PR, just wondering whether there is any blocker to support arm64 arch

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARM architecture should can be supported, but for the sake of passing tests stably, I specified AMD (some Docker images do not support ARM architecture operating systems).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's open another PR to verify this.
Considering timing of OSPP, I could skip this.

@wu-sheng wu-sheng merged commit 92af797 into apache:master Oct 30, 2023
166 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend OAP backend related. core feature Core and important feature. Sometimes, break backwards compatibility.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] GraalVM Build for OAP server
3 participants