-
Notifications
You must be signed in to change notification settings - Fork 562
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
Support WaitForCompletion for ContainerResource resources #8001
Comments
I'm lost, why doesn't WaitForCompletion work? Aspire doesnt auto restart failing containers or processes. |
I don't know why
I can see in Docker Desktop that it looks like the container starts and stops multiple times (the status icon flashes going from exited to running again and again). Running via docker compose or pure docker (
I've worked around this by manually calling out to var openfga_migrate = builder.AddExecutable("openfga-migrate", "docker", "./",
"run",
"--rm",
"openfga/openfga",
"migrate",
"--datastore-engine", "postgres",
"--datastore-uri", "postgres://postgres:[email protected]:5433/postgres?sslmode=disable"
)
.WaitFor(openfga_pgsql); |
@dbreshears can you take a look? |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
I'm converting my Docker Compose configuration to Aspire for my team and one scenario doesn't seem to be supported - using
depends_on
withservice_completed_successfully
. My specific case is OpenFGA with the following docker compose YAML:The
openfga
container has two commands,migrate
andrun
, which are mutually exclusive. In the above setup, themigrate
service runs first (after Postgres is ready). That service runs once to completion, thenopenfga
starts up.I looked at using
WaitForCompletion
but there's two issues here:migrate
service runs again and again (maybe because Aspire assumes an container exiting is faulted and restarts it?)This isn't the same as #2866 as I'm not using Azure Container Apps.
Describe the solution you'd like
First, some sort of "run once" lifetime for container resources, perhaps:
.WithLifetime(ContainerLifetime.RunOnce)
?Then the ability to wait for the migrate container to run to completion, something like:
Additional context
No response
The text was updated successfully, but these errors were encountered: