refactor to allow use with console entry points

This commit is contained in:
Eric Ma
2019-09-05 11:54:34 -04:00
parent 33985614d3
commit 952cb1e8e1
30 changed files with 224 additions and 64 deletions
+26 -18
View File
@@ -1,50 +1,58 @@
# Overview #
# Overview
Cellxgene Gateway allows you to use the Cellxgene Server provided by the Chan Zuckerberg Institute (https://github.com/chanzuckerberg/cellxgene) with multiple datasets. It displays an index of available h5ad (anndata) files. When a user clicks on a file name, it launches a Cellxgene Server instance that loads that particular data file and once it is available proxies requests to that server.
# Running locally #
## Running locally
0. This project requires python 3.6 or higher. Please check your version with
python --version
```bash
$ python --version
```
1. Set up a venv with
```
```bash
python -m venv .cellxgene-gateway
source .cellxgene-gateway/bin/activate
```
2. Install requirements with
```
1. Install requirements with
```bash
pip install -r requirements.txt
```
3. Prepare a folder with .h5ad files, for example
```
mkdir cellxgene_data
1. Prepare a folder with .h5ad files, for example
```bash
mkdir ../cellxgene_data
wget https://github.com/chanzuckerberg/cellxgene/raw/master/example-dataset/pbmc3k.h5ad -O ../cellxgene_data/pbmc3k.h5ad
```
4. Copy run.sh.example to run.sh:
```
1. Copy run.sh.example to run.sh:
```bash
cp run.sh.example run.sh
```
`run.sh` defines various environment variables:
* DEPLOYMENT_ENV - expects 'dev', 'tst' or 'prd'
* CELLXGENE_LOCATION - the location of the cellxgene executable, e.g. ~/anaconda2/envs/cellxgene/bin/cellxgene
* CELLXGENE_DATA - a directory that can contain subdirectories with .h5ad data files, *without* trailing slash, e.g. /mnt/cellxgene_data
* GATEWAY_HOST - the hostname and port that the gateway will run on, typically localhost:5005 if running locally
* GATEWAY_PROTOCOL - typically http when running locally, can be https when deployed if the gateway is behind a load balancer or reverse proxy.
* `DEPLOYMENT_ENV` - expects 'dev', 'tst' or 'prd'
* `CELLXGENE_LOCATION` - the location of the cellxgene executable, e.g. ~/anaconda2/envs/cellxgene/bin/cellxgene
* `CELLXGENE_DATA` - a directory that can contain subdirectories with .h5ad data files, *without* trailing slash, e.g. /mnt/cellxgene_data
* `GATEWAY_HOST` - the hostname and port that the gateway will run on, typically localhost:5005 if running locally
* `GATEWAY_PROTOCOL` - typically http when running locally, can be https when deployed if the gateway is behind a load balancer or reverse proxy.
The defaults should be fine if you set up a venv and cellxgene_data folder as above.
5. Finally, execute run.sh:
1. Finally, execute run.sh:
```
source run.sh
```
# Customization #
# Customization
The current paradigm for customization is to modify files during a build or deployment phase: