Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New article]: Docs for new persistent container lifetime feature in 9.0 #1660

Open
danegsta opened this issue Sep 19, 2024 · 0 comments
Open
Labels
doc-idea Indicates issues that are suggestions for new topics [org][type][category] ⌚ Not Triaged Not triaged

Comments

@danegsta
Copy link
Member

Proposed topic or title

Persistent container services

Location in table of contents.

App Host (Orchestration)

Reason for the article

Aspire 9.0 adds a new ContainerResourceBuilderExtensions.WithLifetime API that can be used to mark a runtime container as persistent. This allows the container to be retained when the App Host is stopped and re-used on subsequent runs.

Article abstract

Learn to configure containers to persist and be re-used between App Host runs.

  • This particularly benefits containers that have a long startup time such as databases
  • Persistent containers may still be recreated on a subsequent run if the AppHost configuration changes meaningfully
    • We use a label on containers to track a hash of the configuration used to create the container and compare it to the current configuration; if different we recreate the container
  • Existing persistent containers are identified based on the container name
    • By default persistent containers have a name that is a combination of the service name and a postfix based on a hash of the App Host project path, this means that a persistent container will be unique to a given AppHost project
    • For advanced scenarios, a user can set a custom container name using the new WithContainerName API; this can allow Aspire to re-use a container that wasn't created by the AppHost (such a container will never be recreated)

Relevant searches

No response

@danegsta danegsta added the doc-idea Indicates issues that are suggestions for new topics [org][type][category] label Sep 19, 2024
@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-idea Indicates issues that are suggestions for new topics [org][type][category] ⌚ Not Triaged Not triaged
Projects
None yet
Development

No branches or pull requests

2 participants