File tree 8 files changed +112
-0
lines changed
8 files changed +112
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ echo "Building the Rust demo"
27
27
make -C rust build
28
28
kubectl apply -f ./rust/deployment.yaml
29
29
30
+ echo " Building the .NET demo"
31
+
32
+ make -C dotnet build
33
+ kubectl apply -f ./dotnet/deployment.yaml
34
+
30
35
echo " Building the Python demo"
31
36
32
37
make -C python build
Original file line number Diff line number Diff line change
1
+ # Created by https://www.toptal.com/developers/gitignore/api/dotnetcore
2
+ # Edit at https://www.toptal.com/developers/gitignore?templates=dotnetcore
3
+
4
+ # ## DotnetCore ###
5
+ # .NET Core build folders
6
+ bin /
7
+ obj /
8
+
9
+ # Common node modules locations
10
+ /node_modules
11
+ /wwwroot /node_modules
12
+
13
+ # End of https://www.toptal.com/developers/gitignore/api/dotnetcore
14
+
Original file line number Diff line number Diff line change
1
+ FROM mcr.microsoft.com/dotnet/runtime:7.0 AS base
2
+ WORKDIR /app
3
+
4
+ # Creates a non-root user with an explicit UID and adds permission to access the /app folder
5
+ # For more info, please refer to https://aka.ms/vscode-docker-dotnet-configure-containers
6
+ RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
7
+ USER appuser
8
+
9
+ FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
10
+ WORKDIR /src
11
+ COPY ["demo.csproj" , "./" ]
12
+ RUN dotnet restore "demo.csproj"
13
+ COPY . .
14
+ WORKDIR "/src/."
15
+ RUN dotnet build "demo.csproj" -c Release -o /app/build
16
+
17
+ FROM build AS publish
18
+ RUN dotnet publish "demo.csproj" -c Release -o /app/publish
19
+
20
+ FROM base AS final
21
+ ENV DOTNET_PerfMapEnabled=1
22
+ WORKDIR /app
23
+ COPY --from=publish /app/publish .
24
+ ENTRYPOINT ["dotnet" , "demo.dll" ]
Original file line number Diff line number Diff line change
1
+ .PHONY : build
2
+ build :
3
+ docker build -t parca-demo:dotnet .
Original file line number Diff line number Diff line change
1
+ using System ;
2
+
3
+ namespace Demo
4
+ {
5
+ class Program
6
+ {
7
+ static int Fibonacci ( int n )
8
+ {
9
+ int a = 0 , b = 1 , tmp ;
10
+
11
+ for ( int i = 0 ; i < n ; i ++ )
12
+ {
13
+ tmp = a ;
14
+ a = b ;
15
+ b += tmp ;
16
+ }
17
+
18
+ return a ;
19
+ }
20
+
21
+ static void Main ( string [ ] args )
22
+ {
23
+ while ( true )
24
+ {
25
+ Console . WriteLine ( Fibonacci ( 42 ) ) ;
26
+ }
27
+ }
28
+ }
29
+ }
Original file line number Diff line number Diff line change
1
+ # .NET
2
+
3
+ See https://learn.microsoft.com/en-us/dotnet/core/runtime-config/debugging-profiling#export-perf-maps
Original file line number Diff line number Diff line change
1
+ <Project Sdk =" Microsoft.NET.Sdk" >
2
+
3
+ <PropertyGroup >
4
+ <OutputType >Exe</OutputType >
5
+ <TargetFramework >net7.0</TargetFramework >
6
+ <ImplicitUsings >enable</ImplicitUsings >
7
+ <Nullable >enable</Nullable >
8
+ </PropertyGroup >
9
+
10
+ </Project >
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ labels :
5
+ app.kubernetes.io/name : demo-dotnet
6
+ name : dotnet
7
+ namespace : parca
8
+ spec :
9
+ replicas : 3
10
+ selector :
11
+ matchLabels :
12
+ app.kubernetes.io/name : demo-dotnet
13
+ template :
14
+ metadata :
15
+ labels :
16
+ app.kubernetes.io/name : demo-dotnet
17
+ spec :
18
+ containers :
19
+ - image : parca-demo:dotnet
20
+ name : dotnet
21
+ resources :
22
+ limits :
23
+ cpu : ' 100m'
24
+ memory : ' 256Mi'
You can’t perform that action at this time.
0 commit comments