Python module that exposes NEXUS analytical capabilities via a HTTP webservice. Accessible endpoints are described on the API page of the wiki.
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.
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
Install conda dependencies
cd analysis conda install -c conda-forge --file conda-requirements.txt
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.
install nexusproto
install data-access dependency:
cd data-access pip install cython python setup.py install
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
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
Launch unit tests
pip install pytest pip install -e . pytest
Launch python webservice/webapp.py
in command line or run it from the IDE.