From 0e2a8f9e58a31ae80242d3516f1c4711aafdf357 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 5 Jun 2021 15:16:29 -0700 Subject: [PATCH] Bump nlpsandbox-client from 1.1.0 to 2.0.0 in /server (#115) * Bump nlpsandbox-client from 1.1.0 to 2.0.0 in /server Bumps [nlpsandbox-client](https://github.com/nlpsandbox/nlpsandbox-client) from 1.1.0 to 2.0.0. - [Release notes](https://github.com/nlpsandbox/nlpsandbox-client/releases) - [Commits](https://github.com/nlpsandbox/nlpsandbox-client/compare/1.1.0...2.0.0) --- updated-dependencies: - dependency-name: nlpsandbox-client dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Update nlpsandbox-client to v3 * Remove nlpsandbox-client from test-requirements.txt * Import from nlpsandbox-client v3 * Review how .env is used with docker * Comment out docker-compose.yml validation * Add nlpsandbox-client to Test Requirements * Fix test-requirements.txt Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Connor Boyle Co-authored-by: tschaffter --- .env.example | 20 ++++++++++++++++--- .github/workflows/ci.yml | 6 +++--- .gitignore | 6 +++--- README.md | 4 ++-- docker-compose.yml | 4 +++- .../deidentified_note_controller.py | 4 ++-- server/openapi_server/test/utils.py | 6 +++--- server/requirements.txt | 2 +- server/test-requirements.txt | 1 - 9 files changed, 34 insertions(+), 19 deletions(-) diff --git a/.env.example b/.env.example index c474e02..7322032 100644 --- a/.env.example +++ b/.env.example @@ -1,16 +1,30 @@ -# API SERVER +# NLP Sandbox PHI Deidentifier SERVER_PROTOCOL=http:// SERVER_HOST=localhost -SERVER_PORT=8080 +SERVER_PORT=80 +## Tool dependencies +### NLP Sandbox Date Annotator DATE_ANNOTATOR_PROTOCOL=http:// DATE_ANNOTATOR_HOST=localhost DATE_ANNOTATOR_PORT=9000 +### NLP Sandbox Person Name Annotator PERSON_NAME_ANNOTATOR_PROTOCOL=http:// PERSON_NAME_ANNOTATOR_HOST=localhost PERSON_NAME_ANNOTATOR_PORT=9001 +### NLP Sandbox Physical Address Annotator PHYSICAL_ADDRESS_ANNOTATOR_PROTOCOL=http:// PHYSICAL_ADDRESS_ANNOTATOR_HOST=localhost -PHYSICAL_ADDRESS_ANNOTATOR_PORT=9002 \ No newline at end of file +PHYSICAL_ADDRESS_ANNOTATOR_PORT=9002 + +### NLP Sandbox Contact Annotator +CONTACT_ANNOTATOR_PROTOCOL=http:// +CONTACT_ANNOTATOR_HOST=localhost +CONTACT_ANNOTATOR_PORT=9003 + +### NLP Sandbox ID Annotator +ID_ANNOTATOR_PROTOCOL=http:// +ID_ANNOTATOR_HOST=localhost +ID_ANNOTATOR_PORT=9004 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fdbd95d..8b4b434 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,9 +65,9 @@ jobs: entrypoint: hadolint args: server/Dockerfile - - name: Validate docker-compose.yml - run: | - docker-compose -f docker-compose.yml config >/dev/null + # - name: Validate docker-compose.yml + # run: | + # docker-compose -f docker-compose.yml config >/dev/null - name: Check that packages in requirements.txt files are in asc order run: | diff --git a/.gitignore b/.gitignore index 35e7535..7d0a6e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ +.env .empty/ .vscode/ -node_modules/ - -client/env_vars dist.yaml +client/env_vars +node_modules/ openapi.yaml openapitools.json \ No newline at end of file diff --git a/README.md b/README.md index dba59c3..546c6f5 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ You can stop the container run with `Ctrl+C`, followed by `docker-compose down`. We recommend using a Conda environment to install and run the PHI Deidentifier. - conda create --name phi-deidentifier python=3.9.1 + conda create --name phi-deidentifier python=3.9.4 -y conda activate phi-deidentifier Start the NLP tool dependencies. @@ -78,7 +78,7 @@ Start the NLP tool dependencies. Install and start the PHI Deidentifier. cd server/ - pip install -e . + pip install -r requirements.txt python -m openapi_server ### Updating NLP tool dependencies diff --git a/docker-compose.yml b/docker-compose.yml index 084f337..8179d3a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,6 +43,8 @@ services: dockerfile: Dockerfile container_name: phi-deidentifier restart: always + env_file: + - .env environment: - DATE_ANNOTATOR_HOST=date-annotator - DATE_ANNOTATOR_PORT=8080 @@ -77,7 +79,7 @@ services: - nlpsandbox - nlpsandbox-internal ports: - - "80:80" + - "${SERVER_PORT}:80" depends_on: - phi-deidentifier diff --git a/server/openapi_server/controllers/deidentified_note_controller.py b/server/openapi_server/controllers/deidentified_note_controller.py index 6763789..cd02c4f 100644 --- a/server/openapi_server/controllers/deidentified_note_controller.py +++ b/server/openapi_server/controllers/deidentified_note_controller.py @@ -1,6 +1,6 @@ import connexion -from datanode.model.note_id import NoteId -from datanode.model.patient_id import PatientId +from nlpsandbox.model.note_id import NoteId +from nlpsandbox.model.patient_id import PatientId from openapi_server.models.deidentify_request import DeidentifyRequest # noqa: E501 from openapi_server.models import DeidentificationStep, DeidentifyResponse, \ diff --git a/server/openapi_server/test/utils.py b/server/openapi_server/test/utils.py index b2389c6..ec9af4d 100644 --- a/server/openapi_server/test/utils.py +++ b/server/openapi_server/test/utils.py @@ -1,6 +1,6 @@ -from datanode.model.note import Note -from datanode.model.note_id import NoteId -from datanode.model.patient_id import PatientId +from nlpsandbox.model.note import Note +from nlpsandbox.model.note_id import NoteId +from nlpsandbox.model.patient_id import PatientId from openapi_server.models import Tool, License diff --git a/server/requirements.txt b/server/requirements.txt index 7a6861a..b42dd94 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -1,6 +1,6 @@ connexion==2.7.0 mongoengine==0.23.1 -nlpsandbox-client==1.1.0 +nlpsandbox-client==3.0.0 psycopg2-binary==2.8.6 requests==2.25.1 swagger-ui-bundle==0.0.8 \ No newline at end of file diff --git a/server/test-requirements.txt b/server/test-requirements.txt index 1276fc3..16571e9 100644 --- a/server/test-requirements.txt +++ b/server/test-requirements.txt @@ -1,5 +1,4 @@ Flask-Testing==0.8.1 -nlpsandbox-client==1.1.0 pytest-cov>=2.8.1 pytest-randomly==3.8.0 # needed for python 2.7+3.4 pytest~=6.2.4 # needed for python 2.7+3.4