-
Notifications
You must be signed in to change notification settings - Fork 609
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
chore: Add dotnet SDKv8 support for examples #3493
Merged
Merged
Changes from all commits
Commits
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 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
examples/language-sdk-instrumentation/dotnet/rideshare/example/Example.csproj
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,14 +1,33 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine | ||
ARG SDK_VERSION=8.0 | ||
# The build images takes an SDK image of the buildplatform, so the platform the build is running on. | ||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:$SDK_VERSION-alpine AS build | ||
|
||
ARG TARGETPLATFORM | ||
ARG BUILDPLATFORM | ||
ARG SDK_VERSION | ||
|
||
WORKDIR /dotnet | ||
|
||
COPY --from=pyroscope/pyroscope-dotnet:0.8.19-musl /Pyroscope.Profiler.Native.so ./Pyroscope.Profiler.Native.so | ||
COPY --from=pyroscope/pyroscope-dotnet:0.8.19-musl /Pyroscope.Linux.ApiWrapper.x64.so ./Pyroscope.Linux.ApiWrapper.x64.so | ||
ADD example . | ||
|
||
# Set the target framework to SDK_VERSION | ||
RUN sed -i -E 's|<TargetFramework>.*</TargetFramework>|<TargetFramework>net'$SDK_VERSION'</TargetFramework>|' Example.csproj | ||
|
||
ADD example . | ||
# We hardcode linux-x64 here, as the profiler doesn't support any other platform | ||
RUN dotnet publish -o . --framework net$SDK_VERSION --runtime linux-musl-x64 --no-self-contained | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am fairly certain this is the case, but just double checking |
||
|
||
# This fetches the SDK | ||
FROM --platform=linux/amd64 pyroscope/pyroscope-dotnet:0.8.20-musl AS sdk | ||
|
||
# Runtime only image of the targetplatfrom, so the platform the image will be running on. | ||
FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/aspnet:$SDK_VERSION-alpine | ||
|
||
WORKDIR /dotnet | ||
|
||
COPY --from=sdk /Pyroscope.Profiler.Native.so ./Pyroscope.Profiler.Native.so | ||
COPY --from=sdk /Pyroscope.Linux.ApiWrapper.x64.so ./Pyroscope.Linux.ApiWrapper.x64.so | ||
COPY --from=build /dotnet/ ./ | ||
|
||
RUN dotnet publish -o . -r $(dotnet --info | grep RID | cut -b 6- | tr -d ' ') | ||
|
||
ENV CORECLR_ENABLE_PROFILING=1 | ||
ENV CORECLR_PROFILER={BD1A650D-AC5D-4896-B64F-D6FA25D6B26A} | ||
|
@@ -22,6 +41,8 @@ ENV PYROSCOPE_PROFILING_ENABLED=1 | |
ENV PYROSCOPE_PROFILING_ALLOCATION_ENABLED=true | ||
ENV PYROSCOPE_PROFILING_CONTENTION_ENABLED=true | ||
ENV PYROSCOPE_PROFILING_EXCEPTION_ENABLED=true | ||
ENV PYROSCOPE_PROFILING_HEAP_ENABLED=true | ||
ENV RIDESHARE_LISTEN_PORT=5000 | ||
|
||
|
||
CMD sh -c "ASPNETCORE_URLS=http://*:${RIDESHARE_LISTEN_PORT} exec dotnet /dotnet/example.dll" |
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was something I would like to test, in order for it to work we need SDKv7+