input-output-hk / devx

The Developer Experience Shell - This repo contains a nix develop shell for haskell. Its primary purpose is to help get a development shell for haskell quickly and across multiple operating systems (and architectures).
Apache License 2.0
39 stars 9 forks source link

Improve GitHub Codespace First-Launch Time by Preloading `.cache` #128

Closed yvan-sraka closed 5 months ago

yvan-sraka commented 6 months ago

Updates the Dockerfile used to create GitHub Codespace images to now preload the $HOME/.cache folder with artifacts from the corresponding repository's GitHub Actions. This aims to speed-up HLS startup in a fresh GitHub Codespace by leveraging previously built artifacts.

It's important to note that the cache download occurs when spawning a terminal in the Codespace, not during the image build process. The rationale behind this approach is to avoid building a unique Codespace image for each repository and to keep these images generic.

Additionally, if the artifacts are not found in the cache, the script will fail silently (considering adding a warning) since caching build artifacts is an optional, opt-in feature per repository. Also, note that caching is based on a "per commit" basis by default, but this could be extended to other scenarios, such as "per branch" caching, even though the cached artifacts are expected to weight only a few megabytes.

Finally, I've started experimenting with a caching GitHub Action in the cardano-base repository in this PR.