Browse Source

Add Sisk (#8665)

* Add Sisk

* upgrade sisk version
Gabriel Scatolin 1 year ago
parent
commit
2638fd9606

+ 39 - 0
frameworks/CSharp/sisk/.gitignore

@@ -0,0 +1,39 @@
+[Oo]bj/
+[Bb]in/
+TestResults/
+.nuget/
+*.sln
+*.sln.ide/
+_ReSharper.*/
+.idea/
+packages/
+artifacts/
+PublishProfiles/
+*.sln
+.vs/
+*.user
+*.suo
+*.cache
+*.docstates
+_ReSharper.*
+nuget.exe
+*net45.csproj
+*net451.csproj
+*k10.csproj
+*.psess
+*.vsp
+*.pidb
+*.userprefs
+*DS_Store
+*.ncrunchsolution
+*.*sdf
+*.ipch
+*.swp
+*~
+.build/
+.testPublish/
+launchSettings.json
+BenchmarkDotNet.Artifacts/
+BDN.Generated/
+binaries/
+global.json

+ 18 - 0
frameworks/CSharp/sisk/README.md

@@ -0,0 +1,18 @@
+# Sisk benchmark
+
+See the [Sisk Framework website](https://sisk.project-principium.dev/) for more information.
+
+## Infrastructure Software Versions
+
+**Language**
+
+* C# 11.0
+
+**Platforms**
+
+* .NET Core
+
+## Paths & Source for Tests
+
+* [Plaintext](sisk/Program.cs): "/plaintext"
+* [JSON](sisk/Program.cs): "/json"

+ 21 - 0
frameworks/CSharp/sisk/benchmark_config.json

@@ -0,0 +1,21 @@
+{
+  "framework": "sisk",
+  "tests": [{
+    "default": {
+      "plaintext_url": "/plaintext",
+      "json_url": "/json",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "None",
+      "framework": "Sisk",
+      "language": "C#",
+      "orm": "Raw",
+      "platform": ".NET",
+      "webserver": "Sisk",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "Sisk Framework"
+    }
+  }]
+}

+ 15 - 0
frameworks/CSharp/sisk/config.toml

@@ -0,0 +1,15 @@
+[framework]
+name = "sisk"
+
+[main]
+urls.plaintext = "/plaintext"
+urls.json = "/json"
+approach = "Realistic"
+classification = "Fullstack"
+database = "None"
+database_os = "Linux"
+os = "Linux"
+orm = "Raw"
+platform = ".NET"
+webserver = "Sisk"
+versus = "None"

+ 19 - 0
frameworks/CSharp/sisk/sisk.dockerfile

@@ -0,0 +1,19 @@
+FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
+WORKDIR /source
+
+# copy csproj and restore as distinct layers
+COPY sisk/*.csproj .
+RUN dotnet restore -r linux-musl-x64
+
+# copy and publish app and libraries
+COPY sisk/ .
+RUN dotnet publish -c release -o /app -r linux-musl-x64
+
+# final stage/image
+FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
+WORKDIR /app
+COPY --from=build /app .
+
+ENTRYPOINT ["dotnet", "./sisk.dll"]
+
+EXPOSE 8080

+ 26 - 0
frameworks/CSharp/sisk/sisk/Program.cs

@@ -0,0 +1,26 @@
+using Sisk.Core.Http;
+using Sisk.Core.Routing;
+using System.Net.Http.Json;
+
+var app = HttpServer.CreateBuilder(host =>
+{
+    host.UseListeningPort("http://+:8080/");
+});
+
+app.Router.SetRoute(RouteMethod.Get, "/plaintext", PlainText);
+app.Router.SetRoute(RouteMethod.Get, "/json", Json);
+
+app.Start();
+
+static HttpResponse PlainText(HttpRequest request)
+{
+    return new HttpResponse().WithContent("Hello, world!");
+}
+
+static HttpResponse Json(HttpRequest request)
+{
+    return new HttpResponse().WithContent(JsonContent.Create(new
+    {
+        message = "Hello, world!"
+    }));
+}

+ 15 - 0
frameworks/CSharp/sisk/sisk/sisk.csproj

@@ -0,0 +1,15 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+	<PropertyGroup>
+		<OutputType>Exe</OutputType>
+		<TargetFramework>net8.0</TargetFramework>
+		<ImplicitUsings>enable</ImplicitUsings>
+		<Nullable>enable</Nullable>
+		<ServerGarbageCollection>true</ServerGarbageCollection>
+	</PropertyGroup>
+
+	<ItemGroup>
+	  <PackageReference Include="Sisk.HttpServer" Version="0.16.0-rc-5" />
+	</ItemGroup>
+
+</Project>