Skip to content

Docker and SSH Tunnels

Felix Gabler edited this page Sep 24, 2020 · 15 revisions

At the moment there are three possible ways to work from outside the MPI.

Docker (does not always work 100%)

Our docker containers are supposed to allow for a comfortable way of working remotely.
Currently only KAlign, Clustal Omega and PSIBlast are available inside the containers (but no database yet).
There are basically two ways how to run our containers.

Production

  • open the docker-compose.yml and uncomment as specified by the [UP] lines.
  • run docker-compose up from inside the root folder to launch all container with logging available from each of them.

Development

During development, it makes sense to run frontend and backend in different shells. This way it won't be necessary to restart all containers on failure.
Backend container with sbt shell:

  • run docker-compose run --service-ports backend from inside the root folder. This will launch the backend and the database containers with a sbt shell opened on the backend container. You will only be able to see logging from the backend.
  • on the sbt shell use run to start the toolkit.

To start the frontend with bash access:

  • run docker-compose run --service-ports frontend from inside the root folder
  • on the bash run yarn install to install necessary frontend dependencies.
  • make sure that your .env.development.local (if it exists) uses the right ports (http/ws://localhost:9000).
  • on the bash run yarn run serve to start the frontend.

The frontend will be accessible at http://localhost:8080/.

Working via ssh tunnel

If you have CGW access to the MPI servers, you can tunnel via ssh.

e.g.

ssh -L 5556:olt.eb.local:22 fgabler@cgw.tuebingen.mpg.de

ssh -L 8080:olt.eb.local:8080 fgabler@cgw.tuebingen.mpg.de

where 5556 is a custom binding to map 22 to a local port and 8080 is the port on which the toolkit frontend instance runs (if you also want access to the backend on top of the proxy through the frontend, you also have to forward the corresponding port).

If you work with IntelliJ IDEA, you can set it up to automatically upload your changes to a remote server via SFTP (Tools -> Deployment). This way you can edit files on your local machine but also test your changes live on the MPI servers.

It is also possible to use Remote Debug by running the toolkit with a debug flag, i.e. sbt -jvm-debug 5005 shell and attaching to that port (after forwarding it through a SSH tunnel).

Working with local mongodb instance

Set the MONGODB_URI environment variable before running the toolkit, or you can use the application-ext.conf to set mongodb.uri.

e.g. "mongodb://localhost:27017/tkplay_dev"

You also need to download a file from http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz

and set MAXMIND_DB environment variable to its path

e.g. "/home/zin/GeoLite2-City.mmdb"