Installation

astra can be installed in two different ways:

  1. Using a Conda environment, or
  2. Using modules to manage component versions and their dependencies.

If you don’t know what you want, you probably want to use a Conda environment. This will be suitable for testing and/or developing some part of astra locally. The second method is how astra is installed on SDSS inrastructure. You can expect the same results regardless of how you installed astra.

Using Conda

If you don’t want to install modules locally then you can install astra into a Conda environment. If you only want to test, execute, or develop astra then this kind of installation is fine.

Into a new environment

With a local installation we use Conda to manage a single environment for astra and all of its components to run from. Run the following commands to create an environment and install astra:

wget -O environment.yml https://raw.githubusercontent.com/sdss/astra/master/etc/environment.yml
conda env create -f environment.yml

Now, activate the Conda environment:

conda activate astra

To install the bleeding-edge version of astra, use:

git clone https://github.com/sdss/astra.git
cd astra/
python setup.py install

To an existing environment

If you already have a Conda environment that you’d like to install astra to (instead of having astra in it’s own environment) then you can install it from source:

git clone https://github.com/sdss/astra.git
cd astra/
python setup.py install

Using modules

If you already use TCLSH modules or LUA modules then you can install astra in such a way that you can manage multiple different versions of components, and their dependencies. This allows you to track changes in survey results as they change with time.

Alternatively, you can install astra using a Conda environment (see Using Conda).

Install astra

The following instructions will install astra using the sdss_install tool. The first thing you will need to do is make sure that you have either TCLSH modules or LUA modules installed, then follow the steps below. These instructions are modified from Benjamin Murphy’s guide for installing sdss_install.

  1. Create a new directory under which all of your SDSS-related software will be built, and associated module files. For example:

    mkdir -p ~/software/sdss/github/modulefiles
    
  2. Set the SDSS_INSTALL_PRODUCT_ROOT environment variable to the directory you created. For example:

    export SDSS_INSTALL_PRODUCT_ROOT=~/software/sdss
    
  3. Add the sdss_install modulefiles directories to your module path. Following the example from the previous 2 steps:

    module use ~/software/sdss/github/modulefiles
    module use ~/software/sdss/svn/modulefiles
    
  4. Clone sdss_install from GitHub:

    git clone https://github.com/sdss/sdss_install.git github/sdss_install/master
    
  5. Generate a GitHub Personal Access Token (see this guide) with read-only permissions and set this token as an environment variable named SDSS_GITHUB_KEY:

    export SDSS_GITHUB_KEY=abcdef123456
    
  6. Run the bootstrap installer:

    ./github/sdss_install/master/bin/sdss_install_bootstrap
    
  7. Now put sdss_install on your path:

    module load sdss_install
    
  8. Now you can install astra using the following command:

    sdss_install astra
    
  9. Now put astra on your path:

    module load astra
    

Steps 2, 5, 7, and 9 can be added to your .bashrc or .tcshrc file so that you don’t have to execute them again every time you load a new terminal.

Using astra on SDSS infrastructure

astra is already installed on SDSS infrastructure at Utah. To make it available in your current session you can use the command:

module load astra

Installing bleeding-version of astra from source at Utah

You almost never want to do this. This is just for Andy Casey because this kind of information is not written down anywhere!

` module switch python/3.7.3 git clone git@github.com:sdss/astra.git cd astra/ pip install -r requirements.txt python setup.py install --prefix=~/.local `

And don’t forget to set your pgpass to avoid psycopg2.OperationalError exceptions.