Migrating Conda Environments
As part of ICER's OS upgrade, all software has changed. While Conda does a good job at isolating software in environments and installing most things from scratch, it is possible that you may need to reinstall your environments on the new system.
Optional
In limited testing, we have seen that Conda environments created on the current system appear to work on the new system without intervention. However, if you notice issues or your environments become nonfunctional, please follow the steps below.
Save your current environments
First, start a backwards compatibility container and get a list of your environments.
1 2 3 4 5 |
|
Select the environments you would like to transfer over. In this guide, we will use an example named project
. Use conda env export
to get the list of packages in the environment.
1 |
|
Reinstall Conda on the new operating system
Optional
In limited testing, ICER has not seen a need to reinstall Conda on the new operating system. However, if you are having issues, this would be a good troubleshooting step to take.
Log into a development node running the new operating system, and follow our instructions for Installing Conda.
In the step where you are asked to install Miniforge3 in your home directory, make sure to choose a different location if you'd like to maintain backwards compatibility, e.g., /mnt/home/<user>/miniforge3_ubuntu
. You can add the following to the .bashrc
file in your home directory to make sure that the new version of Conda is only used on Ubuntu nodes.
1 2 3 |
|
Create a new virtual environment
Exit the container back into a development node running the new operating system, and reinstall your environments. To avoid confusion with the old environment, you can use a new name.
1 2 3 4 5 6 7 8 9 |
|
The new environment is ready to use.
Update old batch scripts
Assuming this Conda environment was used in a batch script, you now need to update it for the new system. Suppose we have the following script, my_script.sb
.
my_script.sb | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 |
|
Copy the script for the new system.
1 |
|
Then, change the environment name to match the new Conda environment.
my_script_ubuntu.sb | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 |
|
To test, make sure you log into an Ubuntu development node, and submit the job using
1 |
|