Skip to content

Commit

Permalink
Merge from master
Browse files Browse the repository at this point in the history
  • Loading branch information
Irene Papakonstantinou committed May 23, 2016
2 parents d328f35 + 44d7355 commit 53f60d4
Show file tree
Hide file tree
Showing 41 changed files with 27,088 additions and 2,803 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Dockerfile
.git
.dockerignore
./build
*.swp
ga4gh-env
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ before_script:

# run_tests.py runs everything under the script: tag so only put commands
# under it that we want to run (and want to be able to run) as local tests
script:
- flake8 *.py tests ga4gh scripts --exclude=ez_setup.py,ga4gh/*_pb2.py
script:
- flake8 *.py tests ga4gh scripts
--exclude=ez_setup.py,ga4gh/*_pb2.py,ga4gh/datamodel/obo_parser.py
- nosetests --with-coverage --cover-package ga4gh
--cover-inclusive --cover-min-percentage 80
--cover-branches --cover-erase
Expand Down
66 changes: 53 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,61 @@
############################################################
## Dockerfile to build the ga4gh server on mod_wsgi-express
## Configurable to use a local dataset
## Based on mod_wsgi-docker
## Results of this build are available from Dockerhub as afirth/ga4gh_server_apache:prod
############################################################
FROM grahamdumpleton/mod-wsgi-docker:python-2.7-onbuild
FROM ubuntu

# File Author / Maintainer
MAINTAINER Alastair Firth
# Originally created by Steve Hershman GitHub @hershman
# previously maintained by Alastair Firth
# currently maintained by Maciek Smuga-Otto at UCSC Genomics Institute
MAINTAINER Maciek Smuga-Otto <[email protected]>

# Place the config, if an existing config is not in place
ADD deploy/config.py /app/ga4gh/docker_config.py
RUN cp --no-clobber /app/ga4gh/docker_config.py /app/ga4gh/config.py
# Update the sources list
RUN apt-get update

# Pass '-e GA4GH_DATA_SOURCE=/container/data/path' and '-v /host/data/path:/container/data/path:ro' to docker run to mount local data
# See docs for more info
# Install packages
RUN apt-get install -y tar git curl wget dialog net-tools build-essential \
python python-dev python-distribute python-pip zlib1g-dev \
apache2 libapache2-mod-wsgi libxslt1-dev libffi-dev libssl-dev

CMD [ "--working-directory", "ga4gh", \
"--log-to-terminal", \
"ga4gh/application.wsgi" ]
# Enable wsgi module
RUN a2enmod wsgi

# Create cache directories
RUN mkdir /var/cache/apache2/python-egg-cache && \
chown www-data:www-data /var/cache/apache2/python-egg-cache/

# build the GA4GH server
RUN mkdir -p /srv/ga4gh/server
WORKDIR /srv/ga4gh/server

# Configure the python requirements
# Do this as a separate step prior to the build so that changes
# to the GA4GH Server codebase do not trigger a full rebuild of the
# pip requirements.
COPY requirements.txt /srv/ga4gh/server/
RUN pip install -r requirements.txt

# Install the code
COPY . /srv/ga4gh/server/
RUN python setup.py install

# Write new apache config
COPY deploy/001-ga4gh.conf /etc/apache2/sites-available/001-ga4gh.conf

# Write application.wsgi
COPY deploy/application.wsgi /srv/ga4gh/application.wsgi
COPY deploy/config.py /srv/ga4gh/config.py

# Configure apache to serve GA4GH site
WORKDIR /etc/apache2/sites-enabled
RUN rm -f 000-default.conf && ln -s /etc/apache2/sites-available/001-ga4gh.conf 001-ga4gh.conf

# Open port 80 for HTTP
EXPOSE 80

# Prepare container for deployment
# The directory that the user will land in when executing an interactive shell
WORKDIR /srv/ga4gh/server

# Default action: Bring up a webserver instance to run as a daemon
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
14 changes: 14 additions & 0 deletions deploy/001-ga4gh.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
WSGIDaemonProcess ga4gh python-eggs=/var/cache/apache2/python-egg-cache \
processes=10 threads=1
WSGIScriptAlias /ga4gh /srv/ga4gh/application.wsgi
<Directory /srv/ga4gh>
WSGIProcessGroup ga4gh
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>
</VirtualHost>
2 changes: 1 addition & 1 deletion deploy/application.wsgi
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from ga4gh.frontend import app as application
import ga4gh.frontend as frontend
frontend.configure("/app/ga4gh/config.py")
frontend.configure("/srv/ga4gh/config.py")
13 changes: 1 addition & 12 deletions deploy/config.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
# Configuration file for server, including Flask, see configuration documentation
# for details
# This file needs to be copied to /app/ga4gh/config.py by default
import os

#TODO this logic could move to frontend.configure() or BaseConfig
# For docker, if/when a default is set in serverconfig.py, run -v /localdata:/default-path
# If the env variable GA4GH_DATA_SOURCE is set, use that path. Otherwise, use the default path
DATA_SOURCE = os.getenv('GA4GH_DATA_SOURCE', "/ga4gh-example-data")

# If the env variable GA4GH_DEBUG is set, use that. Otherwise, use the empty string (False)
# Enable with True.
# WARNING: this enables Flask debugging and is insecure.
DATA_SOURCE = os.getenv('GA4GH_DATA_SOURCE', "/data/repo.db")
DEBUG = os.getenv('GA4GH_DEBUG', "")
52 changes: 0 additions & 52 deletions deploy/variants/centos-demo-noapache/Dockerfile

This file was deleted.

22 changes: 0 additions & 22 deletions deploy/variants/demo/Dockerfile

This file was deleted.

49 changes: 0 additions & 49 deletions deploy/variants/ubuntu-demo-apache/Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinxarg.ext',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
Loading

0 comments on commit 53f60d4

Please sign in to comment.