Closed camriddell closed 1 year ago
By repo2docker's definition (what binder uses), they do not need to be in a binder folder and can exist in the root of the repository. However, as part of creating a uniform standard for econ-ark materials @MridulS and I agreed that we should keep all environment related materials in a binder subfolder. More than happy to revisit this discussion though!
As for creating the environment, I purposefully didn't specify a name so that it wouldn't clash with any existing conda environments on the user's machine. Conda environments can be named or prefixed with the following command:
conda env create -f environment.yml --name DistributionOfWealthMPC
However I find it often useful to specify a prefix instead of a name, which stores the environment info in a folder you specify. I typically will name this folder env
and stick it inside of the repo while being careful not to commit it (or just add it to my .gitignore):
# cd to wherever you keep your local clone
cd my_repositories/econ-ark/DistributionOfWealthMPC
conda env create -f binder/environment.yml --prefix ./env
# including the path is important or else conda will search for an environment named "env"
conda activate ./env
This creates an env/
folder in the repository that contains your anaconda environment. You can activate it by specifying a path to this folder in conda activate
. This way the environment is directly tied to your local copy of repository and not to your global conda environment namespace.
This is actually an interesting point of discussion for what we want the workflow of econ-ark to be, that I think we should have a brief chat about this.
If you and @MridulS have reached an understanding, happy to defer to y'all on this!
These are some great tips for managing environments! Will be sure to incorporate this into my workflow as I'm afraid I'm pretty terrible at managing my environments.
Any reason to wait on merging this?
As we create uniform remarks, we are transitioning away from using runtime.txt towards using environment.yml files to create working
conda
environments for these projects.I've created a simple
environment.yml
to do this, let me know if this interferes with any ongoing work and we can hash out a solution!