Environment Setup of the Tree¶
This page describes the creation of the SDSS config environment files necessary for most SDSS software and filesystem navigation on the Science Archive Server (SAS). Running this script will permanently setup the SDSS tree system in your local shell environment.
Note
If you are only interested in using the Tree Python package and having dynamic environments, you do not need to perform this step, and can safely ignore this page.
Checkout the tree
product¶
First checkout the product from github. Navigate to the bin
directory
git clone https://github.com/sdss/tree tree
cd bin/
The main script to create environment files is setup_tree.py
. To create corresponding
module
, bash
, and tcsh
configuration files, run
python setup_tree.py
This will take all config files located in tree/data
and create environment files inside tree/etc
, which
can then be sourced into your corresponding shell environment. The script uses the environment variables
$SAS_BASE_DIR
and $TREE_DIR
when identifying and creating environment files. If it cannot find an existing
TREE_DIR
it will create one corresponding to the top level directory of the git repo. If it cannot find an
existing SAS_BASE_DIR
it will prompt you to create one.
ModuleFiles¶
If you are using the modules
environment manager, this script attempts to copy the module files
located in tree/etc
into your local $MODULES_DIR
. If no modules path is specified, the script
attempts to identify your modules directory by taking the first path directory found in the $MODULEPATH
environment variable. To specify a custom MODULES_DIR
, use the modulesdir
keyword argument.
python setup_tree.py -m '/my/custom/path/modules/'
It will copy all module files found in tree/etc
and place them inside $MODULES_DIR/tree/
. For example
the etc/dr14.module
file would get copied to /my/custom/path/modules/tree/dr14
. When multiple module paths
are found, it prompts the user to choose which paths to copy the new modules files into. If an existing tree
module
directory is found, it also prompts if the user wishes to overwrite existing files.
Example Files¶
Example config files with created environment files.
SDSS Config | Data Dir | Etc Dir |
---|---|---|
dr14 | dr14.cfg | dr14.module, dr14.sh dr14.csh |
sdsswork | sdsswork.cfg | sdsswork.module, sdsswork.sh sdsswork.csh |
Creating Environment Symlinks¶
To create the environment index pages, with symlinks to the Tree environment paths for the SAS, run
python setup_tree.py -e
This will scrape through the tree datamodel directory inside your $SAS_BASE_DIR
and create corresponding
symlinks to every path inside a master env
directory located at the top level. By default it creates
the index
html page for the SAS. To create links for the Science Archive Mirror (SAM),
use the mirror
keyword argument.
python setup_tree.py -e --mirror
To create environment symlinks for only a specific configuration, e.g. the DR14 environment, use the only
keyword argument.
python setup_tree.py -e -o dr14