Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Operations

pkshiu edited this page Dec 3, 2014 · 24 revisions

Operating Environment

The OCL operating environemnt is as follow:

  • all outside request is handled by nginx
    • nginx uses named virtualhost to distinguish types of request, currently beta.openconceptlab.org and api.openconceptlab.org
  • both API and WEB django applications run internally on specific ports responding only to localhost request
  • both applications use gunicorn and wsgi
  • supervisor is used to control the django applications
  • both applications run under the deployment user account

starting/stopping

Django applications

  • to start and stop the django applications, simply use the supervisor control commands using the deployment user account:
supervisorctl stop
supervisorctl start

# or

supervisorctl restart

Note that supervisorctl also has an interactive mode. Just enter supervisorctl to try.

Normally, you can just use the fabric commands to start/stop the servers remotely.

supervisor

The supervisor daemon starts via system startup normally. To start/stop/restart it manually (as root):

/etc/init.d/supervisord start
/etc/init.d/supervisord stop
/etc/init.d/supervisord restart

nginx

The nginx light weight web server starts via system startup normally. To start/stop/restart it manually (as root):

/etc/init.d/nginx start
/etc/init.d/nginx stop
/etc/init.d/nginx restart

log files

All the log files are currently written to the /var/log/ocl directory.

See:

  • /var/log/ocl/web_app.log for web application normal logging
  • /var/log/ocl/web_debug.log for web application debug logging of API calls to api server
  • /var/log/api_supervisor.log for supervisor output for the API gunicorn
  • /var/log/web_supervisor.log for supervisor output for the WEB gunicorn

The logging setup is likely to change...

Configurations

See:

  • /etc/nginx/conf.d/*.conf
  • /etc/supervisor/conf.d/*.conf

Environment Variable/Configurations

Settings for the django applications are set in the appropriate supervisor conf files: Location of directory and environment variables.

Normal Code Release Process

For normal day to day software release, use the fabfile in the ocl_web repo to do the release: ( You can replace dev with production or staging )

fab dev release_web_app

# or

fab dev release_api_app

# the fab file in oclapi repo still works as well just for the api app
cd oclapi/src/django-nonrel/ocl
fab dev deploy

Clone this wiki locally