My Code Workspace setup (jupyter) depends on a large number of external libraries. At the moment, these libraries have to be installed into my environment every time I start it up. Is there a way to freeze the conda environment so I can reuse it?
Today, your Conda environment will be persisted across sessions so long as it is saved to a checkpoint (see https://www.palantir.com/docs/foundry/code-workspaces/getting-started/#checkpoints for more on checkpoints). In particular, conda environments are typically stored in /home/user/envs
by default - this folder is restored with your checkpoint.
It’s worth noting some caveats with checkpoints:
- They are deleted after 30 days
- If a checkpoint is not selected when “restarting” your workspace, then a checkpoint will not be loaded, and your Conda environment not restored. So restoring the checkpoint with your environment is key.
- Historical checkpoints can be restored:
Hello,
By restoring historical checkpoints, do you mean “un-deleting” checkpoints that are older than 30 days?
Best,
Aron
Hello,
When I install packages (with the script put in my clipboard by the code workspaces package selector), I don’t end up with a /home/user/envs directory… at least not one I could find. As a result, the environment isn’t actually restored.
By “restoring historical checkpoints” I mean selecting a checkpoint that is still available to you within the 30 day time limit. The 30 day retention window is not bypassable at the moment.
To persist an environment in /home/user/envs
, you’d have to create a new mamba environment, e.g. by executing mamba create -n my_env <list of packages>
in a terminal. Environments created this way will be stored in /home/user/envs
. The default conda environment that is shipped with your Jupyter workspace is not persisted in a checkpoint directory, so any modifications made to this environment will not be persisted across sessions.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.