Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 32 additions & 29 deletions .github/agents/hosting-integration-creator.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ Each hosting integration should have a corresponding sample application in the `
Here is an example of the `csproj` file for the AppHost project for the Bun hosting integration:

```xml
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

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

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

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

Example from Golang integration:

Expand Down Expand Up @@ -380,10 +380,10 @@ public static IResourceBuilder<GolangAppExecutableResource> AddGolangApp(

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

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

Example from Golang integration:

Expand Down Expand Up @@ -437,8 +437,8 @@ private static IResourceBuilder<GolangAppExecutableResource> PublishAsGolangDock

For language integrations that may need secure connections:

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

Example from Golang Dockerfile generation:

Expand All @@ -454,9 +454,9 @@ context.Builder

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

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

Example from Golang integration:

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

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

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

Example annotation and extension method:

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

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

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

Example README structure:

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

The integration automatically detects the [Language] version to use by:

1. Checking the [project file] for the version directive
2. Falling back to the installed toolchain version
3. Using [version] as the default if no version is detected
Expand All @@ -608,17 +609,19 @@ You can customize the base images used in the Dockerfile:
### Generated Dockerfile

The automatically generated Dockerfile:
- Uses the detected or default [Language] version as the build stage
- Uses a minimal runtime image for a smaller final image
- Installs CA certificates for HTTPS support
- Respects build options if specified

- Uses the detected or default [Language] version as the build stage
- Uses a minimal runtime image for a smaller final image
- Installs CA certificates for HTTPS support
- Respects build options if specified
```

### Testing Considerations

When testing language-based integrations:

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

Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ dotnet new aspire-apphost -n CommunityToolkit.Aspire.Hosting.<HostingIntegration

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

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.
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.

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

Expand Down
13 changes: 6 additions & 7 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
<Nullable>enable</Nullable>

<AspireMajorVersion>13</AspireMajorVersion>
<AspireVersion>$(AspireMajorVersion).0.0</AspireVersion>
<AspireAppHostSdkVersion>$(AspireVersion)</AspireAppHostSdkVersion>
<AspirePreviewSuffix>preview.1.25560.3</AspirePreviewSuffix>
<AspireVersion>$(AspireMajorVersion).1.0</AspireVersion>
<AspirePreviewSuffix>-preview.1.25616.3</AspirePreviewSuffix>
<AspNetCoreVersion>9.0.0</AspNetCoreVersion>
<DotNetExtensionsVersion>10.0.0</DotNetExtensionsVersion>
<DotNetExtensionsVersion>10.0.1</DotNetExtensionsVersion>
<OpenTelemetryVersion>1.12.0</OpenTelemetryVersion>
<TestContainersVersion>4.8.1</TestContainersVersion>
<MEAIVersion>9.9.0</MEAIVersion>
<MEAIVersion>10.0.0</MEAIVersion>
<ServiceDiscoveryVersion>10.0.0</ServiceDiscoveryVersion>
<IsPackable>false</IsPackable>
<MoqVersion>4.20.72</MoqVersion>
Expand All @@ -40,8 +39,8 @@

<!-- Versioning -->
<PropertyGroup>
<ToolkitMinorVersion>0</ToolkitMinorVersion>
<ToolkitPatchVersion>1</ToolkitPatchVersion>
<ToolkitMinorVersion>1</ToolkitMinorVersion>
<ToolkitPatchVersion>0</ToolkitPatchVersion>
<ToolkitPreviewVersion>preview.1</ToolkitPreviewVersion>

<VersionPrefix>$(AspireMajorVersion).$(ToolkitMinorVersion).$(ToolkitPatchVersion)</VersionPrefix>
Expand Down
6 changes: 3 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<PackageVersion Include="Aspire.Hosting.Azure.AppContainers" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.Azure.Redis" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.Elasticsearch" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.Keycloak" Version="$(AspireVersion)-$(AspirePreviewSuffix)" />
<PackageVersion Include="Aspire.Keycloak.Authentication" Version="$(AspireVersion)-$(AspirePreviewSuffix)" />
<PackageVersion Include="Aspire.Hosting.Keycloak" Version="$(AspireVersion)$(AspirePreviewSuffix)" />
<PackageVersion Include="Aspire.Keycloak.Authentication" Version="$(AspireVersion)$(AspirePreviewSuffix)" />
<PackageVersion Include="Aspire.Hosting.JavaScript" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.Python" Version="$(AspireVersion)" />
Expand Down Expand Up @@ -68,7 +68,7 @@
<!-- External packages -->
<PackageVersion Include="Azure.Provisioning.AppContainers" Version="1.1.0" />
<PackageVersion Include="JsonSchema.Net" Version="7.4.0" />
<PackageVersion Include="OllamaSharp" Version="5.4.6" />
<PackageVersion Include="OllamaSharp" Version="5.4.12" />
<PackageVersion Include="OpenFeature.Contrib.GOFeatureFlag" Version="0.2.1" />
<PackageVersion Include="Minio" Version="6.0.5" />
<PackageVersion Include="MassTransit" Version="8.5.5" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

var redis = builder.AddAzureRedis("redisState")
var redis = builder.AddAzureManagedRedis("redisState")
.RunAsContainer();

// State store using Redis
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
2 changes: 1 addition & 1 deletion examples/flyway/01.Basic/01.Basic.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
2 changes: 1 addition & 1 deletion examples/flyway/03.Repair/03.Repair.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">

<Sdk Name="Aspire.AppHost.Sdk" Version="$(AspireAppHostSdkVersion)"/>
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">
<PropertyGroup>
<OutputType>Exe</OutputType>
<UserSecretsId>dea39c19-075e-4a9d-aba2-ffd65de91136</UserSecretsId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.0.0">
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Loading
Loading