exercism / rust-test-runner

GNU Affero General Public License v3.0
3 stars 15 forks source link

Optimize registry building #57

Closed ErikSchierboom closed 1 year ago

ErikSchierboom commented 2 years ago

The docker image contains a registry of the top X crates. The way it is currently setup, the registry is rebuilt every time there is a build/deploy. That might be a bit overkill, and it is slightly annoying when working locally.

One option to fix this would be to use cache buster argument, and then pass some semi-stable value to it each time the image is built (e.g. causing the registry to only be built once a day). We use this pattern in the website. See https://github.com/exercism/website/blob/main/docker/rails.Dockerfile#L4 and https://github.com/exercism/website/blob/cb1b829bbe232e94bc593946fb00cacb2ee9f6f8/.github/workflows/deploy.yml#L78

senekor commented 1 year ago

I think this is related to #37 #40. If the supported crates are pinned to specific versions, we could use a hash over the supported_crates file as a cache buster. I might try to pick up the work on the stale PR when I get the time.

senekor commented 1 year ago

@ErikSchierboom I cannot reproduce this locally. When I simply run docker build . twice in a row, the second build is fully cached. Is this not a problem anymore or do I need to do something else to reproduce this?

ErikSchierboom commented 1 year ago

@senekor Great, then the most recent version of the Dockerfile is likely fine!