Skip to content

Commit de87ce0

Browse files
authored
Merge pull request #16 from thangchung/feat/up-aspire82
Upgrade aspire to 8.2.1 and add YARP standalone
2 parents 2468e20 + 661d603 commit de87ce0

File tree

15 files changed

+417
-328
lines changed

15 files changed

+417
-328
lines changed

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
<Nullable>enable</Nullable>
77
<LangVersion>preview</LangVersion>
88
<NoWarn>$(NoWarn);NU1507</NoWarn>
9+
<GarbageCollectionAdaptationMode>1</GarbageCollectionAdaptationMode>
910
</PropertyGroup>
1011
</Project>

Directory.Packages.props

Lines changed: 81 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,84 @@
11
<Project>
2-
<PropertyGroup>
3-
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4-
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
5-
<AspnetVersion>8.0.5</AspnetVersion>
6-
<MicrosoftExtensionsVersion>8.4.0</MicrosoftExtensionsVersion>
7-
<EfVersion>8.0.4</EfVersion>
8-
<AspireVersion>8.1.0</AspireVersion>
9-
<OpenTelemetryVersion>1.9.0</OpenTelemetryVersion>
10-
<AspirantVersion>0.0.4</AspirantVersion>
11-
<HealthCheckVersion>8.0.1</HealthCheckVersion>
12-
<AspVersioningVersion>8.1.0</AspVersioningVersion>
13-
<MassTransitVersion>8.2.4</MassTransitVersion>
14-
<MartenVersion>7.10.1</MartenVersion>
15-
</PropertyGroup>
16-
<ItemGroup>
17-
<PackageVersion Include="Microsoft.AspNet.WebApi.Core" Version="5.3.0" />
18-
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
19-
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.6" />
20-
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="$(AspnetVersion)" />
21-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="$(EfVersion)" PrivateAssets="all" />
22-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="$(EfVersion)" />
23-
<PackageVersion Include="Microsoft.OpenApi" Version="1.6.10" />
24-
<PackageVersion Include="Asp.Versioning.Http" Version="$(AspVersioningVersion)" />
25-
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="$(AspVersioningVersion)" />
26-
<PackageVersion Include="Asp.Versioning.Http.Client" Version="$(AspVersioningVersion)" />
27-
</ItemGroup>
28-
<ItemGroup>
29-
<PackageVersion Include="MediatR" Version="12.4.0" />
30-
<PackageVersion Include="FluentValidation.AspNetCore" Version="11.3.0" />
31-
<PackageVersion Include="FluentValidation" Version="11.9.2" />
32-
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
33-
<PackageVersion Include="Riok.Mapperly" Version="3.5.1" ExcludeAssets="runtime" PrivateAssets="all" />
34-
<PackageVersion Include="MassTransit" Version="$(MassTransitVersion)" />
35-
<PackageVersion Include="MassTransit.RabbitMQ" Version="$(MassTransitVersion)" />
36-
<PackageVersion Include="Marten.AspNetCore" Version="$(MartenVersion)" />
37-
<PackageVersion Include="Marten" Version="$(MartenVersion)" />
38-
<PackageVersion Include="Yarp.ReverseProxy" Version="2.1.0" />
39-
</ItemGroup>
40-
<ItemGroup>
41-
<!-- Aspire -->
42-
<PackageVersion Include="Aspire.Hosting" Version="$(AspireVersion)" />
43-
<PackageVersion Include="Aspire.Hosting.AppHost" Version="$(AspireVersion)" />
44-
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="$(AspireVersion)" />
45-
<PackageVersion Include="Aspire.Hosting.RabbitMQ" Version="$(AspireVersion)" />
46-
<PackageVersion Include="Aspire.Hosting.Redis" Version="$(AspireVersion)" />
47-
<PackageVersion Include="Aspirant.Hosting" Version="$(AspirantVersion)" />
48-
<PackageVersion Include="Aspirant.Hosting.Yarp" Version="$(AspirantVersion)" />
49-
<PackageVersion Include="Aspirant.Hosting.Testing" Version="$(AspirantVersion)" />
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
5+
<AspnetVersion>8.0.6</AspnetVersion>
6+
<MicrosoftExtensionsVersion>8.4.0</MicrosoftExtensionsVersion>
7+
<EfVersion>8.0.8</EfVersion>
8+
<AspireVersion>8.2.1</AspireVersion>
9+
<OpenTelemetryVersion>1.9.0</OpenTelemetryVersion>
10+
<AspirantVersion>0.0.4</AspirantVersion>
11+
<HealthCheckVersion>8.0.1</HealthCheckVersion>
12+
<AspVersioningVersion>8.1.0</AspVersioningVersion>
13+
<MassTransitVersion>8.2.4</MassTransitVersion>
14+
<MartenVersion>7.10.1</MartenVersion>
15+
</PropertyGroup>
16+
<ItemGroup>
17+
<PackageVersion Include="Microsoft.AspNet.WebApi.Core" Version="5.3.0" />
18+
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
19+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="$(AspnetVersion)" />
20+
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="$(AspnetVersion)" />
21+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="$(EfVersion)" PrivateAssets="all" />
22+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="$(EfVersion)" />
23+
<PackageVersion Include="Microsoft.OpenApi" Version="1.6.10" />
24+
</ItemGroup>
25+
<ItemGroup>
26+
<PackageVersion Include="MediatR" Version="12.4.0" />
27+
<PackageVersion Include="FluentValidation.AspNetCore" Version="11.3.0" />
28+
<PackageVersion Include="FluentValidation" Version="11.9.2" />
29+
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
30+
<PackageVersion Include="Riok.Mapperly" Version="3.5.1" ExcludeAssets="runtime" PrivateAssets="all" />
31+
<PackageVersion Include="MassTransit" Version="$(MassTransitVersion)" />
32+
<PackageVersion Include="MassTransit.RabbitMQ" Version="$(MassTransitVersion)" />
33+
<PackageVersion Include="Marten.AspNetCore" Version="$(MartenVersion)" />
34+
<PackageVersion Include="Marten" Version="$(MartenVersion)" />
35+
<PackageVersion Include="Yarp.ReverseProxy" Version="2.2.0" />
36+
</ItemGroup>
37+
<ItemGroup>
38+
<!-- Asp Versioning -->
39+
<PackageVersion Include="Asp.Versioning.Http" Version="$(AspVersioningVersion)" />
40+
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="$(AspVersioningVersion)" />
41+
<PackageVersion Include="Asp.Versioning.Http.Client" Version="$(AspVersioningVersion)" />
42+
</ItemGroup>
43+
<ItemGroup>
44+
<!-- Aspire -->
45+
<PackageVersion Include="Aspire.Hosting" Version="$(AspireVersion)" />
46+
<PackageVersion Include="Aspire.Hosting.AppHost" Version="$(AspireVersion)" />
47+
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="$(AspireVersion)" />
48+
<PackageVersion Include="Aspire.Hosting.RabbitMQ" Version="$(AspireVersion)" />
49+
<PackageVersion Include="Aspire.Hosting.Redis" Version="$(AspireVersion)" />
50+
<PackageVersion Include="Aspirant.Hosting" Version="$(AspirantVersion)" />
51+
<PackageVersion Include="Aspirant.Hosting.Yarp" Version="$(AspirantVersion)" />
52+
<PackageVersion Include="Aspirant.Hosting.Testing" Version="$(AspirantVersion)" />
5053
<PackageVersion Include="WireMock.Net.Aspire" Version="0.0.1-preview-05" />
51-
<!-- Aspire Custom Extensions -->
52-
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.7.0" />
53-
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="$(AspireVersion)" />
54-
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="$(OpenTelemetryVersion)" />
55-
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="$(OpenTelemetryVersion)" />
56-
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="$(OpenTelemetryVersion)" />
57-
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="$(OpenTelemetryVersion)" />
58-
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="$(OpenTelemetryVersion)" />
59-
<PackageVersion Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.3.0-beta.2" />
60-
<PackageVersion Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.2.0-beta.4" />
61-
</ItemGroup>
62-
<ItemGroup>
63-
<!-- Healthchecks -->
64-
<PackageVersion Include="AspNetCore.HealthChecks.Uris" Version="$(HealthCheckVersion)" />
65-
<PackageVersion Include="AspNetCore.HealthChecks.NpgSql" Version="$(HealthCheckVersion)" />
66-
<PackageVersion Include="AspNetCore.HealthChecks.Rabbitmq" Version="$(HealthCheckVersion)" />
67-
<PackageVersion Include="AspNetCore.HealthChecks.Redis" Version="$(HealthCheckVersion)" />
68-
</ItemGroup>
69-
<ItemGroup>
70-
<!-- Testing -->
71-
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
72-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
73-
<PackageVersion Include="xunit" Version="2.5.3" />
74-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
75-
<PackageVersion Include="MSTest" Version="3.2.0" />
76-
<PackageVersion Include="ReportGenerator" Version="5.3.6" />
77-
</ItemGroup>
54+
<!-- Aspire Custom Extensions -->
55+
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.7.0" />
56+
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="$(AspireVersion)" />
57+
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery.Abstractions" Version="$(AspireVersion)" />
58+
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery.Yarp" Version="$(AspireVersion)" />
59+
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery.Dns" Version="$(AspireVersion)" />
60+
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="$(OpenTelemetryVersion)" />
61+
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="$(OpenTelemetryVersion)" />
62+
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="$(OpenTelemetryVersion)" />
63+
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="$(OpenTelemetryVersion)" />
64+
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="$(OpenTelemetryVersion)" />
65+
<!--<PackageVersion Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.3.0-beta.2" />
66+
<PackageVersion Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.2.0-beta.4" />-->
67+
</ItemGroup>
68+
<ItemGroup>
69+
<!-- Healthchecks -->
70+
<PackageVersion Include="AspNetCore.HealthChecks.Uris" Version="$(HealthCheckVersion)" />
71+
<PackageVersion Include="AspNetCore.HealthChecks.NpgSql" Version="$(HealthCheckVersion)" />
72+
<PackageVersion Include="AspNetCore.HealthChecks.Rabbitmq" Version="$(HealthCheckVersion)" />
73+
<PackageVersion Include="AspNetCore.HealthChecks.Redis" Version="$(HealthCheckVersion)" />
74+
</ItemGroup>
75+
<ItemGroup>
76+
<!-- Testing -->
77+
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
78+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
79+
<PackageVersion Include="xunit" Version="2.5.3" />
80+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
81+
<PackageVersion Include="MSTest" Version="3.2.0" />
82+
<PackageVersion Include="ReportGenerator" Version="5.3.6" />
83+
</ItemGroup>
7884
</Project>

app-host/CoffeeShop.AppHost.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Aspire.Hosting" />
1312
<PackageReference Include="Aspire.Hosting.AppHost" />
1413
<PackageReference Include="Aspire.Hosting.PostgreSQL" />
1514
<PackageReference Include="Aspire.Hosting.Redis" />
1615
<PackageReference Include="Aspire.Hosting.RabbitMQ" />
1716
<PackageReference Include="Aspirant.Hosting" />
18-
<PackageReference Include="Aspirant.Hosting.Yarp" />
1917
<PackageReference Include="Yarp.ReverseProxy" />
2018
</ItemGroup>
2119

@@ -32,6 +30,7 @@
3230
<ProjectReference Include="..\counter-api\CoffeeShop.CounterApi.csproj" />
3331
<ProjectReference Include="..\barista-api\CoffeeShop.BaristaApi.csproj" />
3432
<ProjectReference Include="..\kitchen-api\CoffeeShop.KitchenApi.csproj" />
33+
<ProjectReference Include="..\yarp\CoffeeShop.Yarp\CoffeeShop.Yarp.csproj" />
3534
</ItemGroup>
3635

3736
</Project>

app-host/Program.cs

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,35 @@
1111
var rabbitmq = builder.AddRabbitMQ("rabbitmq").WithHealthCheck().WithManagementPlugin();
1212

1313
var productApi = builder.AddProject<Projects.CoffeeShop_ProductApi>("product-api")
14-
.WithSwaggerUI();
14+
.WithSwaggerUI();
1515

1616
var counterApi = builder.AddProject<Projects.CoffeeShop_CounterApi>("counter-api")
17-
.WithReference(productApi)
18-
.WithReference(rabbitmq)
19-
.WaitFor(rabbitmq)
20-
.WithSwaggerUI();
17+
.WithReference(productApi)
18+
.WithReference(rabbitmq)
19+
.WaitFor(rabbitmq)
20+
.WithSwaggerUI();
2121

2222
builder.AddProject<Projects.CoffeeShop_BaristaApi>("barista-api")
23-
.WithReference(rabbitmq)
24-
.WaitFor(rabbitmq);
23+
.WithReference(rabbitmq)
24+
.WaitFor(rabbitmq);
2525

2626
builder.AddProject<Projects.CoffeeShop_KitchenApi>("kitchen-api")
27-
.WithReference(rabbitmq)
28-
.WaitFor(rabbitmq);
27+
.WithReference(rabbitmq)
28+
.WaitFor(rabbitmq);
2929

3030
var orderSummaryApi = builder.AddProject<Projects.CoffeeShop_OrderSummary>("order-summary")
31-
.WithReference(postgres)
32-
.WithReference(rabbitmq)
33-
.WaitFor(postgres)
34-
.WaitFor(rabbitmq)
35-
.WithSwaggerUI();
36-
37-
var isHttps = builder.Configuration["DOTNET_LAUNCH_PROFILE"] == "https";
38-
var ingressPort = int.TryParse(builder.Configuration["Ingress:Port"], out var port) ? port : (int?)null;
31+
.WithReference(postgres)
32+
.WithReference(rabbitmq)
33+
.WaitFor(postgres)
34+
.WaitFor(rabbitmq)
35+
.WithSwaggerUI();
3936

40-
builder.AddYarp("ingress")
41-
.WithEndpoint(scheme: isHttps ? "https" : "http", port: ingressPort)
37+
builder.AddProject<Projects.CoffeeShop_Yarp>("yarp")
4238
.WithReference(productApi)
4339
.WithReference(counterApi)
4440
.WithReference(orderSummaryApi)
45-
.LoadFromConfiguration("ReverseProxy");
41+
.WaitFor(productApi)
42+
.WaitFor(counterApi)
43+
.WaitFor(orderSummaryApi);
4644

4745
builder.Build().Run();

0 commit comments

Comments
 (0)