Installation Script issues for Ubuntu 16.04

18 views
Skip to first unread message

ezra.j.rice

unread,
Aug 1, 2017, 3:37:34 PM8/1/17
to Tethys Platform
I recently installed two instances of Tethys Platform on my machine to test scalability with parent-child platform relationships and found that the installation script isn't properly changing the default port when I set the -p option. I have been just starting the child instance using (tethys)$ tethys manage start -p 9000 instead but I just found some time to post this to the forum. Any ideas on why this would have not worked? When I ran the installation script, I used $ bash install_tethys.sh -t ~/tethys-child -p 9000. I also noticed that the default docker installation for postgis was 5436 in the settings file, but was still on 5435 when I ran (tethys)$ tethys docker ip

Scott Christensen

unread,
Aug 3, 2017, 9:42:23 AM8/3/17
to ezra.j.rice, Tethys Platform
Ezra, 

I'm guessing that these "errors" are just misunderstandings with changes in the 2.0 installation that haven't been explained very well. Let me try to explain them better and then you can let me know if you are still getting unexpected behavior.

The port option
I think the port issue you are having is probably just that the port command is not as cool as you think it should be.  I'll first give some background to give some context for what that port option is doing. With conda environments there can be shell scripts that are executed every time you active the environment. These shell scripts generally set environmental variables that are needed for packages that are installed into that environment. With the new Tethys installation one of these conda environment scripts is created that sets some environmental variables as well as adds some shortcut commands (or aliases) to make working with Tethys a little easier. If you want to see exactly what this script is doing you can find it at TETHYS_HOME/miniconda/envs/tethys/etc/conda/activate.d/tethys-activate.sh (in your case TETHYS_HOME is ~/tethys-child). If you look in that file you'll see that there is an environmental variable that stores the TETHYS_PORT that you specified (i.e. 9000) and then an alisas `tms` that is just a short cut for the command that you've been running (tethys manage start -p localhost:9000). So, in summary the only thing that the -p option does during installation is setup the `tms` shortcut to use the specified port. If you don't use the shortcut and you run the full command `tethys manage start` then the "default" port that was specified won't be used.

Tethys Databases
The difference in ports for the database is by design because there are now two different database servers. I've had to explain this several times (which means I should have put this in the documentation) so I'll just copy an explanation I've already written up, but let me know if you have further questions after reading through it:

First, it is important to understand that there are two different uses of database servers in Tethys. The first is for what I call the Tethys database. This is where all of the Django databasetables are created that store, for example, user accounts. It is also where any global Tethys portal settings are stored (think anything you would access through the admin pages). The connection information for this database is stored in the settings.py file under DATABASES.

The second kind of database server is for the apps. This used to be a single database server, and the connection information used to be stored in the settings.py file under TETHYS_DATABASES. With Tethys 2.0 there can now be multiple apps database servers and the connection information is now stored as a Persistent Store Service in the Tethys Admin pages.

In practice, before Tethys 2.0, these two database servers (the Tethys database server and the apps database server) were usually the same server (provided by the postgis docker). This created a dependency on Docker that made installing Tethys difficult or complicated. To eliminate the strict dependency on Docker I changed the Tethys database server to be a local postgres server that is installed through conda. The database files are stored in TETHYS_HOME/psql. The postgis docker can be installed to serve as the apps database server, but it is not strictly required.

It is important to understand that none of the command line options for the install script that start with --db (e.g. --db-username, --db-password, and --db-port) refer to the postgis docker container. The only thing that these options will effect are the local postgres database server and the settings.py file. If you want to specify the username and password etc. for the postgis docker container then you have to omit the -d from the --docker-options string and manually enter those in when prompted.

For production instances it may still be desired to use the postgis docker as the database server for both the Tethys database and the apps databases. This approach is not directly supported by the installation script (although Nathan has proposed that we do support it). The install script will always install the local database server. To get around using it you can either manually change the connection information in settings.py, or you can install tethys in two steps where you install it in development mode first and then run the install script again specifying the production parameters.



On Tue, Aug 1, 2017 at 2:37 PM ezra.j.rice <ezra....@gmail.com> wrote:
I recently installed two instances of Tethys Platform on my machine to test scalability with parent-child platform relationships and found that the installation script isn't properly changing the default port when I set the -p option. I have been just starting the child instance using (tethys)$ tethys manage start -p 9000 instead but I just found some time to post this to the forum. Any ideas on why this would have not worked? When I ran the installation script, I used $ bash install_tethys.sh -t ~/tethys-child -p 9000. I also noticed that the default docker installation for postgis was 5436 in the settings file, but was still on 5435 when I ran (tethys)$ tethys docker ip

--
You received this message because you are subscribed to the Google Groups "Tethys Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tethysplatfor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tethysplatform/865a0dc8-7f1d-45a8-be6e-5306a2de0b1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Scott D. Christensen, PhD
Research Civil Engineer
Information Technology Laboratory  
US Army Corps of Engineers
 
Reply all
Reply to author
Forward
0 new messages