Skip to content

Commit

Permalink
Release 0.3 (#8)
Browse files Browse the repository at this point in the history
* Merging Griffin's changes (NCATS-Tangerine#118)

* Adds support for concept identifiers in auto completion. Fixes small messup with setError message dialog in autocompletion

* Adds query string parameter q/query to specify a TranQL query. Adds URL with query param to import/export interface for sharing. Fixes a couple css problems.

* Adds barebones interactive shell implementation. Overhauls find tool in favor of a Elasticlunr prototype

* Heavily extends on the functionality of the interactive shell. Adds intermediary prototype to shell for two-way communication. Adds basic functionality to intermediary, such as importing external modules and reading promises synchronously.

* Adds rudimentary multiline capability in shell thorugh the usage of \n. Adds some functionality to the shell intermediary.

* Adds an editor mode to the interactive shell for use with more complex programs

* Adds program tabs to script editor

* Minor changes to shell

* Adds resizing to overflowing tabs in script editor. Adds python syntax highlighting to script editor

* Basic (semifunctional) elasticlunr find tool searching

* Adds ability to use custom functions in where clause + unit test

* Ensures proper parsing of functions and lists + extends relevant units tests

* Adds named/keyword arguments to functions + adds corresponding unit test

* UDFs added .Refactor CustomFuntion (now CustomFunctions)

* Refactoring TranQL pyodide into module

* UDF format modified to be more expressive. Major refactor of App modals. A couple other things I'm forgetting

* Added promise utility to TranQLApp. Added graph operations to KnowledgeGraph. Pyodide loading and stuff does not occur until the shell is opened

* Quick fix to TranQLApp->render

* Adds variable support to lists. Fixes bug in expand_nodes where if a concept had multiple nodes and its first node was a variable, it would only generate questions for the variable

* Adds ability to use vars as function arguments

* Fixes commit to wrong branch

* Adds promise wrapper to pyodide_module

* adds (semi-functoinal) manifest for pip and reverts change to tranql_ast expand_nodes for now

* Removes interactive shell/pyodide

* Changes find tool to expand tokens for better results

* Lots of changes to find tool

* adds highlighting to find tool

* Remove context menu & add hover styles to find tool

* Adds github pages?

* test pages

* Adds more to pages

* Hopefully fixes pages theme

* Adds things to GitHub pages

* Adds example notebook directly into pages

* Adds UDFs info/comments & more functions

* Adds example docs to GitHub Pages. Adds __init__.py to tranql which never got committed

* Adds function docs to GitHub Pages

* Fixes error modal typo

* Adds history viewer prototype. Might be better to just sort cache viewer by timestamp.

* Adds ONTO sibling function

* Adds comment for failing unit test documenting a known bug which the test aims to prevent

* Changes expand_nodes to fix bug/unit test (NCATS-Tangerine#122).

* Set theme jekyll-theme-time-machine

* Adds documentation on how to add a function in udfs.py

* Set theme jekyll-theme-cayman

* Adds documentation on how to add a function in udfs.py. Changes jekyll theme in config back to just-the-docs

* Fixes some issues with the find tool. Comments out the history viewer.

Co-authored-by: frostyfan109 <urnancx@gmail.com>
Co-authored-by: frostyfan109 <urnansupersux@gmail.com>
Co-authored-by: frostyfan109 <31631417+frostyfan109@users.noreply.github.com>

* when using schema the expand nodes function fails to set starting nodes, and hence causing all graph grabbing, this was overlooked in initial merge.

* Udfs functions for parents and sibilings looking up wrong keys fix

* Error modal not closing properly fix

* docker image version bump for new dev image

* Update for planner, to fail iff no results can be found after trying all capable KPs.

* docker version bump

* Varnish docker image to slim debian version

* Trapi updates (NCATS-Tangerine#122)

* Backplane overhaul to enable centrizied of configuration and conversion between trapi versions

* Backplane overhaul to enable centrizied of configuration and conversion between trapi versions

* Addition of roger, update tranql frontend to talk to backplane always to ensure trapi configs are universal.
Updating tests to those changes

* docker image version bump

* gnbr and indigo

* Tests were that were using local server  to use mock servers

* icees update to latest bl lookup changes

* update tests to match biolink:PascalConceptType in tests

* Trapi 1.0 (NCATS-Tangerine#126)

* Trapi 1.0 overhaul

* Trapi 1.0 schema update.

* update unit test files to Trapi 1.0

* Dependency corrections

* Web prefix (NCATS-Tangerine#129)

* adding web_prefix conf for web api

* adding web_prefix conf for web api

* minor version added

* Convert renciorg refs to helxplatform refs.

* Web prefix (NCATS-Tangerine#133)

* adding web_prefix conf for web api

* adding web_prefix conf for web api

* minor version added

* bumping plater version

* Add UI conversion from TRAPI 1.0 to TRAPI 0.9.

* Web prefix for UI (NCATS-Tangerine#139)

* ui web prefix jinja way.
and adds reasoner to redis results.

* changes window.origin to window.href as root location of tranql to play well with prefixed proxy deployments.

* Parameterizes docker file to support building a branch for CI/CD.
Allows npm to build index file as a jinja template to web_prefix for static assets is allowed when serving
from flask. (This has no effect on local development)

* Update Dockerfile

* Parameterizes docker file to support building a branch for CI/CD. (NCATS-Tangerine#145)

- tranql app image should base off of tranql-base image that is build for a specific branch. In CI these two images are built in seq, and tranql-base for develop will checkout develop ,
- by default tranql-base is built for master and tranql-app will build off of tranql-base:latest.

* Configure message not being called filters out important nodes. (NCATS-Tangerine#147)

* skip and limit additions for cypher queries

* plater lib version bump

* test for skip and limit options on redis

* fixes test , upgrades plater

* strips / from main url (NCATS-Tangerine#154)

* Adding db to schema so it shows up on UI auto complete

* Refactoring merge endpoint.
Using config for faster parsing instead of a new tranql object

* Modify schema factory sending tranql config so its able to resolve redis password

* Parsing tweaks for 1. Suggesting concepts only base on context, i.e considering start and end nodes ,
2. sometimes numeric values cause errors , so tree.toString ensures that doesn't happen

* merge for trapi 1.0

* test overhaul for merge and schema supporting redis

* Score as summation of publication counts on each edge

* score test disable

* Support for max connections

* fixing api test for score

* Adding Makefile, Jenkinsfile, consolidated Docker, tranql src dir

* Makefile and Jenkinsfile

* Starting to organize & cleanup tests

* Makefile

* Test cleanup

* Bumping version

* Makefile

* Testing jenkins file

* Temp changing jenkins control flow

* Update Dockerfile

* Structural changes for simplified deployment

* Jenkins and Makefile

* using first message query graph fixed, now questions are also merged.

* root question as query graph for merged answers when using schema on from clause . Redis timeout placed

* schema to updated dynamically after redis is populated, and some tests

* test for empty schema tweak

* import at top

* plater version bump

* when grabbing trapi option, if tranql query parser does not set it, set to empty dict

* Fixing merge conflicts

* bump plater version

* requirements to fix tests

* Removing travis file

* - Update requirements.txt , just the required libs
- Dockerfile , need to override some conf on the chart so doing install makes dir location hard. for instance we mount tranql/conf/schema.yaml with redis server info, locating that in site-packages is hard

* upgrade bmt  concept model, and tests to remove chemical substance (#6)

Co-authored-by: Yaphetkg <yaphetkg@renci.org>

* Feature/local development (#7)

* upgrade bmt  concept model, and tests to remove chemical substance

* Updates schema.yaml to be redis dependent.
Adds make commands for local development

* Make schema.yaml path configurable via env var

Co-authored-by: Yaphetkg <yaphetkg@renci.org>

* Update _version.py

Co-authored-by: frostyfan109 <urnancx@gmail.com>
Co-authored-by: frostyfan109 <urnansupersux@gmail.com>
Co-authored-by: frostyfan109 <31631417+frostyfan109@users.noreply.github.com>
Co-authored-by: yaphetkg <kebedey@renci.com>
Co-authored-by: Chuck Bennett <cnbennett3@gmail.com>
Co-authored-by: cnbennett3 <53792237+cnbennett3@users.noreply.github.com>
Co-authored-by: Steven <scox@renci.org>
Co-authored-by: Carl Schreep <schreepc@renci.org>
Co-authored-by: Yaphetkg <yaphetkg@renci.org>
Co-authored-by: Carl Schreep <cschreep@users.noreply.github.com>
  • Loading branch information
11 people authored Sep 21, 2021
1 parent e14ea02 commit b607ab2
Show file tree
Hide file tree
Showing 173 changed files with 59,204 additions and 43,574 deletions.
20 changes: 20 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
npm-debug.log
.github/
.pytest_cache
docker/
docs/
kubernetes/
varnish-cache/
web/node_modules/

*.egg-info/

.env
.gitignore
.python-version
.travis.yml
docker-compose.yml
Dockerfile
Jenkinsfile

*.log
148 changes: 148 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
.idea/

# NPM
**/web/node_modules
**/web/build

# Filesystem
.DS_Store
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM python:3.7.3-alpine

RUN apk add build-base git libxslt-dev linux-headers make nodejs npm zeromq zeromq-dev

ENV USER tranql
ENV HOME /home/$USER

RUN addgroup -S $USER && adduser -S $USER -G $USER -s /bin/bash -h $HOME

USER $USER
WORKDIR $HOME

ENV PATH=$HOME/.local/bin:$PATH
ENV PUBLIC_URL={{web_prefix}}
ENV BACKPLANE=http://tranql-backplane.renci.org

COPY --chown=$USER . tranql/

WORKDIR $HOME/tranql/src/tranql/web
RUN npm install
RUN npm run build

WORKDIR $HOME/tranql
RUN pip install --user --upgrade pip
RUN pip install --user -r requirements.txt
ENV PYTHONPATH=$HOME/tranql/src/
41 changes: 41 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
pipeline {
agent {
kubernetes {
cloud 'kubernetes'
label 'agent-docker'
defaultContainer 'agent-docker'
}
}
stages {
stage('Install') {
steps {
sh '''
python3 -m pip install --user --upgrade pip
python3 -m pip install --user -r requirements.txt
python3 -m pip install --user .
'''
}
}
stage('Test') {
steps {
sh '''
make test
'''
}
}
stage('Publish') {
when {
buildingTag()
}
environment {
DOCKERHUB_CREDS = credentials('rencibuild_dockerhub_machine_user')
}
steps {
sh '''
echo $DOCKERHUB_CREDS_PSW | docker login -u $DOCKERHUB_CREDS_USR --password-stdin
make build
'''
}
}
}
}
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
recursive-include * *.txt
recursive-include * *.json
recursive-include * *.yaml
recursive-include * *.yml
recursive-include * *.yml
graft src/tranql/web/build
74 changes: 74 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
PYTHON = /usr/bin/env python3
VERSION_FILE = ./src/tranql/_version.py
VERSION = $(shell cut -d " " -f 3 ${VERSION_FILE})
DOCKER_REPO = docker.io
DOCKER_OWNER = helxplatform
DOCKER_APP = tranql
DOCKER_TAG = ${VERSION}
DOCKER_IMAGE = ${DOCKER_OWNER}/${DOCKER_APP}:$(DOCKER_TAG)
TEST_REDIS_DUMP_FILE = "https://stars.renci.org/var/kgx_data/v3.0/roger-mini.rdb"


.DEFAULT_GOAL = help

.PHONY: help clean install test build image publish

#help: List available tasks on this project
help:
@grep -E '^#[a-zA-Z\.\-]+:.*$$' $(MAKEFILE_LIST) | tr -d '#' | awk 'BEGIN {FS = ": "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

#clean: Remove old build artifacts and installed packages
clean:
rm -rf build
rm -rf dist
rm -rf src/tranql.egg-info
${PYTHON} -m pip uninstall -y tranql
${PYTHON} -m pip uninstall -y -r requirements.txt

#install.python: Install python application along with required development packages
install.python:
${PYTHON} -m pip install --upgrade pip
${PYTHON} -m pip install -r requirements.txt
${PYTHON} -m pip install .

#install.npm: Builds the NPM modules
install.npm:
cd src/tranql/web; npm install; npm run build

#install: Install application
install: install.python install.npm

#test.python: Run all python tests
test.python:
#${PYTHON} -m pytest --doctest-modules src
${PYTHON} -m pytest tests

#test.npm: Run all NPM tests
test.npm:
echo "test NPM"

#test: Run all tests
test: test.python test.npm

#build: Build Docker image
build:
echo "Building docker image: ${DOCKER_IMAGE}"
docker build -t ${DOCKER_IMAGE} -f Dockerfile .
echo "Successfully built: ${DOCKER_IMAGE}"

#publish: Build and push docker image
publish:
docker tag ${DOCKER_IMAGE} ${DOCKER_REPO}/${DOCKER_IMAGE}
docker push ${DOCKER_REPO}/${DOCKER_IMAGE}

#download: Downloads example dataset for redis
download:
mkdir -p redis_data/
if [ ! -f "./redis_data/dump.rdb" ] ; then \
wget ${TEST_REDIS_DUMP_FILE} -O redis_data/dump.rdb; \
fi

#run.local: seeds redis with data, builds web page and runs tranql docker container
run.local: download
docker-compose up -d
cd src/tranql/web; npm start;
18 changes: 18 additions & 0 deletions QUICKSTART.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Setting up server

Note: For building react app nodejs and npm are required.

1. Install node js dependencies.
```shell
make install.npm
```
2. Runs Tranql in a docker container, with reload enabled for the web server. UI is not reloaded on change but one can start
cd
```shell
make run.local
```

3. Browse to
1. [Tranql UI](http://localhost:8001)
2. [Openapi Swagger UI](http://localhost:8001/apidocs)
3. [Tranql UI served from Nodejs](http://localhost:3000)
16 changes: 16 additions & 0 deletions dev-schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
doc : |
The Translator schema aggregates reasoner schemas. Reasoner schemas
describe transitions between biolink-model types. These transitions are
expressed as predicates, also from the biolink-model.
schema:
redis:
doc: |
Roger is a knowledge graph built by aggregeting several kgx formatted knowledge graphs from several sources.
url: "redis:test"
redis: true
redis_connection_params:
host: redis_graph
port: 6379
# SET USERNAME and PASSWORD
# via ROGER_USERNAME , ROGER_PASSWORD Env vars (i.e capitialize service name)
Loading

0 comments on commit b607ab2

Please sign in to comment.