-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
133 changed files
with
7,136 additions
and
272 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Hangfire; | ||
using OpenTelemetry.Trace; | ||
|
||
WebApplicationBuilder builder = WebApplication.CreateBuilder(args); | ||
|
||
// Add services to the container. | ||
|
||
builder | ||
.Services.AddAqua(builder.Configuration) | ||
.AddMongoDataAccess() | ||
.AddMongoHangfireJobClient() | ||
.AddServalAssessmentEngineService() | ||
.AddAquaService() | ||
.AddAquaMonitorService(); | ||
|
||
if (builder.Environment.IsDevelopment()) | ||
{ | ||
builder | ||
.Services.AddOpenTelemetry() | ||
.WithTracing(builder => | ||
{ | ||
builder | ||
.AddAspNetCoreInstrumentation() | ||
.AddHttpClientInstrumentation() | ||
.AddGrpcClientInstrumentation() | ||
.AddSource("MongoDB.Driver.Core.Extensions.DiagnosticSources") | ||
.AddConsoleExporter(); | ||
}); | ||
} | ||
|
||
WebApplication app = builder.Build(); | ||
|
||
// Configure the HTTP request pipeline. | ||
|
||
app.UseHttpsRedirection(); | ||
|
||
app.MapServalAssessmentEngineService(); | ||
app.MapHangfireDashboard(); | ||
|
||
app.Run(); |
13 changes: 13 additions & 0 deletions
13
src/Aqua/src/Serval.Aqua.EngineServer/Properties/launchSettings.json
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/launchsettings.json", | ||
"profiles": { | ||
"Serval.Aqua.EngineServer": { | ||
"commandName": "Project", | ||
"launchBrowser": false, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
}, | ||
"applicationUrl": "https://localhost:9100" | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Aqua/src/Serval.Aqua.EngineServer/Serval.Aqua.EngineServer.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<UserSecretsId>eec61cfb-a756-4bef-9167-323dcade8101</UserSecretsId> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.8.0" /> | ||
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.8.0" /> | ||
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" /> | ||
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.8.0-beta.1" /> | ||
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Serval.Aqua.Shared\Serval.Aqua.Shared.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
14 changes: 14 additions & 0 deletions
14
src/Aqua/src/Serval.Aqua.EngineServer/appsettings.Development.json
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"ConnectionStrings": { | ||
"Hangfire": "mongodb://localhost:27017/aqua_jobs", | ||
"Mongo": "mongodb://localhost:27017/aqua", | ||
"Serval": "https://localhost:8444" | ||
}, | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning", | ||
"System.Net.Http.HttpClient.Default": "Warning" | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"ConnectionStrings": { | ||
"Aqua": "https://tmv9bz5v4q.us-east-1.awsapprunner.com/latest/" | ||
}, | ||
"Aqua": { | ||
"JobPollingEnabled": true | ||
}, | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Hangfire; | ||
using OpenTelemetry.Trace; | ||
|
||
WebApplicationBuilder builder = WebApplication.CreateBuilder(args); | ||
|
||
// Add services to the container. | ||
|
||
builder | ||
.Services.AddAqua(builder.Configuration) | ||
.AddMongoDataAccess() | ||
.AddMongoHangfireJobClient() | ||
.AddServalPlatformService() | ||
.AddAquaService(); | ||
|
||
builder.Services.AddHangfireServer(); | ||
|
||
if (builder.Environment.IsDevelopment()) | ||
{ | ||
builder | ||
.Services.AddOpenTelemetry() | ||
.WithTracing(builder => | ||
{ | ||
builder | ||
.AddAspNetCoreInstrumentation() | ||
.AddHttpClientInstrumentation() | ||
.AddGrpcClientInstrumentation() | ||
.AddSource("MongoDB.Driver.Core.Extensions.DiagnosticSources") | ||
.AddConsoleExporter(); | ||
}); | ||
} | ||
|
||
WebApplication app = builder.Build(); | ||
|
||
app.Run(); |
13 changes: 13 additions & 0 deletions
13
src/Aqua/src/Serval.Aqua.JobServer/Properties/launchSettings.json
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/launchsettings.json", | ||
"profiles": { | ||
"Serval.Aqua.JobServer": { | ||
"commandName": "Project", | ||
"launchBrowser": false, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
}, | ||
"applicationUrl": "https://localhost:9101" | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Aqua/src/Serval.Aqua.JobServer/Serval.Aqua.JobServer.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<UserSecretsId>fc417e67-a798-4ef1-8700-b2f02c044ea7</UserSecretsId> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.8.0" /> | ||
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.8.0" /> | ||
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" /> | ||
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.8.0-beta.1" /> | ||
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Serval.Aqua.Shared\Serval.Aqua.Shared.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
14 changes: 14 additions & 0 deletions
14
src/Aqua/src/Serval.Aqua.JobServer/appsettings.Development.json
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"ConnectionStrings": { | ||
"Hangfire": "mongodb://localhost:27017/aqua_jobs", | ||
"Mongo": "mongodb://localhost:27017/aqua", | ||
"Serval": "https://localhost:8444" | ||
}, | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning", | ||
"System.Net.Http.HttpClient.Default": "Warning" | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"ConnectionStrings": { | ||
"Aqua": "https://tmv9bz5v4q.us-east-1.awsapprunner.com/latest/" | ||
}, | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Microsoft.Extensions.DependencyInjection; | ||
|
||
internal class AquaBuilder(IServiceCollection services, IConfiguration? configuration) : IAquaBuilder | ||
{ | ||
public IServiceCollection Services { get; } = services; | ||
public IConfiguration? Configuration { get; } = configuration; | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Aqua/src/Serval.Aqua.Shared/Configuration/AquaOptions.cs
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Serval.Aqua.Shared.Configuration; | ||
|
||
public class AquaOptions | ||
{ | ||
public const string Key = "Aqua"; | ||
|
||
public string Username { get; set; } = ""; | ||
public string Password { get; set; } = ""; | ||
public bool JobPollingEnabled { get; set; } = false; | ||
public TimeSpan JobPollingTimeout { get; set; } = TimeSpan.FromSeconds(10); | ||
} |
7 changes: 7 additions & 0 deletions
7
src/Aqua/src/Serval.Aqua.Shared/Configuration/IAquaBuilder.cs
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Microsoft.Extensions.DependencyInjection; | ||
|
||
public interface IAquaBuilder | ||
{ | ||
IServiceCollection Services { get; } | ||
IConfiguration? Configuration { get; } | ||
} |
Oops, something went wrong.