tree: 4e89dfe4f6fe1632dd51e3b958e3c1c39cd18a78 [path history] [tgz]
  1. .idea/
  2. static/
  3. tests/
  4. webservice/
  5. .gitignore
  6. __init__.py
  7. README.md
  8. test.py
analysis/README.md

analysis

Python module that exposes NEXUS analytical capabilities via a HTTP webservice. Accessible endpoints are described on the API page of the wiki.

Developer Setup

NOTE This project has a dependency on nexusproto. Make sure data-access is installed in the same environment you will be using for this module.

  1. Setup a separate conda env or activate an existing one

    conda create --name nexus-analysis python=3.8
    conda create -n nexus-analysis-38 --no-default-packages python=3.
    conda activate nexus-analysis
    
  2. Install conda dependencies

    cd analysis
    conda install -c conda-forge --file conda-requirements.txt
    
  3. Update the configuration for solr and cassandra

Create .ini files from a copy of their counterpart .ini.default

analysis/webservice/algorithms/doms/domsconfig.ini
data-access/nexustiles/config/datastores.ini

This files will override the default values.

They are not saved on git and will not be overridden when you pull the code.

BUT be carefull to remove them when you build the docker image. Otherwise they will be embedded and use in the docker image.

  1. install nexusproto

  2. install data-access dependency:

    cd data-access
    pip install cython
    python setup.py install
    
  3. Launch other requirements, through helm:

    cd ../helm/
    kubectl create namespace sdap 
    kubectl create configmap collections-config --from-file=../analysis/tests/redirect/ -n sdap
    helm install nexus . -n sdap
    kubectl port-forward service/nexus-cassandra 9042:9042 -n sdap
    
    
  4. Set environment variables (examples):

    PYTHONUNBUFFERED=1
    PROJ_LIB=/opt/anaconda2/envs/nexus-analysis/lib/python2.7/site-packages/pyproj/data
    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
    
  5. Launch unit tests

    pip install pytest pip install -e . pytest

  6. Launch python webservice/webapp.py in command line or run it from the IDE.