microsoft / microsoft/aspire

Should `WaitFor` / `WaitForCompletion` block pulling container resources

Open
#5,625 4 comments 0 reactions 0 assignees View on GitHub
area-orchestrator
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

Currently if you have a container resource that waits on something else, then aspire doesn't start pulling hte container image until after the `WaitFor` or `WaitForCompletion` checks have fully passed.

### Describe the solution you'd like

Pulling can take quite some time, so it would make sense to start puling images as soon as the Aspire application starts, only doing `WaitFor` / `WaitForCompletion` once the image has been pulled.

### Additional context

Repro Steps:
```bash
docker image rm docker.io/library/redis:7.4 -f
```
```cs
var pause = builder.AddExecutable("pause", "pwsh", ".",
"-NoProfile",
"-NoLogo",
"-NonInteractive",
"-Command",
"Write-Host 'Starting Migration'; Start-Sleep -Seconds 10; Write-Host 'Done'");

var redis = builder.AddRedis("redis")
.WaitForCompletion(pause);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.