mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 18:38:21 +00:00
docs: add warning note on self-hosted github runners (#5757)
## Summary Related discussion: #5731 This adds a warning section for caching on non-ephemeral (e.g. ec2) self hosted github runners. ## Test Plan Prettier was ran on the file. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
parent
97ae811b86
commit
5e49f21adf
1 changed files with 24 additions and 0 deletions
|
@ -265,6 +265,30 @@ Its effect on performance is dependent on the packages being installed.
|
|||
|
||||
If using `uv pip`, use `requirements.txt` instead of `uv.lock` in the cache key.
|
||||
|
||||
!!! note
|
||||
|
||||
[post-job-hook]: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/running-scripts-before-or-after-a-job
|
||||
|
||||
When using non-ephemeral, self-hosted runners the default cache directory can grow unbounded.
|
||||
In this case, it may not be optimal to share the cache between jobs. Instead, move the cache
|
||||
inside the GitHub Workspace and remove it once the job finishes using a
|
||||
[Post Job Hook][post-job-hook].
|
||||
|
||||
```yaml
|
||||
install_job:
|
||||
env:
|
||||
# Configure a relative location for the uv cache
|
||||
UV_CACHE_DIR: ${{ github.workspace }}/.cache/uv
|
||||
```
|
||||
|
||||
Using a post job hook requires setting the `ACTIONS_RUNNER_HOOK_JOB_STARTED` environment
|
||||
variable on the self-hosted runner to the path of a cleanup script such as the one shown below.
|
||||
|
||||
```sh title="clean-uv-cache.sh"
|
||||
#!/usr/bin/env sh
|
||||
uv cache clean
|
||||
```
|
||||
|
||||
## Using `uv pip`
|
||||
|
||||
If using the `uv pip` interface instead of the uv project interface, uv requires a virtual
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue