Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sssom #145

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/target
57 changes: 37 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,45 @@
FROM renciorg/renci-python-image:v0.0.1
FROM python:3.10.6-buster

RUN mkdir /code
WORKDIR /code
# update/install basic tools
RUN apt-get update
RUN apt-get -y dist-upgrade
RUN apt-get install -yq build-essential curl

# install requirements
ADD ./requirements.txt requirements.txt
RUN pip install -r requirements.txt # --src /usr/local/src

# install library
ADD ./swagger_ui swagger_ui
ADD ./setup.py setup.py
ADD ./node_normalizer node_normalizer
ADD ./config.json config.json
ADD ./redis_config.yaml redis_config.yaml
ADD ./load.py load.py
# create a new non-root user
RUN groupadd -r nru && useradd -m -r -g nru nru
RUN chmod 755 /home/nru

RUN pip install -e .
ENV PATH="/home/nru/.cargo/bin:/home/nru/.local/bin:${PATH}"

# setup entrypoint
# gunicorn, hypercorn also options https://fastapi.tiangolo.com/deployment/manually/
# ENTRYPOINT ["python", "-m" , "uvicorn", "node_normalizer.server:app", "--app-dir", "/home/murphy/", "--port", "6380"]
USER nru
RUN curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal

RUN python -m pip install --upgrade pip

RUN chmod 777 ./
RUN mkdir /home/nru/code
WORKDIR /home/nru/code

# install requirements
COPY ./requirements.txt requirements.txt
COPY ./swagger_ui swagger_ui
COPY ./setup.py setup.py
COPY ./nn_io_rs nn_io_rs
COPY ./node_normalizer node_normalizer
COPY ./config.json config.json
COPY ./redis_config.yaml redis_config.yaml
COPY ./load.py load.py
COPY ./pyproject.toml pyproject.toml
COPY ./start_server.sh start_server.sh

USER root
RUN chown -R nru:nru ./
USER nru
ENTRYPOINT ["uvicorn", "--host", "0.0.0.0", "--port", "8080" , "--root-path", "/1.3", "--workers", "1", "--app-dir", "/code/", "--loop", "uvloop", "--http", "httptools", "node_normalizer.server:app"]
RUN python -m venv ./venv

RUN . venv/bin/activate && pip install -r requirements.txt --no-cache-dir && maturin develop -r -m ./nn_io_rs/Cargo.toml

# setup entrypoint
# gunicorn, hypercorn also options https://fastapi.tiangolo.com/deployment/manually/
#ENTRYPOINT ["python", "-m" , "uvicorn", "node_normalizer.server:app", "--app-dir", "/home/murphy/", "--port", "6380"]

CMD ./start_server.sh
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,20 @@ Users can find the publicly available website at [service](https://nodenormaliza
## Installation

Create a virtual environment
```
python -m venv nodeNormalization-env
```shell
python -m venv nodeNormalization-env
```
Activate the virtual environment
```
source nodeNormalization-env/bin/activate
```shell
source nodeNormalization-env/bin/activate
```
Install requirements
```shell
pip install -r requirements.txt
pushd nn_io_rs; maturin develop --release; popd
```
> pip install -r requirements.txt
```


## Generating equivalence data

The equivalence data can be generated by running [Babel](https://github.com/TranslatorSRI/Babel). An example of the contents of a compendia file is shown below:
Expand Down
Loading