Skip to content

Conversation

@tpoliaw
Copy link

@tpoliaw tpoliaw commented Oct 23, 2025

Once the uv cache has been set up, configuring the pre-commit hooks
takes the most significant amount of time building the container. Using
a shared volume for the pre-commit cache as well takes the devcontainer
re-build time from ~1m10s to ~10s.

Instead of mounting the user's local cache. For the first use this will
be slower (if the user has previously used uv) but using a separate
volume means links within the cache referring to devcontainer locations
will not interfere with uv being run from outside the container.

Using a named volume means devcontainers for multiple projects can share
the same cache.
Once the uv cache has been set up, configuring the pre-commit hooks
takes the most significant amount of time building the container. Using
a shared volume for the pre-commit cache as well takes the devcontainer
re-build time from ~1m10s to ~10s.
@tpoliaw tpoliaw requested a review from coretl October 23, 2025 15:28
@tpoliaw tpoliaw changed the title Use shared volume for pre-commit cache chore: Use shared volume for pre-commit cache Oct 24, 2025
@tpoliaw tpoliaw requested a review from DiamondJoseph October 27, 2025 10:49
@tpoliaw tpoliaw closed this Oct 27, 2025
coretl added a commit that referenced this pull request Oct 28, 2025
Supercedes #304 and #305 by adding a global volume that contains:
- pre-commit cache
- uv cache
- uv managed python cache
- the venvs for all the projects

This allows us to use hardlink mode which makes it even faster, and
avoid the issue of anonymous volumes in devcontainers being left
dangling. Added docs to say that there is now a global venv for the
container, which is different for how it would look without any
environment variables set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants