Skip to content
Graeme Watt edited this page Oct 6, 2017 · 20 revisions

Note: these are internal instructions for deployment on the CERN OpenStack infrastructure.

Therefore, unless you're deploying HEPData.net, you may safely ignore this document.

Running tests locally

It's good practice to check that the tests pass locally before pushing to GitHub. You first need to create a local database called hepdata_test, then the command can be found in the .travis.yaml file:

py.test tests -k 'not tests/e2e'

You can then push to the master branch on GitHub. The local tests can interfere with the index, so you might need to run hepdata utils reindex locally after running the tests to recover your original records. Check that the tests pass on Travis for the master branch on GitHub.

Pushing to the production branch

The production branch is used for deployment. To synchronise with the master branch, repeat the following steps locally:

git rebase master production
git push
git checkout master

Deploying via hepdata-builder1

First ssh to aiadm.cern.ch, then to root@hepdata-builder1.

workon hepdata
cdvirtualenv scripts

fab update
fab build
fab -u <user_name> -I deploy

You can also stop and start as well as deploy.

Debugging online

There are some bugs that are difficult or impossible to reproduce locally, therefore debugging online is necessary. This can be done by editing the source code directly on the web servers. Any changes will be overwritten when the code is deployed. First ssh to aiadm.cern.ch, then to root@hepdata-web1 or root@hepdata-web2. The source code is in the /opt/hepdata/src/hepdata directory. Files need to be edited on both machines hepdata-web1 and root@hepdata-web2, then the updated .pyc files can be generated from the edited .py files using supervisorctl restart gunicorn, before taking some action from a web browser directed at the hepdata.net site. Log files can be found in the /var/log/supervisor directory.

Clone this wiki locally