![ |small ](imgs/toolchain.png) # Anaconda Python Environment Management Toolchain This repository contains the tools used to manage the conda environments on RCC following the Python module restructure, which will take place September 3rd 2020 ahead of the next UofC quarter. The Conda environments are stored in YAML files that are managed by two Anaconda toolchain shell scripts `contractor.sh` and `architect.sh` ## The Anaconda Environment Toolchain scripts ### Architect -- [architect.sh](./architect.sh) Script for keeping up to date list of RCC managed conda environments. The architect has two purposes: 1. Inspecting the most recent Conda module's environments, and saving any recent changes by exporting the environment as a YAML file in $YAMLPATH/current 2. Backing up Conda environments from the old Anaconda3 modules, and saving them as YAML files to $YAMLPATH/archive. This does not need to be done more than once, provided no new environments are created using old Anaconda3 modules. The YAMLPATH and other variables are configurable by editing the config.sh script. This script is run by a cron on the management node and will nightly update the list of conda environments in the system Anaconda python path. ### Contractor -- [contractor.sh](./contractor.sh) Script for restoring Conda environments from the architect created YAML files. The contractor has two basic uses: 1. Creating a particular environment from a YAML file in the repo. This is the default behavior of contractor.sh. 2. Migrating environments from one version of Anaconda to the next. This is done using the --restore flag. Controlling which environments are restored is done by putting the YAML files to be restored under $YAMLPATH/current. To prevent an environment from being restored in the next update, move its YAML file to $YAMLPATH/archive. The architect.sh tool automatically creates YAML files in $YAMLPATH/current. ## Staff Instructions for Using Toolchain In general the staff should not need to use the toolchain tools. The `architect.sh` script is run by a cron, but there may be the need for staff to use the `contractor.sh` script to restore conda environments (such as when a member of the staff installs a new version of Anaconda). Instructions for using this tool are in the [Staff Guide page](./docs/staffguide.md) of this repository. ## Conda Environment YAML files The architect.sh script will nightly populate the `current` directory in this repo. The `archive` folder contains all past conda environments that are no longer maintained.