-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from TimeWarpEngineering/Cramer/2024-05-21/As…
…pire Replace Tye with Aspire :)
- Loading branch information
Showing
61 changed files
with
1,021 additions
and
970 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,19 +1,13 @@ | ||
# Run.ps1 | ||
$Env:ASPNETCORE_ENVIRONMENT = "Development" | ||
|
||
Push-Location $PSScriptRoot | ||
try { | ||
# Start Cosmos DB emulator | ||
# see https://timewarpengineering.github.io/timewarp-architecture/#prerequisites | ||
# Start-CosmosDbEmulator | ||
# TODO add check for CosmosDB emulator to be running | ||
|
||
Push-Location DevOps/Tye | ||
# dotnet build -c Release | ||
# tye run --dashboard --logs console -v Debug --no-build | ||
tye run --dashboard --watch --logs console -v Debug | ||
# Start-Process pwsh -argument '-nologo -noprofile -executionpolicy bypass -command tye run --dashboard --logs console' | ||
Pop-Location | ||
try | ||
{ | ||
$projectPath = "Source/ContainerApps/Aspire/Aspire.AppHost/Aspire.AppHost.csproj" | ||
dotnet run --project $projectPath | ||
} | ||
finally { | ||
finally | ||
{ | ||
Pop-Location | ||
} |
3 changes: 2 additions & 1 deletion
3
...ps/Web/Web.Spa/Configuration/Constants.cs → ...n.Contracts/Configuration/ServiceNames.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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
namespace TimeWarp.Architecture.Configuration; | ||
public static class Constants | ||
public static class ServiceNames | ||
{ | ||
public const string ApiServiceName = "api-server"; | ||
public const string GrpcServiceName = "grpc-server"; | ||
public const string WebServiceName = "web-server"; | ||
public const string YarpServiceName = "yarp"; | ||
} |
21 changes: 21 additions & 0 deletions
21
TimeWarp.Architecture/Source/Common/Common.Server/Extensions/ServiceUriHelper.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,21 @@ | ||
namespace TimeWarp.Architecture.Extensions; | ||
|
||
public static class ServiceUriHelper | ||
{ | ||
public static Uri? GetServiceHttpUri(string resourceName, int index = 0) => | ||
GetServiceUri(resourceName,"http", index); | ||
|
||
public static Uri? GetServiceHttpsUri(string resourceName, int index = 0) => | ||
GetServiceUri(resourceName, "https", index); | ||
|
||
private static Uri? GetServiceUri(string resourceName, string endpointName, int index) | ||
{ | ||
Guard.Against.NullOrWhiteSpace(resourceName, nameof(resourceName)); | ||
Guard.Against.NullOrWhiteSpace(endpointName, nameof(endpointName)); | ||
Guard.Against.Negative(index, nameof(index)); | ||
|
||
string? url = Environment.GetEnvironmentVariable($"services__{resourceName}__{endpointName}__{index}"); | ||
|
||
return url is null ? null : new Uri(url); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
TimeWarp.Architecture/Source/Common/Common.Server/GlobalUsings.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
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
12 changes: 12 additions & 0 deletions
12
TimeWarp.Architecture/Source/ContainerApps/Api/Api.Server/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,12 @@ | ||
{ | ||
"profiles": { | ||
"Api.Server": { | ||
"commandName": "Project", | ||
"launchBrowser": true, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
}, | ||
"applicationUrl": "https://localhost:63612;http://localhost:63622" | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
TimeWarp.Architecture/Source/ContainerApps/Aspire/Aspire.AppHost/Aspire.AppHost.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,23 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<IsAspireHost>true</IsAspireHost> | ||
<UserSecretsId>a3d4de92-958f-4e04-b927-9d7605bee60e</UserSecretsId> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Aspire.Hosting.AppHost" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Api\Api.Server\Api.Server.csproj" /> | ||
<ProjectReference Include="..\..\Grpc\Grpc.Server\Grpc.Server.csproj" /> | ||
<ProjectReference Include="..\..\Web\Web.Server\Web.Server.csproj" /> | ||
<ProjectReference Include="..\..\Yarp\Yarp.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
20 changes: 20 additions & 0 deletions
20
TimeWarp.Architecture/Source/ContainerApps/Aspire/Aspire.AppHost/Program.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,20 @@ | ||
IDistributedApplicationBuilder builder = DistributedApplication.CreateBuilder(args); | ||
|
||
IResourceBuilder<ProjectResource> apiServer =builder.AddProject<Projects.Api_Server>("api-server"); | ||
IResourceBuilder<ProjectResource> grpcServer = builder.AddProject<Projects.Grpc_Server>("grpc-server"); | ||
|
||
IResourceBuilder<ProjectResource> webServer = | ||
builder | ||
.AddProject<Projects.Web_Server>("web-server") | ||
.WithExternalHttpEndpoints() | ||
.WithReference(apiServer) | ||
.WithReference(grpcServer); | ||
|
||
webServer.WithReference(webServer); | ||
|
||
builder.AddProject<Projects.Yarp>("yarp") | ||
.WithReference(apiServer) | ||
.WithReference(webServer) | ||
.WithReference(grpcServer); | ||
|
||
builder.Build().Run(); |
Oops, something went wrong.