Merge pull request #29 from debanjum/saba/fix-docker-build

Address Issues with Docker builds
This commit is contained in:
sabaimran
2022-07-06 21:32:37 -04:00
committed by GitHub
5 changed files with 31 additions and 21 deletions

View File

@@ -1,6 +1,9 @@
name: build name: build
on: on:
pull_request:
branches:
- master
push: push:
branches: branches:
- master - master
@@ -27,7 +30,7 @@ jobs:
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
file: config/Dockerfile file: Dockerfile
push: true push: true
tags: ghcr.io/${{ github.repository }}:latest tags: ghcr.io/${{ github.repository }}:latest
build-args: | build-args: |

View File

@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
FROM continuumio/miniconda3:latest FROM continuumio/miniconda3:4.12.0
# Install system dependencies. # Install system dependencies.
RUN apt-get update -y && \ 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. # 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 # 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. # allows us to automatically update the code in the Docker image when it's changed.
ADD .. /app ADD . /app
WORKDIR /app WORKDIR /app
# Get the arguments from the docker-compose environment. # Get the arguments from the docker-compose environment.

View File

@@ -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]] - [[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 <user-query>~ - Run ~M-x semantic-search <user-query>~
** Run Unit tests
`pytest`
** Upgrade ** Upgrade
#+begin_src shell #+begin_src shell
docker-compose build docker-compose build --pull
#+end_src #+end_src
** Troubleshooting ** Troubleshooting

View File

@@ -2,19 +2,19 @@ name: semantic-search
channels: channels:
- conda-forge - conda-forge
dependencies: dependencies:
- python=3.* - python=3.8.*
- numpy=1.* - numpy=1.22.4
- pytorch=1.* - pytorch=1.11.0
- transformers=4.* - transformers=4.19.4
- sentence-transformers=2.1.0 - sentence-transformers=2.1.0
- fastapi=0.* - fastapi=0.77.1
- uvicorn=0.* - uvicorn=0.17.6
- pyyaml=5.* - pyyaml=6.0
- pytest=6.* - pytest=7.1.2
- pillow=8.* - pillow=8.4.0
- torchvision=0.* - torchvision=0.12.0
- openai=0.* - openai=0.20.0
- pydantic=1.* - pydantic=1.9.1
- jinja2=3.0.* - jinja2=3.1.2
- aiofiles=0.* - aiofiles=0.8.0
- huggingface_hub=0.* - huggingface_hub=0.8.1

View File

@@ -3,7 +3,7 @@ services:
server: server:
build: build:
context: . context: .
dockerfile: config/Dockerfile dockerfile: Dockerfile
args: args:
- PORT=8000 - PORT=8000
ports: ports:
@@ -28,6 +28,9 @@ services:
# You can set these volumes to point to empty directories on host # You can set these volumes to point to empty directories on host
- ./tests/data/embeddings/:/data/embeddings/ - ./tests/data/embeddings/:/data/embeddings/
- ./tests/data/models/:/data/models/ - ./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/ # 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 command: --host="0.0.0.0" --port=8000 -c=config/sample_config.yml -vv