-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/NCATS-Tangerine/reasoner-…
- Loading branch information
Showing
23 changed files
with
1,072 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/bash | ||
|
||
################################################################ | ||
## | ||
## BioNames is a generic facility which aggregates bio-ontology | ||
## lookup services. It retrieve names from IDs or IDs based | ||
## on Natural Language names. | ||
## | ||
## This is the Bash command line interface (CLI) for BioNames. | ||
## | ||
## author: Chuck Bennett | ||
## version: 0.1 | ||
## usage: | ||
## | ||
## exec: | ||
## | ||
## onto exec | ||
## ex: bionames exec | ||
## | ||
## test: | ||
## | ||
## onto test | ||
## ex: bionames test | ||
## | ||
## test_cov: | ||
## | ||
## onto test_cov | ||
## ex: bionames test_cov | ||
## | ||
################################################################ | ||
set -e | ||
|
||
## | ||
## Configure paths. | ||
## | ||
export CURDIR=$(pwd) | ||
export REASONERTOOLS=${CURDIR%/bin} | ||
export BIONAMES_ROOT=$REASONERTOOLS/builder/api | ||
export GREENT=$REASONERTOOLS/greent | ||
export TESTDIR=$GREENT/test | ||
export PYTHONPATH=$REASONERTOOLS:$BIONAMES_ROOT | ||
export GREENT_CONF=$GREENT/greent.conf | ||
|
||
export COVERAGE_DEBUG="sys,config" | ||
export COVERAGE_DEBUG_FILE=$CURDIR/pytestconfig.log | ||
|
||
## | ||
## Run the BioNames server | ||
## | ||
exec () { | ||
PYTHONPATH=$PYTHONPATH python3 $BIONAMES_ROOT/naming.py | ||
} | ||
|
||
## | ||
## Run tests on the BioNames server. | ||
## | ||
test () { | ||
pytest -p no:warnings -vv $TESTDIR/test_bionames.py | ||
} | ||
|
||
## | ||
## Run tests with code coverage. | ||
## | ||
test_cov () { | ||
cd .. | ||
pytest -p no:warnings -vv --cov=$GREENT --cov-report term --cov-config=$TESTDIR/.bionames_coveragerc $TESTDIR/test_bionames.py | ||
# Same test using coverage tool: | ||
#coverage run --rcfile=$TESTDIR/.bionames_coveragerc -m pytest -p no:warnings -vv $TESTDIR/test_bionames.py | ||
#coverage report --rcfile=$TESTDIR/.bionames_coveragerc | ||
} | ||
|
||
$* | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
#!/bin/bash | ||
|
||
export CURDIR=$(pwd) | ||
export REASONERTOOLS=${CURDIR%/bin} | ||
export DOCKER=$REASONERTOOLS/docker | ||
|
||
build () { | ||
local mod=$1 | ||
if [ -z "$mod" ]; then | ||
echo module name required | ||
fi | ||
docker build --no-cache $DOCKER/$mod -t renciorg/green-$mod | ||
} | ||
push () { | ||
local mod=$1 | ||
if [ -z "$mod" ]; then | ||
echo module name required | ||
fi | ||
docker push renciorg/green-$mod | ||
} | ||
clean () { | ||
images () { | ||
for i in $(sudo docker images | awk '{ print $3 }' | grep -vi image); do echo $i; sudo docker rmi -f $i; done | ||
} | ||
$* | ||
} | ||
|
||
all () { | ||
build base | ||
push base | ||
build onto_gunicorn | ||
push onto_gunicorn | ||
build bionames | ||
push bionames | ||
} | ||
|
||
all_bionames () { | ||
build base | ||
push base | ||
build bionames | ||
push bionames | ||
} | ||
|
||
all_onto_gunicorn () { | ||
build base | ||
push base | ||
build onto_gunicorn | ||
push onto_gunicorn | ||
} | ||
kill () { | ||
local mod=$1 | ||
if [ -z "$mod" ]; then | ||
echo module name required | ||
fi | ||
docker kill -s 9 $mod | ||
} | ||
shell () { | ||
local mod=$1 | ||
if [ -z "$mod" ]; then | ||
echo module name required | ||
fi | ||
docker exec -it $mod bash | ||
} | ||
monit () { | ||
set -x | ||
docker run \ | ||
--name monit \ | ||
--rm \ | ||
renciorg/green-monit-base $* | ||
set +x | ||
} | ||
tranql () { | ||
set -x | ||
docker run \ | ||
--name tranql \ | ||
--rm \ | ||
--publish=8101:8101 \ | ||
renciorg/green-tranql | ||
set +x | ||
} | ||
onto_gunicorn () { | ||
set -x | ||
local_dir=$1 | ||
docker run \ | ||
--env GIT_PULL=true \ | ||
--name ont \ | ||
--rm \ | ||
--publish=5001:5359 \ | ||
-v ${local_dir}:/data renciorg/green-onto_gunicorn | ||
set +x | ||
} | ||
bionames () { | ||
set -x | ||
local_dir=$1 | ||
docker run \ | ||
--env GIT_PULL=true \ | ||
--name bio \ | ||
--rm \ | ||
--publish=5001:5354 \ | ||
-v ${local_dir}:/data renciorg/green-bionames | ||
set +x | ||
} | ||
|
||
|
||
$* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/bash | ||
|
||
################################################################ | ||
## | ||
## Onto aggregates lookup services that provide generic facts | ||
## about ontologies. It leverages the Uberongraph RDB (a | ||
## SPARQL-queried Uberongraph database available at | ||
## https://stars-app.renci.org/uberongraph/#query) for data. | ||
## | ||
## This is the Bash command line interface (CLI) for Onto. | ||
## | ||
## author: Chuck Bennett | ||
## version: 0.1 | ||
## usage: | ||
## | ||
## exec: | ||
## | ||
## onto exec | ||
## ex: onto exec | ||
## | ||
## test: | ||
## | ||
## onto test | ||
## ex: onto test | ||
## | ||
## test_cov: | ||
## | ||
## onto test_cov | ||
## ex: onto test_cov | ||
## | ||
################################################################ | ||
set -e | ||
|
||
## | ||
## Configure paths. | ||
## | ||
export CURDIR=$(pwd) | ||
export REASONERTOOLS=${CURDIR%/bin} | ||
export GREENT=$REASONERTOOLS/greent | ||
export TESTDIR=$GREENT/test | ||
export PYTHONPATH=$GREENT/api:$REASONERTOOLS | ||
export GREENT_CONF=$GREENT/greent.conf | ||
|
||
export COVERAGE_DEBUG="sys,config" | ||
export COVERAGE_DEBUG_FILE=$CURDIR/pytestconfig_onto.log | ||
|
||
## | ||
## Run the onto gunicorn server | ||
## | ||
exec () { | ||
gunicorn onto_gunicorn:app --workers 1 --pythonpath=$PYTHONPATH | ||
} | ||
|
||
## | ||
## Run tests. | ||
## | ||
test () { | ||
pytest -p no:warnings -vv $TESTDIR/test_ontology.py | ||
} | ||
|
||
## | ||
## Run tests with code coverage. | ||
## | ||
test_cov () { | ||
cd $REASONERTOOLS | ||
pytest -p no:warnings -vv --cov=$GREENT --cov-report term --cov-config=$TESTDIR/.onto_coveragerc $TESTDIR/test_ontology.py | ||
# Same test using coverage tool: | ||
#coverage run --rcfile=greent/test/.onto_coveragerc -m pytest -p no:warnings -vv greent/test/test_ontology.py | ||
#coverage report --rcfile=greent/test/.onto_coveragerc | ||
} | ||
|
||
$* | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM python:3.6.5 | ||
ADD . /code | ||
WORKDIR /code | ||
|
||
RUN git clone https://github.com/NCATS-Tangerine/reasoner-tools.git | ||
|
||
RUN pip install -r reasoner-tools/greent/requirements.txt | ||
|
||
RUN apt-get update | ||
RUN apt-get install telnet | ||
RUN apt-get install -y emacs24 | ||
|
||
CMD ["PYTHONPATH=reasoner-tools", "python", "reasoner-tools/greent/rosetta.py", "--debug", "--test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM renciorg/green-base:latest | ||
|
||
ADD ./bionames_smartapi.sh . | ||
ADD ./synonym.py /usr/local/lib/python3.6/site-packages/pronto/synonym.py | ||
|
||
RUN chmod +x bionames_smartapi.sh | ||
|
||
ENV APP_PORT 5001 | ||
ENV NUM_WORKERS 2 | ||
ENV DATA_DIR /data | ||
ENV GIT_PULL false | ||
|
||
CMD ["./bionames_smartapi.sh"] |
Oops, something went wrong.