Skip to content

Commit 8dba511

Browse files
authored
Merge pull request #1056 from CommunityToolkit/aspire-13.1
Aspire-13.1
2 parents 20eacc8 + 68e2f26 commit 8dba511

File tree

89 files changed

+408
-344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+408
-344
lines changed

.github/agents/hosting-integration-creator.agent.md

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ Each hosting integration should have a corresponding sample application in the `
238238
Here is an example of the `csproj` file for the AppHost project for the Bun hosting integration:
239239

240240
```xml
241-
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
241+
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">
242242

243243
<PropertyGroup>
244244
<OutputType>Exe</OutputType>
@@ -348,9 +348,9 @@ When creating hosting integrations for programming languages (e.g., Golang, Rust
348348

349349
Language-based hosting integrations should support the ecosystem's package managers and dependency management:
350350

351-
- **Build Tags/Features**: Allow users to specify conditional compilation flags (e.g., Go build tags: `buildTags: ["dev", "production"]`)
352-
- **Dependency Installation**: Optionally support automatic dependency installation before running (e.g., `go mod download`, `npm install`)
353-
- **Executable Path Flexibility**: Support both default entry points (e.g., `"."` for Go) and custom paths (e.g., `"./cmd/server"`)
351+
- **Build Tags/Features**: Allow users to specify conditional compilation flags (e.g., Go build tags: `buildTags: ["dev", "production"]`)
352+
- **Dependency Installation**: Optionally support automatic dependency installation before running (e.g., `go mod download`, `npm install`)
353+
- **Executable Path Flexibility**: Support both default entry points (e.g., `"."` for Go) and custom paths (e.g., `"./cmd/server"`)
354354

355355
Example from Golang integration:
356356

@@ -380,10 +380,10 @@ public static IResourceBuilder<GolangAppExecutableResource> AddGolangApp(
380380

381381
Language-based integrations should automatically generate optimized Dockerfiles using multi-stage builds when publishing:
382382

383-
- **Build Stage**: Uses the language's official SDK image to compile/build the application
384-
- **Runtime Stage**: Uses a minimal base image (e.g., Alpine Linux) for smaller final images
385-
- **Security**: Install necessary certificates (e.g., CA certificates for HTTPS support)
386-
- **Optimization**: Disable unnecessary features in build (e.g., `CGO_ENABLED=0` for Go)
383+
- **Build Stage**: Uses the language's official SDK image to compile/build the application
384+
- **Runtime Stage**: Uses a minimal base image (e.g., Alpine Linux) for smaller final images
385+
- **Security**: Install necessary certificates (e.g., CA certificates for HTTPS support)
386+
- **Optimization**: Disable unnecessary features in build (e.g., `CGO_ENABLED=0` for Go)
387387

388388
Example from Golang integration:
389389

@@ -437,8 +437,8 @@ private static IResourceBuilder<GolangAppExecutableResource> PublishAsGolangDock
437437

438438
For language integrations that may need secure connections:
439439

440-
- **CA Certificates**: Install CA certificates in runtime image for HTTPS client requests
441-
- **Runtime Configuration**: Ensure the generated container supports TLS connections (e.g., `apk --no-cache add ca-certificates`)
440+
- **CA Certificates**: Install CA certificates in runtime image for HTTPS client requests
441+
- **Runtime Configuration**: Ensure the generated container supports TLS connections (e.g., `apk --no-cache add ca-certificates`)
442442

443443
Example from Golang Dockerfile generation:
444444

@@ -454,9 +454,9 @@ context.Builder
454454

455455
Automatically detect and use the appropriate language version from project files:
456456

457-
- **Project Files**: Parse version from language-specific files (e.g., `go.mod`, `package.json`, `Cargo.toml`)
458-
- **Installed Toolchain**: Fall back to the installed language toolchain version
459-
- **Default Version**: Use a sensible default if detection fails
457+
- **Project Files**: Parse version from language-specific files (e.g., `go.mod`, `package.json`, `Cargo.toml`)
458+
- **Installed Toolchain**: Fall back to the installed language toolchain version
459+
- **Default Version**: Use a sensible default if detection fails
460460

461461
Example from Golang integration:
462462

@@ -536,9 +536,9 @@ internal static string? DetectGoVersion(string workingDirectory, ILogger logger)
536536

537537
Allow users to customize base images for both build and runtime stages:
538538

539-
- **Customizable Build Image**: Let users override the builder/SDK image (e.g., `golang:1.22-alpine` instead of `golang:1.22`)
540-
- **Customizable Runtime Image**: Let users override the runtime image (e.g., `alpine:3.20` instead of `alpine:3.21`)
541-
- **Annotation-Based Configuration**: Use annotations to store custom base image settings
539+
- **Customizable Build Image**: Let users override the builder/SDK image (e.g., `golang:1.22-alpine` instead of `golang:1.22`)
540+
- **Customizable Runtime Image**: Let users override the runtime image (e.g., `alpine:3.20` instead of `alpine:3.21`)
541+
- **Annotation-Based Configuration**: Use annotations to store custom base image settings
542542

543543
Example annotation and extension method:
544544

@@ -579,11 +579,11 @@ var golang = builder.AddGolangApp("golang", "../gin-api")
579579

580580
For language-based integrations, the README.md should include:
581581

582-
- **Publishing Section**: Explain automatic Dockerfile generation
583-
- **Version Detection**: Document how version detection works
584-
- **Customization Options**: Show how to customize base images
585-
- **TLS Support**: Note that CA certificates are included for HTTPS
586-
- **Build Options**: Document package manager flags, build tags, etc.
582+
- **Publishing Section**: Explain automatic Dockerfile generation
583+
- **Version Detection**: Document how version detection works
584+
- **Customization Options**: Show how to customize base images
585+
- **TLS Support**: Note that CA certificates are included for HTTPS
586+
- **Build Options**: Document package manager flags, build tags, etc.
587587

588588
Example README structure:
589589

@@ -595,6 +595,7 @@ When publishing your Aspire application, the [Language] resource automatically g
595595
### Automatic Version Detection
596596

597597
The integration automatically detects the [Language] version to use by:
598+
598599
1. Checking the [project file] for the version directive
599600
2. Falling back to the installed toolchain version
600601
3. Using [version] as the default if no version is detected
@@ -608,17 +609,19 @@ You can customize the base images used in the Dockerfile:
608609
### Generated Dockerfile
609610

610611
The automatically generated Dockerfile:
611-
- Uses the detected or default [Language] version as the build stage
612-
- Uses a minimal runtime image for a smaller final image
613-
- Installs CA certificates for HTTPS support
614-
- Respects build options if specified
612+
613+
- Uses the detected or default [Language] version as the build stage
614+
- Uses a minimal runtime image for a smaller final image
615+
- Installs CA certificates for HTTPS support
616+
- Respects build options if specified
615617
```
616618

617619
### Testing Considerations
618620

619621
When testing language-based integrations:
620622

621-
- **Unit Tests**: Verify build arguments, version detection logic, and annotation handling
622-
- **Integration Tests**: Test the full publishing workflow if possible
623-
- **Version Detection Tests**: Mock file system and process execution to test version detection
624-
- **Dockerfile Generation**: Verify the generated Dockerfile structure matches expectations
623+
- **Unit Tests**: Verify build arguments, version detection logic, and annotation handling
624+
- **Integration Tests**: Test the full publishing workflow if possible
625+
- **Version Detection Tests**: Mock file system and process execution to test version detection
626+
- **Dockerfile Generation**: Verify the generated Dockerfile structure matches expectations
627+

.github/chatmodes/New Aspire Hosting integration.chatmode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ dotnet new aspire-apphost -n CommunityToolkit.Aspire.Hosting.<HostingIntegration
217217

218218
Make sure to add the project to the solution with `dotnet sln add examples/CommunityToolkit.Aspire.Hosting.<HostingIntegrationName>.AppHost`.
219219

220-
Once created, refer to existing AppHost `csproj` files to ensure that the right packages are referenced, such as `CommunityToolkit.Aspire.Hosting.<HostingIntegrationName>`. For the `Sdk`, ensure the version is `$(AspireAppHostSdkVersion)`, since we use a MSBuild variable to ensure that a consistent version is used across all App Host projects. Any `PackageReference` elements should **not** have a version specified.
220+
Once created, refer to existing AppHost `csproj` files to ensure that the right packages are referenced, such as `CommunityToolkit.Aspire.Hosting.<HostingIntegrationName>`. Any `PackageReference` elements should **not** have a version specified.
221221

222222
Next, edit the `AppHost.cs` file that the template created to use the hosting integration.
223223

Directory.Build.props

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
<Nullable>enable</Nullable>
1313

1414
<AspireMajorVersion>13</AspireMajorVersion>
15-
<AspireVersion>$(AspireMajorVersion).0.0</AspireVersion>
16-
<AspireAppHostSdkVersion>$(AspireVersion)</AspireAppHostSdkVersion>
17-
<AspirePreviewSuffix>preview.1.25560.3</AspirePreviewSuffix>
15+
<AspireVersion>$(AspireMajorVersion).1.0</AspireVersion>
16+
<AspirePreviewSuffix>-preview.1.25616.3</AspirePreviewSuffix>
1817
<AspNetCoreVersion>9.0.0</AspNetCoreVersion>
19-
<DotNetExtensionsVersion>10.0.0</DotNetExtensionsVersion>
18+
<DotNetExtensionsVersion>10.0.1</DotNetExtensionsVersion>
2019
<OpenTelemetryVersion>1.12.0</OpenTelemetryVersion>
2120
<TestContainersVersion>4.8.1</TestContainersVersion>
22-
<MEAIVersion>9.9.0</MEAIVersion>
21+
<MEAIVersion>10.0.0</MEAIVersion>
2322
<ServiceDiscoveryVersion>10.0.0</ServiceDiscoveryVersion>
2423
<IsPackable>false</IsPackable>
2524
<MoqVersion>4.20.72</MoqVersion>
@@ -40,8 +39,8 @@
4039

4140
<!-- Versioning -->
4241
<PropertyGroup>
43-
<ToolkitMinorVersion>0</ToolkitMinorVersion>
44-
<ToolkitPatchVersion>1</ToolkitPatchVersion>
42+
<ToolkitMinorVersion>1</ToolkitMinorVersion>
43+
<ToolkitPatchVersion>0</ToolkitPatchVersion>
4544
<ToolkitPreviewVersion>preview.1</ToolkitPreviewVersion>
4645

4746
<VersionPrefix>$(AspireMajorVersion).$(ToolkitMinorVersion).$(ToolkitPatchVersion)</VersionPrefix>

Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<PackageVersion Include="Aspire.Hosting.Azure.AppContainers" Version="$(AspireVersion)" />
1111
<PackageVersion Include="Aspire.Hosting.Azure.Redis" Version="$(AspireVersion)" />
1212
<PackageVersion Include="Aspire.Hosting.Elasticsearch" Version="$(AspireVersion)" />
13-
<PackageVersion Include="Aspire.Hosting.Keycloak" Version="$(AspireVersion)-$(AspirePreviewSuffix)" />
14-
<PackageVersion Include="Aspire.Keycloak.Authentication" Version="$(AspireVersion)-$(AspirePreviewSuffix)" />
13+
<PackageVersion Include="Aspire.Hosting.Keycloak" Version="$(AspireVersion)$(AspirePreviewSuffix)" />
14+
<PackageVersion Include="Aspire.Keycloak.Authentication" Version="$(AspireVersion)$(AspirePreviewSuffix)" />
1515
<PackageVersion Include="Aspire.Hosting.JavaScript" Version="$(AspireVersion)" />
1616
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="$(AspireVersion)" />
1717
<PackageVersion Include="Aspire.Hosting.Python" Version="$(AspireVersion)" />
@@ -68,7 +68,7 @@
6868
<!-- External packages -->
6969
<PackageVersion Include="Azure.Provisioning.AppContainers" Version="1.1.0" />
7070
<PackageVersion Include="JsonSchema.Net" Version="7.4.0" />
71-
<PackageVersion Include="OllamaSharp" Version="5.4.6" />
71+
<PackageVersion Include="OllamaSharp" Version="5.4.12" />
7272
<PackageVersion Include="OpenFeature.Contrib.GOFeatureFlag" Version="0.2.1" />
7373
<PackageVersion Include="Minio" Version="6.0.5" />
7474
<PackageVersion Include="MassTransit" Version="8.5.5" />

examples/activemq/CommunityToolkit.Aspire.Hosting.ActiveMQ.AppHost/CommunityToolkit.Aspire.Hosting.ActiveMQ.AppHost.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
1+
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>

examples/adminer/CommunityToolkit.Aspire.Hosting.Adminer.AppHost/CommunityToolkit.Aspire.Hosting.Adminer.AppHost.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
1+
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>

examples/bun/CommunityToolkit.Aspire.Hosting.Bun.AppHost/CommunityToolkit.Aspire.Hosting.Bun.AppHost.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
1+
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>

examples/dapr/CommunityToolkit.Aspire.Hosting.Azure.Dapr.AppHost/CommunityToolkit.Aspire.Hosting.Azure.Dapr.AppHost.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
1+
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>

examples/dapr/CommunityToolkit.Aspire.Hosting.Azure.Dapr.AppHost/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
builder.AddAzureContainerAppEnvironment("cae").WithDaprComponents();
44

5-
var redis = builder.AddAzureRedis("redisState")
5+
var redis = builder.AddAzureManagedRedis("redisState")
66
.RunAsContainer();
77

88
// State store using Redis

examples/dapr/CommunityToolkit.Aspire.Hosting.Dapr.AppHost/CommunityToolkit.Aspire.Hosting.Dapr.AppHost.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
1+
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>

0 commit comments

Comments
 (0)