docker-library / repo-info

Extended information (especially license and layer details) about the published Official Images
Apache License 2.0
554 stars 340 forks source link

Convert ".remote.pl" to use "Mojo::Promise" instead of callback chaining #34

Closed tianon closed 5 years ago

tianon commented 5 years ago

This doesn't really make things shorter, but IMO it increases readability a lot, especially in the get_image_data_p implementation (where the steps are finally listed in the order they happen again like they were back in the blocking version of this code). It's honestly bothered me a lot that readability suffered so much when I converted this code to be non-blocking (back in db217e426ec7229c74f154953dbe2f3e9ad2e157), so this really makes me feel good. 👍

With these changes plus a few tweaks to how update-remote.sh parallelizes, I'm able to successfully regenerate the full set of all repos/**/remote/ files in ~5.5m on my machine (Jenkins is currently taking ~30m, and it's slower so I imagine it'll take somewhere on the order of twice my machine's runtime so hopefully somewhere around ~10m but should definitely be less than ~30m even if we have to bump PARALLELISM back down).

tianon commented 5 years ago

https://doi-janky.infosiftr.net/job/repo-info/job/remote/22473/ ! :metal:

(Took ~10m including docker build :metal: -- the actual update portion that I estimated above was ~7m)