Checking for non-preferred file/folder path names (may take a long time depending on the number of files/folders) ...
This resource contains some files/folders that have non-preferred characters in their name. Show non-conforming files/folders.
This resource contains content types with files that need to be updated to match with metadata changes. Show content type files that need updating.
Authors: |
|
|
---|---|---|
Owners: |
|
This resource does not have an owner who is an active HydroShare user. Contact CUAHSI (help@cuahsi.org) for information on this resource. |
Type: | Resource | |
Storage: | The size of this resource is 36.2 KB | |
Created: | May 30, 2025 at 1:58 p.m. (UTC) | |
Last updated: | Jul 23, 2025 at 2:58 a.m. (UTC) | |
Citation: | See how to cite this resource |
Sharing Status: | Public |
---|---|
Views: | 380 |
Downloads: | 0 |
+1 Votes: | Be the first one to this. |
Comments: | No comments (yet) |
Abstract
This resource contains the following bash scripts which can be used by the user in any of the JupterHub instances accessible via the "Open with" functionality of HydroShare to create conda environment to run AORC related notebooks. In order to run any of the listed bash script files in JupyterHub, first make the file executable using the JupyterHub terminal. Here is an example:
chmod +x setup_aorc_conda_env_cuahsi_jh.sh
Then the above script can be executed from the command line as follows:
./setup_aorc_conda_env_cuahsi_jh.sh
After executing the script, it will create a new conda environment called 'aorc'. It will also register this new conda environment as a new Jupyter kernel with name 'Python [conda env:aorc]'. In order for any of the AORC related notebooks to use this kernel you have to first shut down all kernels and then use the option 'Change Kernel" to select this new kernel.
- setup_aorc_conda_env_cuahsi_jh.sh (This script should be used in CUAHSI JupyterHub to create a new conda environment called 'aorc'. The corresponding new kernel that is created will have name as 'Python [conda env:aorc]' )
- setup_aorc_conda_env_cybergis_jh.sh (This script should be used in CyberGIS Jupyter for Water) to create a new conda environment called 'aorc'. The corresponding new kernel that is created will have name as 'Python 3 (AORC)')
- environment.yml (This file contains the python modules needed to run the AORC notebooks - similar to requirements.txt file used with pip install). The above script files use this yml file to install the python modules listed in that file.
- delete_aorc_conda_env_cuahsi_jh.sh (This script can be run to delete the conda env 'aorc' in CUAHSI JupyterHub)
- delete_aorc_conda_env_cybergis_jh.sh (This script can be run to delete the conda env 'aorc' in CyberGIS Jupyter for Water)
- setup_aorc_conda_env_2i2c_jh.sh (This script should be used in 2i2c JupyterHub to create a new conda environment called 'aorc'. The corresponding new kernel that is created will have name as 'Python [conda env:.conda-aorc]')
- environment-2i2c.yml (This file is used in the above script that creates the aorc conda env in 2i2c. This environment file has few python modules for installing using conda)
- requirements-2i2c.txt (This file is used in the above script that creates the aorc conda env in 2i2c to pip install most of the python modules needed for AORC notebooks. The reason for using 'pip install' in case of 2i2c to install majority of python modules for the new conda environment is that 2i2c gives error 'no space left on device' if the modules are installed using 'conda'.)
- delete_aorc_conda_env_2i2c_jh.sh (This script can be run to delete the conda env 'aorc' in 2i2c JupyterHub)
- sample_commands_to_create_conda_env_jh.md (This file contains example commands to create a new conda environment - without using a bash script)
How to use the new kernel created by the script (see above)?
If you just created the new aorc conda environment, shut down all kernels. Open the notebook that needs to use the aorc conda environment. Change the kernel for the notebook to aorc kernel. (for the exact name of the kernel see above).
How to update the aorc conda environment after it has been created?
Update here means installing additional python modules or upgrading to a newer version of any modules that is already installed in the aorc conda environment. The following commands are applicable to CUAHSI and CyberGIS JH instances.
- Update the environment.yml file by adding new modules or updating the version of any modules in that file.
- In the JupyterHub instance, use a terminal and run the following 2 commands:
- conda activate aorc
- mamba env update -f environment.yml
Update aorc environment in 2i2c:
- conda activate aorc
If you have updated the environments-2i2c.yml, run
- conda env update -f environment-2i2c.yml
If you have updated the requirements-2i2c.txt file, run
- pip install -r requirements-2i2c.txt
If you just want to install few new modules or upgrade existing modules without updating environment or requirements file, then run (after activating the aorc env):
conda install <module-1-name> <module-2-name>
OR
pip install <module-1-name> <module-2-name>
NOTE: It is better to update environment or requirements file when there is a need to update the environment as it helps reproducibility.
Subject Keywords
Content
README.md
AORC Conda Environment Setup Scripts
This repository contains bash scripts for setting up conda environments to run AORC-related notebooks in various JupyterHub instances accessible via HydroShare's "Open with" functionality.
Usage Instructions
To use any of the bash scripts, first make them executable using the JupyterHub terminal:
chmod +x setup_aorc_conda_env_cuahsi_jh.sh
Then execute the script:
./setup_aorc_conda_env_cuahsi_jh.sh
Available Scripts
Environment Setup Scripts
setup_aorc_conda_env_cuahsi_jh.sh
- Creates a new conda environment 'aorc' in CUAHSI JupyterHubsetup_aorc_conda_env_cybergis_jh.sh
- Creates a new conda environment 'aorc' in CyberGIS Jupyter for Watersetup_aorc_conda_env_2i2c_jh.sh
- Creates a new conda environment 'aorc' in 2i2c JupyterHub
Environment Cleanup Scripts
delete_aorc_conda_env_cuahsi_jh.sh
- Deletes the 'aorc' conda environment in CUAHSI JupyterHubdelete_aorc_conda_env_cybergis_jh.sh
- Deletes the 'aorc' conda environment in CyberGIS Jupyter for Waterdelete_aorc_conda_env_2i2c_jh.sh
- Deletes the 'aorc' conda environment in 2i2c JupyterHub
Configuration Files
environment.yml
- Contains python modules for AORC notebooks (used by CUAHSI and CyberGIS scripts)environment-2i2c.yml
- Contains python modules for conda installation in 2i2c environment (used by 2i2c script)requirements-2i2c.txt
- Contains python modules for pip installation in 2i2c environment (used by 2i2c script)
Updating the Environment
For CUAHSI and CyberGIS JupyterHub
- Update the
environment.yml
file with new modules or version changes - Run the following commands in the JupyterHub terminal:
conda activate aorc
mamba env update -f environment.yml
For 2i2c JupyterHub
First activate the conda environment:
conda activate aorc
For conda-managed packages:
conda env update -f environment-2i2c.yml
For pip-managed packages:
pip install -r requirements-2i2c.txt
Quick Updates Without File Modifications
First activate the conda environment:
conda activate aorc
You can directly install or upgrade modules using:
conda install <module-1-name> <module-2-name>
OR
pip install <module-1-name> <module-2-name>
Sample Commands for Creating Conda Environment
sample_commands_to_create_conda_env_jh.md
- Example commands for manual conda environment creation
Note: For better reproducibility, it's recommended to update the environment or requirements files when making changes to the environment.
How to Cite
This resource is shared under the Creative Commons Attribution CC BY.
http://creativecommons.org/licenses/by/4.0/
Comments
There are currently no comments
New Comment