Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The package sims_catUtils interfaces with a MS SQL Server database at UW containing simulated catalogs of stars, galaxies, solar system objects.

For security reasons, this database is only available for direct connection from within the University of Washington campus. To connect from off campus, you must create an ssh tunnel through the publicly-facing machine gateway.astro.washington.edu using a shared account that has been created for this purpose.  This requires a couple steps to authenticate. 

Warning
titleconnection parameters and passwords subject to change
Connection elements will change. If you suddenly are unable to connect, check back to this page for the latest connection parameters and credentials.


The following instructions outline how to connect from off campus. The instructions assume that your favorite port number is 51433 (any free port number should do) and that you have installed the stack and setup sims_catUtils:

Code Block
languagebash
source $INSTALL_DIR/loadLSST.sh          # bash users where $INSTALL_DIR is where the LSST Stack was installed
eups distrib install lsst_sims -t sims   # install sims utilities
setup sims_catUtils -t sims              # set up package

Step 1) SSH Tunnel from Off Campus

First open an ssh tunnel, using local port forwarding switch -L. From any terminal on your machine:

Code Block
languagebash
titleCommand to open SSH Tunnel
collapsetrue
ssh -L 51433:fatboy.phys.washington.edu:1433 simsuser@gateway.astro.washington.edu

Your local ssh client will connect to the remote ssh server (gateway) and bind the local port 51433 to remote port 1433 of the server hosting the database (fatboy).


Note
titleFirst time connecting?

For access to the shared UW account, please send your public ssh key to Scott Daniel (scottvalscott at gmail) and Yusra AlSayyad (yusra at uw dot edu)

Step 2) Change default connection parameters

Now edit the file that contains the default connection parameters: $SIMS_CATUTILS_DIR/config/db.py  so that it knows to connect to your local port 51433.  Note: you may not actually need to edit this file, depending on the version of the stack you have installed.  Regardless, it should look like the code below.

Code Block
languagepy
titleContent of $SIMS_CATUTILS_DIR/config/db.py
collapsetrue
config.driver='mssql+pymssql'
config.host='localhost'
config.port='51433'
config.database='LSSTCATSIM'

 

Step 3) SQL Server Authentication

The previous steps provide network access to the server, but a password is required to connect to the database instance. A shared read-only SQL Server account is available for querying the catalogs. The LSST stack requires that passwords be stored in a file located in your home directory.

Create a $HOME/.lsst/db-auth.paf file with the following content. The port should be your local port that you chose when creating the ssh tunnel. 

Code Block
languagetext
themeEclipse
titleContent of db-auth.paf policy file
database: {
    authInfo: {
        host: localhost
        port: 51433
        user: <shared username>
        password: <shared password>
    }
}

Authorization information for more than one database server may be included for example:

Code Block
languagetext
themeEclipse
titleExample db-auth.paf policy file for multiple servers
collapsetrue
database: {
    authInfo: {
        host: localhost
        port: 51433
        user: <shared username>
        password: <shared password>
    }
    authInfo: {
        host: fatboy.phys.washington.edu #if you are on campus
        port: 1433
        user: <shared username>
        password: <shared password>
    }
}


The directory $HOME/.lsst must have 700 permissions and these files must each have 600 permissions (go-rwx in all cases).

Code Block
languagebash
cd $HOME
chmod 700 .lsst
chmod 600 .lsst/db-auth.paf


What should you put in place of the user and password? UW Database Credentials

If you do not have access to the above link, the SQL Server account details will be given to you when you send your ssh key to Scott Daniel or Yusra AlSayyad.