-
Notifications
You must be signed in to change notification settings - Fork 308
feat(cli): add concurrent images pulling #4394
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
base: develop
Are you sure you want to change the base?
feat(cli): add concurrent images pulling #4394
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we check how docker compose downloads images and import that as a library instead? https://github.com/docker/compose/blob/main/pkg/compose/images.go
Didn't found any pull related things on the linked file, but here: https://github.com/docker/compose/blob/b80bb0586e42dbb6adc2190cb84881138b61eb53/pkg/compose/pull.go#L312-L331 It seems quite similar to what I've done, I can see they introduce some I'll see if we can re-use this directly rather than the custom implementation. |
|
What about the console logs when pulling images concurrently? Docker compose has a nice display for each image and clears up when downloads complete. |
|
Hmm ok, I will explore a bit more if you don't mind. Their progress logs is something I've always wanted to try. |
If it's only the progress bar you're interested in, then maybe that's doable, it seems like it's handled on it's own separate package in their codebase. |
|
Made a new version keeping the concurrency logic in our code (since it's not exposed by compose). But improving the implementation by looking how compose does it (errgroup, channel). Also added a 1s delay at the start between each image pull, this reduce greatly the number of "api rate limit" encountered which overall reduce the total pulling time. And re-use part of compose for better logging (docker-compose style): Also thank's for this new more detailed log (time for each image) we can see the largest image (postgres) takes ~1min to download, which match our total time of running from cached image (30s) + network speed (1min to download the largest). |
…image-pulls-in-supabase-cli-start
Pull Request Test Coverage Report for Build 19032133102Details
💛 - Coveralls |


What kind of change does this PR introduce?
supabase startall images are pulled at the time the service is starting, so each services need to wait until it's started before pulling something else. This change the logic into two steps:On my machine/network, this reduce the "cold start" (no images at all) of
supabase startfrom ~2:43.19 total to ~1:30.33 total.Note that even with all images already present there is a ~30s uncompressible delay to start all the containers. So this only bring the cold start download overhead from ~2.13min to ~1min.