From 5b2920820e2ac4eb127632344b18a8da5b452d87 Mon Sep 17 00:00:00 2001 From: David Steinberg Date: Wed, 7 Dec 2016 15:05:27 -0800 Subject: [PATCH] Make default dockerfile ship with compliance Add space Change back to port 80 Set example data Move compliance data up a directory to avoid collisions --- Dockerfile | 2 +- deploy/001-ga4gh.conf | 5 +++-- deploy/config.py | 2 +- docs/installation.rst | 2 +- scripts/prepare_compliance_data.py | 11 +++++++---- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6a1bae35a..0f9b5ce10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,7 +57,7 @@ EXPOSE 80 # Prepare container for deployment # The directory that the user will land in when executing an interactive shell WORKDIR /srv/ga4gh/server -RUN python scripts/prepare_compliance_data.py -o ga4gh_example_data +RUN python scripts/prepare_compliance_data.py -o ../ga4gh-compliance-data # Default action: Bring up a webserver instance to run as a daemon CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] diff --git a/deploy/001-ga4gh.conf b/deploy/001-ga4gh.conf index bde337d20..dcc1b4171 100644 --- a/deploy/001-ga4gh.conf +++ b/deploy/001-ga4gh.conf @@ -5,10 +5,11 @@ 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 + WSGIScriptAlias / /srv/ga4gh/application.wsgi WSGIProcessGroup ga4gh WSGIApplicationGroup %{GLOBAL} Require all granted - \ No newline at end of file + + diff --git a/deploy/config.py b/deploy/config.py index 9039a5ef0..25ff173d6 100644 --- a/deploy/config.py +++ b/deploy/config.py @@ -1,3 +1,3 @@ import os -DATA_SOURCE = os.getenv('GA4GH_DATA_SOURCE', "/data/registry.db") +DATA_SOURCE = os.getenv('GA4GH_DATA_SOURCE', "/srv/ga4gh/ga4gh-compliance-data/registry.db") DEBUG = os.getenv('GA4GH_DEBUG', "") diff --git a/docs/installation.rst b/docs/installation.rst index 33e52c17d..3af5802ff 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -224,7 +224,7 @@ From the client, the server is accessible at ``http://server/``, and the ``/tmp/ .. code-block:: bash - #make a development dir and place the example client script in it + # make a development dir and place the example client script in it $ mkdir /tmp/mydev $ curl https://raw.githubusercontent.com/ga4gh/server/master/scripts/demo_example.py > /tmp/mydev/demo_example.py $ chmod +x /tmp/mydev/demo_example.py diff --git a/scripts/prepare_compliance_data.py b/scripts/prepare_compliance_data.py index b3a35171c..4a743d6ef 100644 --- a/scripts/prepare_compliance_data.py +++ b/scripts/prepare_compliance_data.py @@ -207,7 +207,8 @@ def run(self): readSrc.close() pysam.index(destFilePath) readGroupSet = reads.HtslibReadGroupSet(dataset, name) - readGroupSet.populateFromFile(os.path.abspath(destFilePath), os.abspath(destFilePath + ".bai")) + readGroupSet.populateFromFile(os.path.abspath( + destFilePath), os.path.abspath(destFilePath + ".bai")) readGroupSet.setReferenceSet(referenceSet) dataset.addReadGroupSet(readGroupSet) bioSamples = [hg00096BioSample, hg00099BioSample, hg00101BioSample] @@ -272,8 +273,9 @@ def run(self): self.repo.insertFeatureSet(featuresetG2P) # add g2p phenotypeAssociationSet - phenotypeAssociationSet = g2p_associationset\ - .RdfPhenotypeAssociationSet(dataset, "cgd", outputG2PPath) + phenotypeAssociationSet = \ + g2p_associationset.RdfPhenotypeAssociationSet( + dataset, "cgd", os.path.abspath(outputG2PPath)) self.repo.insertPhenotypeAssociationSet(phenotypeAssociationSet) self.repo.commit() @@ -312,7 +314,8 @@ def addVariantSet( dataset, variantFileName.split('_')[1]) variantSet.setReferenceSet(referenceSet) variantSet.populateFromFile( - [os.path.abspath(outputVcf + ".gz")], [os.path.abspath(outputVcf + ".gz.tbi")]) + [os.path.abspath(outputVcf + ".gz")], + [os.path.abspath(outputVcf + ".gz.tbi")]) variantSet.checkConsistency() for callSet in variantSet.getCallSets(): for bioSample in bioSamples: