Skip to content

Read only demo at ens lyon.fr

Eugenia Oshurko edited this page Jun 11, 2020 · 6 revisions

This page may be of use if you want to update the read-only demo of KAMIStudio hosted at the ens-lyon.fr (http://kamistudio.ens-lyon.fr). Note that we use a non-secure http protocol and our demo is read-only: no updates to the database can be made.

To get your access rights to the server where the demo is hosted, please contact MILIP. Please, check with them if you can access the server from outside of LIP (or if there is a VPN you need to connect to).

We use apache2 server and its module mod_wsgi to host our Flask app.

How to navigate in the server?

The main user for all KAMIStudio-related files and processes is kamiuser. If you want to update any Python-dependencies, you need to switch to kamiuser and do it from there, e.g.:

su - kamiuser
pip install --upgrade networkx

If you use which python while being logged-in as kamiuser, you can verify that we use Anaconda's Python binary located at /opt/anaconda3/bin/python. So, if you want to run the right Python binary from root, you can simply use /opt/anaconda3/bin/python to install or upgrade some packages.

In home of kamiuser you may find some other folders used by KAMIStudio, such as uploads and flask_session.

If you want to modify server configurations or start/stop/restart it, you should stay in root. The two destinations that interest us are:

  • /etc/apache2/ contains the configurations for the server (apache2.conf, if nothing breaks or changes, there is no need to change anything in this file).
  • /var/www/kamistudio contains the configurations of our application.

How to stop/start/restart the server?

In the directory /var/www/kamistudio, you can find a pre-generated bin for starting and stopping the server, for example ./apachectl restart, ./apachectl stop.

Where to find error logs?

You can find error logs that can help you to troubleshoot the application in the file error_log.

Where is the right kamistudio.conf (aka configs of KAMIStudio used by Flask)?

On our remote server it is /var/www/kamistudio/kamistudio.conf (there is a chance that it is actually either ~/KAMIStudio/kamistudio/instance/config.py or ~/KAMIStudio/kamistudio.conf, to verify).

KAMIStudio allows us to create a read-only instance. To make the remote instance read-only kamistudio.conf contains the following line:

READ_ONLY = True

Anytime you update KAMIStudio, do not forget to check in the config file that the parameter READ_ONLY is set to True (also in ~/KAMIStudio/kamistudio/instance/config.py and ~/KAMIStudio/kamistudio.conf).

In this file you also can find and modify the addresses and credentials for connecting to Neo4j or MongoDB.

What is the sequence of steps to update KAMIStudio or one of it's dependencies on the server?

Upgrade a dependency

If it is a library from PyPI that we want to update, for example, networkx, it can be done as follows:

  • from root /opt/anaconda3/bin/pip install --upgrade networkx,

  • from kamiuser pip install --upgrade networkx.

The required custom Python libraries (ReGraph/KAMI and KAMIStudio), where python setup.py install should be performed are located in home of our root. If you want to update one of the libraries, for example, ReGraph, to the new version from git, you can do the following from root):

cd ~/ReGraph
git fetch
git rebase
/opt/anaconda3/bin/python setup.py install

The same applies for the update in KAMIStudio itself:

cd ~/KAMIStudio
git fetch
git rebase
/opt/anaconda3/bin/python setup.py install

Now we need to restart the server:

cd /var/www/kamistudio
./apachectl restart