Tethys Dependencies

33 views
Skip to first unread message

sdc50

unread,
Feb 4, 2017, 5:14:08 PM2/4/17
to Tethys Platform
I was playing around with the dependencies and just need to make a few notes to refer to later:

This was the most boiled-down, updated list of dependencies that I was able to get:

dependencies:
- python=2.7*
- azure=0.10.0
- django=1.9*
- bokeh
- paste
- psycopg2
- sqlalchemy
- requests
- PasteScript
- selenium
- coverage
- docker-py
- geoalchemy2
- pip=9.0*
- pillow
- plotly
- uwsgi
- pip:
    - django-gravatar2
    - django-bootstrap3
    - django-model-utils
    - django-guardian
    - django-simple-captcha
    - django-termsandconditions
    - owslib>=0.8.0,<0.9.0
    - tethys_dataset_services
    - condorpy
    - TethysCluster
    - python_social_auth==0.2.14

owslib >= 0.10.0 is available on conda, but it breaks Tethys (not sure why; it fails silently; I plan to look into it at some point).

The following packages need to be updated for us to be able to switch to Python 3:

* tethys_dataset_services
* condorpy
* TethysCluster (I think we just need to remove this from Tethys)
* PasteScript (this is available for Python 3 on pip, but not on conda).

To find a list of packages that depend on (for example) postgresql, use the following command:

grep postgresql /opt/miniconda/pkgs/*/info/index.json

In conda django depends on gdal which in turn depends on sqlite and postgresql, so both database packages are already in the environment. I was not able to get the database to initialize with a sqlite database. Although I'm interested in chasing down exactly why its not working, for academic reasons, I don't really think we should use sqlite as a development database. To set up postgresql locally to serve as the Tethys database execute the following commands:

sudo useradd postgres

sudo
-u postgres /opt/miniconda/envs/tethys/bin/initdb -D psql/data
sudo
-u postgres /opt/miniconda/envs/tethys/bin/pg_ctl -D psql/data -l logfile start

sudo
-u postgres /opt/miniconda/envs/tethys/bin/psql --command "CREATE USER tethys_default WITH NOCREATEDB NOCREATEROLE NOSUPERUSER PASSWORD 'pass';"

sudo
-u postgres /opt/miniconda/envs/tethys/bin/createdb -O tethys_default tethys_default -E utf-8 -T template0

This requires changing the port in settings.py for the default database to 5432. We probably start the database on port 5435 to match the default settings, but its probably better to keep it on the default to avoid conflict with the dockers if those end up getting set up. We could change the settings template to default to 5432 for the default database.

sdc50

unread,
Feb 5, 2017, 9:34:39 AM2/5/17
to Tethys Platform
On Windows (and probably on Linux too):

psql -U postgres --command "CREATE USER tethys_default WITH NOCREATEDB NOCREATEROLE NOSUPERUSER PASSWORD 'pass';"
createdb -U postgres -O tethys_default -E utf-8 -T template0 tethys_default

I believe that a system postgres user is not necessary this way.

Also, it's probably best to pass an absolute path to the psql/data directory. Maybe an environmental variable to the Tethys repo would be useful.

sdc50

unread,
Feb 5, 2017, 5:12:07 PM2/5/17
to tethysp...@googlegroups.com
Open port on Windows:

netsh advfirewall firewall add rule name="postgresql" dir=in action=allow protocol=TCP localport=5432

Add User on Windows:

net user $user_name  /add > /dev/null 2>&1


Reply all
Reply to author
Forward
0 new messages