Skip to content

Instantly share code, notes, and snippets.

@tonigi
Last active April 10, 2020 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonigi/af05b4e9911bed9e20c7d2a537473a74 to your computer and use it in GitHub Desktop.
Save tonigi/af05b4e9911bed9e20c7d2a537473a74 to your computer and use it in GitHub Desktop.
Draft gpcrmd installation

Toni: I see two ways to distribute the software:

  1. Semi-manual install using Vagrant. Draft instructions are below, based on Ismael's. All the relevant repositories must be made publicly-readable.

  2. Alternatively, distribute a self-contained, pre-ready "Vagrant Box". The latter should be easy and stable (doesn't depend on external downloads disappearing) but I have not tried it yet. There shouldn't be software license problems

Neither of the two works right now, because of some missing initialization.

GPCRmd: Local installation instructions

The following file provides instructions for a local installation of GPCRmd.

The server is based on Vagrant and VirtualBox technology. It will create a headless (no screen) virtual machine, to which you can connect via a web browser. The instructions are provided for Linux, but they should work with minor or no modifications under Windows and OSX.

Prerequisites

Make sure you have Vagrant, VirtualBox, and Git installed. Linux distributions may ship with an old version of Vagrant, so you will have to download and install the latest version from the Vagrant website.

For brevity, we show instructions using the https (as opposed to git) access protocol and Unix-style paths.

Step 1. Clone the gpcrmd_vagrant repository from GitHub, recursively

Open up a terminal and type

git clone --recursive https://github.com/GPCRmd/gpcrmd_vagrant.git ~/gpcrmd_vagrant

Step 2. Clone the gpcrdb repository

Clone into the "shared" directory (replace your-username with your read-only GitHub username)

cd ~/gpcrmd_vagrant
git clone https://github.com/your-username/gpcrdb.git shared/sites/protwis

Step 3. Download initialization data

Clone the gpcrmd_data repository in a temporary location. Two files are required:

  1. The latest dump, named dump*.backup
  2. The example trajectories, found compressed under files.

Therefore:

cd 
git clone https://github.com/GPCRmd/gpcrmd_data
cp gpcrmd_data/dbdumps/[dumpddmmyyyy].backup ~/gpcrmd_vagrant/shared/db/dump.backup   

The following should be fixed

  1. Download from https://github.com/GPCRmd/gpcrmd_data/releases 'files.tar.gz'.
  2. Extract 'files.tar.gz' into '~/gpcrmd_vagrant/shared/sites/'.
tar -xvzf your/download/folder/files.tar.gz -C ~/gpcrmd_vagrant/shared/sites/

Start the vagrant box

This will build the server and may take a few minutes.

vagrant up

Log into the vagrant VM and start the server

vagrant ssh -c "(cd /protwis/sites/protwis; /env/bin/python3 manage.py runserver 0.0.0.0:8000)"

You're all set up. The webserver will now be accessible from http://localhost:8000.

Stopping the server

To stop the server you may use vagrant halt. To delete the server and reclaim the disk space, usevagrant destroy (inside the gpcrmd_vagrant directory).

Notes

Windows-specific notes

Use an SSH client, e.g. PuTTY, with the following settings

host: 127.0.0.1
port: 2226
username: vagrant
password: vagrant

Other notes

The protwis directory is shared between the host machine and the virtual machine, and any changes made on the host machine will be instantly reflected on the server.

To run django commands from the protwis directory, ssh into the VM, and use the "/env/bin/python3" command e.g

cd ~/gpcrmd_vagrant/
vagrant ssh
cd /protwis/sites/protwis
/env/bin/python3 manage.py check protein

The database administration tool Adminer is installed and accessible at http://localhost:8082/adminer. Use the following settings

System: PostgreSQL
Server: localhost
Username: protwis
Password: protwis

If you experience problems with Virtualbox shared folders, use following command in your host machine to update guest additions in the VM:

cd ~/gpcrmd_vagrant/
vagrant plugin install vagrant-vbguest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment