To run this Django application locally, start by installing Python and virtualenv. When developing locally, build a local virtualenv, install the dependencies and start the server:
$ cd <project root dir>
$ git clone https://github.com/afgane/ghem.git
$ virtualenv .
$ source bin/activate
$ pip install -r ghem/requirements.txt
$ python ghem/ghem/manage.py runserver
To deploy this app on an machine (e.g., cloud image), have it run behind a
web proxy (e.g., nginx), and start at machine boot, do the following steps.
By default, scripts included in the repository assume the code is cloned to
(i.e., the project root directory is) /home/ubuntu/weather
.
- Do all of the above above steps excluding starting the development server
- Place
nginx.conf
in?/nginx/conf/.
directory - Make sure
nginx
starts at instance boot (already happens for CloudMan images) - Place
ghem_upstart.conf
in/etc/init
(to test that the service invocation works, make surenginx
is running and then start the service with:service ghem_upstart start
) - Clean up and bundle the image (if using CloudBioLinux scripts, this can be done with the
following command:
fab -f fabfile.py -u ubuntu -i [key] -H [ip] install_biolinux:target=cleanup
)
The default location for the source of the Django app is
/home/ubuntu/weather
. The app starts up via an Upstart job
service ghem_upstart status|start|stop|restart
and runs run_gunicorn.sh
from the source repo.
The location of the log file for the Django app is specified in
run_gunicorn.sh
file (defaults to /tmp/log/gunicorn/ghem.log
).
All of the models to be run are stored in /var/opt/IMOGEN/
The job manager (i.e., SGE) scripts are stored in
[DRMAAJobRunner.jobs_working_dir]/run_##.sh
, which defaults to
/mnt/transient_nfs/ghem/jobs_working_dir
. The stdout/err for those scripts
is stored in the same directory with names matching the submission script and
.out
/.err
extensions.
The locations of CloudMan log files, which is used to orchestrate the setup of the system, are in the the following locations:
- /opt/cloudman/pkg/ec2autorun.log
- /tmp/cm/cm_boot.log
- /mnt/cm/paster.log