Skip to content

Commit

Permalink
Set docker summaries for all extensions. (#6323)
Browse files Browse the repository at this point in the history
* Set docker summaries for all extensions.

Saw that it was missing on SqlServer during Damian's demo.

* Fix cosmos image

* Fix summary

* Move package tags hints to <remarks>

* Fix tags

* Update src/Aspire.Hosting.MySql/MySqlBuilderExtensions.cs

---------

Co-authored-by: Eric Erhardt <[email protected]>
  • Loading branch information
sebastienros and eerhardt authored Oct 22, 2024
1 parent 194b783 commit 69cabab
Show file tree
Hide file tree
Showing 28 changed files with 155 additions and 48 deletions.
11 changes: 6 additions & 5 deletions src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,15 @@ public static IResourceBuilder<AzureCosmosDBResource> AddAzureCosmosDB(this IDis

/// <summary>
/// Configures an Azure Cosmos DB resource to be emulated using the Azure Cosmos DB emulator with the NoSQL API. This resource requires an <see cref="AzureCosmosDBResource"/> to be added to the application model.
/// For more information on the Azure Cosmos DB emulator, see <a href="https://learn.microsoft.com/azure/cosmos-db/emulator#authentication"></a>
/// For more information on the Azure Cosmos DB emulator, see <a href="https://learn.microsoft.com/azure/cosmos-db/emulator#authentication"></a>.
/// </summary>
/// <param name="builder">The Azure Cosmos DB resource builder.</param>
/// <param name="configureContainer">Callback that exposes underlying container used for emulation to allow for customization.</param>
/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
/// <remarks>
/// When using the Azure Cosmos DB emulator, the container requires a TLS/SSL certificate.
/// For more information, see <a href="https://learn.microsoft.com/azure/cosmos-db/how-to-develop-emulator?tabs=docker-linux#export-the-emulators-tlsssl-certificate"></a>
/// For more information, see <a href="https://learn.microsoft.com/azure/cosmos-db/how-to-develop-emulator?tabs=docker-linux#export-the-emulators-tlsssl-certificate"></a>.
/// This version of the package defaults to the <inheritdoc cref="CosmosDBEmulatorContainerImageTags.Tag"/> tag of the <inheritdoc cref="CosmosDBEmulatorContainerImageTags.Registry"/>/<inheritdoc cref="CosmosDBEmulatorContainerImageTags.Image"/> container image.
/// </remarks>
public static IResourceBuilder<AzureCosmosDBResource> RunAsEmulator(this IResourceBuilder<AzureCosmosDBResource> builder, Action<IResourceBuilder<AzureCosmosDBEmulatorResource>>? configureContainer = null)
{
Expand All @@ -117,9 +118,9 @@ public static IResourceBuilder<AzureCosmosDBResource> RunAsEmulator(this IResour
builder.WithEndpoint(name: "emulator", targetPort: 8081)
.WithAnnotation(new ContainerImageAnnotation
{
Registry = "mcr.microsoft.com",
Image = "cosmosdb/linux/azure-cosmos-emulator",
Tag = "latest"
Registry = CosmosDBEmulatorContainerImageTags.Registry,
Image = CosmosDBEmulatorContainerImageTags.Image,
Tag = CosmosDBEmulatorContainerImageTags.Tag
});

CosmosClient? cosmosClient = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Aspire.Hosting.Azure.Cosmos;

internal static class CosmosDBEmulatorContainerImageTags
{
/// <summary>mcr.microsoft.com</summary>
public const string Registry = "mcr.microsoft.com";

/// <summary>cosmosdb/linux/azure-cosmos-emulator</summary>
public const string Image = "cosmosdb/linux/azure-cosmos-emulator";

/// <summary>latest</summary>
public const string Tag = "latest";
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public static IResourceBuilder<AzureEventHubsResource> AddAzureEventHubs(
/// <summary>
/// Adds an Azure Event Hubs hub resource to the application model. This resource requires an <see cref="AzureEventHubsResource"/> to be added to the application model.
/// </summary>
/// <remarks>
/// This version of the package defaults to the <inheritdoc cref="EventHubsEmulatorContainerImageTags.Tag"/> tag of the <inheritdoc cref="EventHubsEmulatorContainerImageTags.Registry"/>/<inheritdoc cref="EventHubsEmulatorContainerImageTags.Image"/> container image.
/// </remarks>
/// <param name="builder">The Azure Event Hubs resource builder.</param>
/// <param name="name">The name of the Event Hub.</param>
public static IResourceBuilder<AzureEventHubsResource> AddEventHub(this IResourceBuilder<AzureEventHubsResource> builder, [ResourceName] string name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ namespace Aspire.Hosting.Azure.EventHubs;

internal static class EventHubsEmulatorContainerImageTags
{
/// <summary>mcr.microsoft.com</summary>
public const string Registry = "mcr.microsoft.com";

/// <summary>azure-messaging/eventhubs-emulator</summary>
public const string Image = "azure-messaging/eventhubs-emulator";
public const string Tag = "latest";

/// <summary>latest</summary>
public const string Tag = "latest"; // latest is the only arch-agnostic tag
}
5 changes: 4 additions & 1 deletion src/Aspire.Hosting.Azure.Storage/AzureStorageExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,11 @@ public static IResourceBuilder<AzureStorageResource> AddAzureStorage(this IDistr
}

/// <summary>
/// Configures an Azure Storage resource to be emulated using Azurite. This resource requires an <see cref="AzureStorageResource"/> to be added to the application model. This version of the package defaults to the <inheritdoc cref="StorageEmulatorContainerImageTags.Tag"/> tag of the <inheritdoc cref="StorageEmulatorContainerImageTags.Registry"/>/<inheritdoc cref="StorageEmulatorContainerImageTags.Image"/> container image.
/// Configures an Azure Storage resource to be emulated using Azurite. This resource requires an <see cref="AzureStorageResource"/> to be added to the application model.
/// </summary>
/// <remarks>
/// This version of the package defaults to the <inheritdoc cref="StorageEmulatorContainerImageTags.Tag"/> tag of the <inheritdoc cref="StorageEmulatorContainerImageTags.Registry"/>/<inheritdoc cref="StorageEmulatorContainerImageTags.Image"/> container image.
/// </remarks>
/// <param name="builder">The Azure storage resource builder.</param>
/// <param name="configureContainer">Callback that exposes underlying container used for emulation to allow for customization.</param>
/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public static class ElasticsearchBuilderExtensions
private const int ElasticsearchInternalPort = 9300;

/// <summary>
/// Adds an Elasticsearch container resource to the application model. This version of the package defaults to the <inheritdoc cref="ElasticsearchContainerImageTags.Tag"/> tag of the <inheritdoc cref="ElasticsearchContainerImageTags.Image"/> container image.
/// Adds an Elasticsearch container resource to the application model.
/// </summary>
/// <remarks>
/// The default image is "elasticsearch" and the tag is "8.15.1".
/// This version of the package defaults to the <inheritdoc cref="ElasticsearchContainerImageTags.Tag"/> tag of the <inheritdoc cref="ElasticsearchContainerImageTags.Image"/> container image.
/// </remarks>
/// <param name="builder">The <see cref="IDistributedApplicationBuilder"/>.</param>
/// <param name="name">The name of the resource. This name will be used as the connection string name when referenced in a dependency.</param>
Expand All @@ -38,8 +38,8 @@ public static class ElasticsearchBuilderExtensions
/// var elasticsearch = builder.AddElasticsearch("elasticsearch");
/// var api = builder.AddProject&lt;Projects.Api&gt;("api")
/// .WithReference(elasticsearch);
///
/// builder.Build().Run();
///
/// builder.Build().Run();
/// </code>
/// </example>
public static IResourceBuilder<ElasticsearchResource> AddElasticsearch(
Expand Down Expand Up @@ -109,8 +109,8 @@ public static IResourceBuilder<ElasticsearchResource> AddElasticsearch(
/// .WithDataVolume();
/// var api = builder.AddProject&lt;Projects.Api&gt;("api")
/// .WithReference(elasticsearch);
///
/// builder.Build().Run();
///
/// builder.Build().Run();
/// </code>
/// </example>
public static IResourceBuilder<ElasticsearchResource> WithDataVolume(this IResourceBuilder<ElasticsearchResource> builder, string? name = null)
Expand All @@ -136,8 +136,8 @@ public static IResourceBuilder<ElasticsearchResource> WithDataVolume(this IResou
/// .WithDataBindMount("./data/elasticsearch/data");
/// var api = builder.AddProject&lt;Projects.Api&gt;("api")
/// .WithReference(elasticsearch);
///
/// builder.Build().Run();
///
/// builder.Build().Run();
/// </code>
/// </example>
public static IResourceBuilder<ElasticsearchResource> WithDataBindMount(this IResourceBuilder<ElasticsearchResource> builder, string source)
Expand Down
9 changes: 6 additions & 3 deletions src/Aspire.Hosting.Garnet/GarnetBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public static class GarnetBuilderExtensions
/// <summary>
/// Adds a Garnet container to the application model.
/// </summary>
/// <remarks>
/// This version of the package defaults to the <inheritdoc cref="GarnetContainerImageTags.Tag"/> tag of the <inheritdoc cref="GarnetContainerImageTags.Registry"/>/<inheritdoc cref="GarnetContainerImageTags.Image"/> container image.
/// </remarks>
/// <example>
/// Use in application host
/// <code lang="csharp">
Expand All @@ -27,8 +30,8 @@ public static class GarnetBuilderExtensions
/// var garnet = builder.AddGarnet("garnet");
/// var api = builder.AddProject&lt;Projects.Api&gt;("api)
/// .WithReference(garnet);
///
/// builder.Build().Run();
///
/// builder.Build().Run();
/// </code>
/// </example>
/// <example>
Expand All @@ -39,7 +42,7 @@ public static class GarnetBuilderExtensions
///
/// var multiplexer = builder.Services.BuildServiceProvider()
/// .GetRequiredService&lt;IConnectionMultiplexer&gt;();
///
///
/// var db = multiplexer.GetDatabase();
/// db.HashSet("key", [new HashEntry("hash", "value")]);
/// var value = db.HashGet("key", "hash");
Expand Down
5 changes: 5 additions & 0 deletions src/Aspire.Hosting.Garnet/GarnetContainerImageTags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ namespace Aspire.Hosting.Garnet;

internal static class GarnetContainerImageTags
{
/// <summary>ghcr.io</summary>
public const string Registry = "ghcr.io";

/// <summary>microsoft/garnet</summary>
public const string Image = "microsoft/garnet";

/// <summary>1.0</summary>
public const string Tag = "1.0";
}
10 changes: 8 additions & 2 deletions src/Aspire.Hosting.Kafka/KafkaBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ public static class KafkaBuilderExtensions
private const string Target = "/var/lib/kafka/data";

/// <summary>
/// Adds a Kafka resource to the application. A container is used for local development. This version of the package defaults to the <inheritdoc cref="KafkaContainerImageTags.Tag"/> tag of the <inheritdoc cref="KafkaContainerImageTags.Image"/> container image.
/// Adds a Kafka resource to the application. A container is used for local development.
/// </summary>
/// <remarks>
/// This version of the package defaults to the <inheritdoc cref="KafkaContainerImageTags.Tag"/> tag of the <inheritdoc cref="KafkaContainerImageTags.Image"/> container image.
/// </remarks>
/// <param name="builder">The <see cref="IDistributedApplicationBuilder"/>.</param>
/// <param name="name">The name of the resource. This name will be used as the connection string name when referenced in a dependency</param>
/// <param name="port">The host port of Kafka broker.</param>
Expand Down Expand Up @@ -77,8 +80,11 @@ public static IResourceBuilder<KafkaServerResource> AddKafka(this IDistributedAp
}

/// <summary>
/// Adds a Kafka UI container to the application. This version of the package defaults to the <inheritdoc cref="KafkaContainerImageTags.KafkaUiTag"/> tag of the <inheritdoc cref="KafkaContainerImageTags.KafkaUiImage"/> container image.
/// Adds a Kafka UI container to the application.
/// </summary>
/// <remarks>
/// This version of the package defaults to the <inheritdoc cref="KafkaContainerImageTags.KafkaUiTag"/> tag of the <inheritdoc cref="KafkaContainerImageTags.KafkaUiImage"/> container image.
/// </remarks>
/// <param name="builder">The Kafka server resource builder.</param>
/// <param name="configureContainer">Configuration callback for KafkaUI container resource.</param>
/// <param name="containerName">The name of the container (Optional).</param>
Expand Down
7 changes: 6 additions & 1 deletion src/Aspire.Hosting.Keycloak/KeycloakContainerImageTags.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Aspire.Hosting.Keycloak;

internal static class KeycloakContainerImageTags
{
/// <summary>quay.io</summary>
public const string Registry = "quay.io";

/// <summary>keycloak/keycloak</summary>
public const string Image = "keycloak/keycloak";

/// <summary>25.0</summary>
public const string Tag = "25.0";
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public static class KeycloakResourceBuilderExtensions
/// <param name="adminPassword">The parameter used as the admin password for the Keycloak resource. If <see langword="null"/> a default password will be used.</param>
/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
/// <remarks>
/// The container is based on the quay.io/keycloak/keycloak container image.
/// The default tag is 24.0. The container exposes port 8080 by default.
/// The container exposes port 8080 by default.
/// This version of the package defaults to the <inheritdoc cref="KeycloakContainerImageTags.Tag"/> tag of the <inheritdoc cref="KeycloakContainerImageTags.Registry"/>/<inheritdoc cref="KeycloakContainerImageTags.Image"/> container image.
/// </remarks>
/// <example>
/// Use in application host
Expand Down
9 changes: 6 additions & 3 deletions src/Aspire.Hosting.Milvus/MilvusBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static class MilvusBuilderExtensions
private const int MilvusPortGrpc = 19530;

/// <summary>
/// Adds a Milvus resource to the application. A container is used for local development.
/// Adds a Milvus container resource to the application model.
/// </summary>
/// <example>
/// Use in application host
Expand All @@ -36,9 +36,9 @@ public static class MilvusBuilderExtensions
/// </code>
/// </example>
/// <remarks>
/// This version of the package defaults to the <inheritdoc cref="MilvusContainerImageTags.Tag"/> tag of the <inheritdoc cref="MilvusContainerImageTags.Image"/> container image.
/// The .NET client library uses the gRPC port by default to communicate and this resource exposes that endpoint.
/// A web-based administration tool for Milvus can also be added using <see cref="WithAttu"/>.
/// This version of the package defaults to the <inheritdoc cref="MilvusContainerImageTags.Tag"/> tag of the <inheritdoc cref="MilvusContainerImageTags.Image"/> container image.
/// </remarks>
/// <param name="builder">The <see cref="IDistributedApplicationBuilder"/>.</param>
/// <param name="name">The name of the resource. This name will be used as the connection string name when referenced in a dependency</param>
Expand Down Expand Up @@ -133,8 +133,11 @@ public static IResourceBuilder<MilvusDatabaseResource> AddDatabase(this IResourc
}

/// <summary>
/// Adds an administration and development platform for Milvus to the application model using Attu. This version of the package defaults to the <inheritdoc cref="MilvusContainerImageTags.AttuTag"/> tag of the <inheritdoc cref="MilvusContainerImageTags.AttuImage"/> container image.
/// Adds an administration and development platform for Milvus to the application model using Attu.
/// </summary>
/// <remarks>
/// This version of the package defaults to the <inheritdoc cref="MilvusContainerImageTags.AttuTag"/> tag of the <inheritdoc cref="MilvusContainerImageTags.AttuImage"/> container image.
/// </remarks>
/// <example>
/// Use in application host with a Milvus resource
/// <code lang="csharp">
Expand Down
12 changes: 9 additions & 3 deletions src/Aspire.Hosting.MongoDB/MongoDBBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ public static class MongoDBBuilderExtensions
private const string PasswordEnvVarName = "MONGO_INITDB_ROOT_PASSWORD";

/// <summary>
/// Adds a MongoDB resource to the application model. A container is used for local development. This version of the package defaults to the <inheritdoc cref="MongoDBContainerImageTags.Tag"/> tag of the <inheritdoc cref="MongoDBContainerImageTags.Image"/> container image.
/// Adds a MongoDB resource to the application model. A container is used for local development.
/// </summary>
/// <remarks>
/// This version of the package defaults to the <inheritdoc cref="MongoDBContainerImageTags.Tag"/> tag of the <inheritdoc cref="MongoDBContainerImageTags.Image"/> container image.
/// </remarks>
/// <param name="builder">The <see cref="IDistributedApplicationBuilder"/>.</param>
/// <param name="name">The name of the resource. This name will be used as the connection string name when referenced in a dependency.</param>
/// <param name="port">The host port for MongoDB.</param>
Expand All @@ -34,7 +37,7 @@ public static IResourceBuilder<MongoDBServerResource> AddMongoDB(this IDistribut
}

/// <summary>
/// Adds a MongoDB resource to the application model. A container is used for local development. This version the package defaults to the 7.0.8 tag of the mongo container image.
/// <inheritdoc cref="AddMongoDB(IDistributedApplicationBuilder, string, int?)"/>
/// </summary>
/// <param name="builder">The <see cref="IDistributedApplicationBuilder"/>.</param>
/// <param name="name">The name of the resource. This name will be used as the connection string name when referenced in a dependency.</param>
Expand Down Expand Up @@ -121,8 +124,11 @@ public static IResourceBuilder<MongoDBDatabaseResource> AddDatabase(this IResour
}

/// <summary>
/// Adds a MongoExpress administration and development platform for MongoDB to the application model. This version of the package defaults to the <inheritdoc cref="MongoDBContainerImageTags.MongoExpressTag"/> tag of the <inheritdoc cref="MongoDBContainerImageTags.MongoExpressImage"/> container image
/// Adds a MongoExpress administration and development platform for MongoDB to the application model.
/// </summary>
/// <remarks>
/// This version of the package defaults to the <inheritdoc cref="MongoDBContainerImageTags.MongoExpressTag"/> tag of the <inheritdoc cref="MongoDBContainerImageTags.MongoExpressImage"/> container image.
/// </remarks>
/// <param name="builder">The MongoDB server resource builder.</param>
/// <param name="configureContainer">Configuration callback for Mongo Express container resource.</param>
/// <param name="containerName">The name of the container (Optional).</param>
Expand Down
Loading

0 comments on commit 69cabab

Please sign in to comment.