diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ea7996d..b09cfd10 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,9 @@ name: build on: + pull_request: + branches: + - master push: branches: - master @@ -27,7 +30,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: config/Dockerfile + file: Dockerfile push: true tags: ghcr.io/${{ github.repository }}:latest build-args: | diff --git a/config/Dockerfile b/Dockerfile similarity index 95% rename from config/Dockerfile rename to Dockerfile index 02ba84aa..8437d38e 100644 --- a/config/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -FROM continuumio/miniconda3:latest +FROM continuumio/miniconda3:4.12.0 # Install system dependencies. RUN apt-get update -y && \ @@ -8,7 +8,7 @@ RUN apt-get update -y && \ # Add the local code to the /app directory and set it to be the working directory. # Since we mount the /app directory as a volume in docker-compose.yml, this # allows us to automatically update the code in the Docker image when it's changed. -ADD .. /app +ADD . /app WORKDIR /app # Get the arguments from the docker-compose environment. diff --git a/README.org b/README.org index e8394a0c..e03bc37d 100644 --- a/README.org +++ b/README.org @@ -37,9 +37,13 @@ - [[https://github.com/debanjum/semantic-search/tree/master/src/interface/emacs#installation][Install]] [[./src/interface/emacs/semantic-search.el][semantic-search.el]] - Run ~M-x semantic-search ~ +** Run Unit tests + + `pytest` + ** Upgrade #+begin_src shell - docker-compose build + docker-compose build --pull #+end_src ** Troubleshooting diff --git a/config/environment.yml b/config/environment.yml index bb1dc845..289d20d7 100644 --- a/config/environment.yml +++ b/config/environment.yml @@ -2,19 +2,19 @@ name: semantic-search channels: - conda-forge dependencies: - - python=3.* - - numpy=1.* - - pytorch=1.* - - transformers=4.* + - python=3.8.* + - numpy=1.22.4 + - pytorch=1.11.0 + - transformers=4.19.4 - sentence-transformers=2.1.0 - - fastapi=0.* - - uvicorn=0.* - - pyyaml=5.* - - pytest=6.* - - pillow=8.* - - torchvision=0.* - - openai=0.* - - pydantic=1.* - - jinja2=3.0.* - - aiofiles=0.* - - huggingface_hub=0.* \ No newline at end of file + - fastapi=0.77.1 + - uvicorn=0.17.6 + - pyyaml=6.0 + - pytest=7.1.2 + - pillow=8.4.0 + - torchvision=0.12.0 + - openai=0.20.0 + - pydantic=1.9.1 + - jinja2=3.1.2 + - aiofiles=0.8.0 + - huggingface_hub=0.8.1 diff --git a/docker-compose.yml b/docker-compose.yml index a75e77d0..fbf2a6b8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ services: server: build: context: . - dockerfile: config/Dockerfile + dockerfile: Dockerfile args: - PORT=8000 ports: @@ -28,6 +28,9 @@ services: # You can set these volumes to point to empty directories on host - ./tests/data/embeddings/:/data/embeddings/ - ./tests/data/models/:/data/models/ - + deploy: + resources: + limits: + memory: 8g # Use 0.0.0.0 to explicitly set the host ip for the service on the container. https://pythonspeed.com/articles/docker-connection-refused/ command: --host="0.0.0.0" --port=8000 -c=config/sample_config.yml -vv