This is because the lifecycle hook relies on AfterResourcesCreatedAsync which doesn't execute until after the resources have started, but since we have a resource waiting on health from the model resource, it doesn't start, resulting in a race condition.
Instead, we should use the new eventing API and the ResourceReadyEvent.
Describe the bug
When using the
WaitFor
API on a resource that depends on the model resource from Ollama, the model will never be downloaded.Regression
No response
Steps to reproduce
Expected behavior
The model should download and the resource waiting for it shouldn't start until the model is ready.
Screenshots
No response
IDE and version
Other
IDE version
No response
Nuget packages
Nuget package version(s)
9.0.0
Additional context
This is because the lifecycle hook relies on
AfterResourcesCreatedAsync
which doesn't execute until after the resources have started, but since we have a resource waiting on health from the model resource, it doesn't start, resulting in a race condition.Instead, we should use the new eventing API and the
ResourceReadyEvent
.Help us help you
Yes, I'd like to be assigned to work on this item