By default, Guild saves runs in
~/.guild/runs as described in Environments.
What if you want to store runs in a project subdirectory?
You can do this using a virtual environment and a symbolic link.
Step 1. Create a project-local virtual environment
Option 1. Use
Option 2. Use
Option 3. Use the
venv module (Python 3):
python -m venv venv
Option 4. Use Conda:
conda create -p venv
Tip To save disk space, use
--system-site-packageswhen creating the virtual environment with
venv. This lets the environment access sytem site packages. However, you lose the benefits of package isolation in this case.
.gitignoresfile to avoid accidentally storing the virtual environment files in your source code repository.
Step 2. Create a symbolic link to the
Create a symbolic link to the Guild runs directory:
ln -s venv/.guild/runs runs
You can use whatever directory name you like. In this case we use
Note Add this link to your
.gitignoresfile to avoid accidentally storing runs in your source code repository.
Step 3. Activate the project-local environment
Guild will not use the environment until you activate it.
If you used
guild init to create the environment, activate it by running:
If you used
virtualenv or the
venv Python module to create the environment:
If you used Conda to create the environment:
conda activate venv
With an activated environment, all runs are stored in the project directory under
venv/.guild/runs. The symbolic link
runs gives you convenient access to these runs.
You can deactivate the environment by running
conda deactivate. This restores your shell to its state prior to environment activating.
Guild uses Python virtual environments to define alternative environments. This uses a standard pattern in for controlling the context of commands and software libraries.
Because Guild uses several directories — not just
runs — it’s not possible to simply tell Guild to “save runs in this directory”. The easiest way to expose runs is to link to them.