Skip to content

Telepresence Operation Guide

The services that comprise the Telepresence web application are a combination of docker containers and a NodeJS process. The data for both the docker containers and the NodeJS process are all located in the /data/telepresence directory. The application itself is a git checkout of the source code repository and is checked out in the /opt/telepresence/telepresence-app directory.

Note

Both the docker containers and the node process are all running under the teleadm account. In order to manage and/or deploy changes, IS will need to create a local account for you on telepresence.mbari.org and then set it up so you can change over to the teleadm account using sudo -u teleadm -i.

Docker Containers

There are three docker containers running under the teleadm account. The containers are:

  1. telepresence-app_dmconsumer_1: There are processes running on each boat that are reading in all datamanager items and then packaging those up into messages and pushing them to the dm_consumer queue on the datamanager virtual host running on RabbitMQ on messaging.shore.mbari.org. This container runs a process that reads these messages in, parses them and then pushes the relevant data into the various tables in the PostgreSQL database running in another container. The logs for this process are written to /data/telepresence/dm-consumer.
  2. telepresence-app_database_1: This is a container running a PostgreSQL database (data is stored in /data/telepresence/pgdata). There are four basic table in the database:
    1. data_item_names: contains information about data items including the server they came from and the name of the item.
    2. data_items: This table contains the actual data values that have been parsed from the messages (with timestamps)
    3. users: This is the table that keeps track of the Slack users that are associated with the telepresence application.
    4. vessels: Contains information about the vessels that have telepresence entries associated with them.
  3. telepresence-app_ftpserver_1: This container simply runs an SFTP service that listens on port 2222 on the host. Clients can connect to the service and push items that will then end up in the /data/telepresence/static directory. This is used to store screengrabs being pushed from the boat.

Checking Container Status

In order to check the status of the containers, you would ssh into telepresence.mbari.org, switch over to the teleadm account using sudo -u teleadm -i and then run:

docker ps

Stopping the Containers

In order to stop the containers, you would ssh into telepresence.mbari.org, switch over to the teleadm account using sudo -u teleadm -i and then cd to the /opt/telepresence/telepresence-app directory. Then to stop the containers you would run:

docker-compose down

which should shut down the running containers.

Starting the Container

The containers should stay running and try to restart themselves if they fail, but in order to start the containers manually, you would ssh into telepresence.mbari.org, switch over to the teleadm account using sudo -u teleadm -i and then cd to the /opt/telepresence/telepresence-app directory. Then you would run:

docker-compose up -d

which should start the containers in the background. You should then be able to log out.

NodeJS Application

The NodeJS server is started and stopped using a user-level systemctl configuration. You can see the configuration in the .config/systemd/user/telepresence_app.service file. In order to stop the server, you would ssh into telepresence.mbari.org, change to the teleadm user by running sudo -u teleadmin -i and then running systemctl --user stop telepresence_app. To start the application, you would run systemctl --user start telepresence_app. If you need to disable the service from running (it should try to restart if it fails), you can run systemctl --user disable telepresence_app and then re-enable it using systemctl --user enable telepresence_app.

Deploying Application Updates

If changes have been checked into the Git repository and need to be deployed to production, you can follow these steps:

  1. ssh into telepresence.mbari.org
  2. Change to the teleadm user by running sudo -u teleadm -i
  3. Change to the application directory by running cd /opt/telepresence/telepresence-app.
  4. Check out the new changes by running git pull origin (you will need the password with which it was checked out and you might need to stash any local changes before running the pull).
  5. Once the code has been updated (and after you apply any stashes to re-create any local changes), you want to build both the client and server applications by doing the following:
    1. cd client
    2. npm run build (this will take some time to build the client app and will deploy it to the ../api directory).
    3. cd ../api
    4. npm run build
    5. systemctl --user restart telepresence_app