Installation
astra can be installed in two different ways:
- Using a Conda environment, or
- 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
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.
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
Set the
SDSS_INSTALL_PRODUCT_ROOTenvironment variable to the directory you created. For example:export SDSS_INSTALL_PRODUCT_ROOT=~/software/sdss
Add the
sdss_installmodulefiles 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
Clone
sdss_installfrom GitHub:git clone https://github.com/sdss/sdss_install.git github/sdss_install/master
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
Run the bootstrap installer:
./github/sdss_install/master/bin/sdss_install_bootstrap
Now put
sdss_installon your path:module load sdss_install
Now you can install
astrausing the following command:sdss_install astra
Now put
astraon 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.