I am trying to build a portable conda
environment.
So we can tarball and distribute it to another server or many servers later.
Place where we build environment and where it'll be deployed later are two different places.
I noticed that conda create
and conda install
both hard-code environment location into shebang of all the installed scripts under environment_path\bin
- is there is a way to override that?
We have to use deployment location and not build location for that environment in shebang bin/
scripts.
Also created https://github.com/conda/conda/issues/7861
Disclaimer: I'm aware of option of rebuilding environment using exported yaml file, but this is not what we're looking here. We want to make conda environment redistributable / portable as a binary tarball - deployment location is known, but it's not the same as environment build location.
I just found conda-pack
that seems address this issue directly
https://github.com/conda/conda-pack
conda-pack
is a command line tool for creating relocatable conda environments. This is useful for deploying code in a consistent environment, potentially in a location where python/conda isn't already installed.
Documentation: https://conda.github.io/conda-pack/
Use Cases:
Update: Some other of our PySpark applications are using a conda
environment on a location that's available on all Hadoop nodes (NFS mount) and it works very well for some conda environments that don't have a ton of dependencies.
Packages are saved in <conda_root>/pkgs
. You can copy these files (as well as the anaconda installer script) to your deployment server, install anaconda, and running conda install <path_to_pkgs>/*.bz2
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With