mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-11-02 02:39:51 +00:00
Adding a minimal haystack gpu build (#2185)
* added minimal gpu image * Update Documentation & Code Style * removed old installations * build minimal images in gh action * quotes to single quotes * switched repos * fix * fix ordering * move to deepset dockerhub acc * update nvidia/cuda image to match newest torch+cu * refactor Dockerfile-GPU-minimal to optimize build * Remove spurious doc changes from tutorial6 * install ocr dependencies and pdftotext Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Sara Zan <sarazanzo94@gmail.com> Co-authored-by: Ivan Lopez <ivan@askai.net>
This commit is contained in:
parent
2a840ee248
commit
9096ddad34
18
.github/workflows/docker_build.yml
vendored
18
.github/workflows/docker_build.yml
vendored
@ -16,9 +16,18 @@ jobs:
|
||||
include:
|
||||
- dockerfile: Dockerfile
|
||||
repository: deepset/haystack-cpu
|
||||
tagprefix: ''
|
||||
default: true
|
||||
|
||||
- dockerfile: Dockerfile-GPU
|
||||
repository: deepset/haystack-gpu
|
||||
tagprefix: 'demo-'
|
||||
default: true
|
||||
|
||||
- dockerfile: Dockerfile-GPU-minimal
|
||||
repository: deepset/haystack-gpu
|
||||
tagprefix: 'minimal-'
|
||||
default: false
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@ -30,11 +39,12 @@ jobs:
|
||||
with:
|
||||
images: |
|
||||
${{ matrix.repository }}
|
||||
flavor: |
|
||||
latest=true
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=sha,format=long,prefix=
|
||||
type=ref,event=tag,prefix=${{ matrix.tagprefix }}
|
||||
type=sha,format=long,prefix=${{ matrix.tagprefix }}
|
||||
type=sha,format=long,prefix=,enable=${{ matrix.default }}
|
||||
type=raw,value=latest,prefix=${{ matrix.tagprefix }}
|
||||
type=raw,value=latest,prefix=,enable=${{ matrix.default }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
40
Dockerfile-GPU-minimal
Normal file
40
Dockerfile-GPU-minimal
Normal file
@ -0,0 +1,40 @@
|
||||
FROM nvidia/cuda:11.3.1-runtime-ubuntu20.04
|
||||
|
||||
WORKDIR /home/user
|
||||
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
|
||||
# Install software dependencies
|
||||
RUN apt-get update && apt-get install -y software-properties-common && \
|
||||
add-apt-repository ppa:deadsnakes/ppa && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
git \
|
||||
poppler-utils \
|
||||
python3-pip \
|
||||
python3.8 \
|
||||
python3.8-distutils \
|
||||
swig \
|
||||
tesseract-ocr && \
|
||||
# Cleanup apt cache
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
# Install PDF converter
|
||||
curl -s https://dl.xpdfreader.com/xpdf-tools-linux-4.03.tar.gz \
|
||||
| tar -xvzf - -C /usr/local/bin --strip-components=2 xpdf-tools-linux-4.03/bin64/pdftotext
|
||||
|
||||
# Copy Haystack package files but not the source code
|
||||
COPY setup.py setup.cfg pyproject.toml VERSION.txt LICENSE README.md /home/user/
|
||||
|
||||
# Install all the dependencies, including ocr component
|
||||
RUN pip3 install --upgrade --no-cache-dir pip && \
|
||||
pip3 install --no-cache-dir .[ocr] && \
|
||||
# Install PyTorch with CUDA 11
|
||||
pip3 install --no-cache-dir torch==1.10.2+cu113 -f https://download.pytorch.org/whl/torch_stable.html
|
||||
|
||||
# Copy Haystack source code
|
||||
COPY haystack /home/user/haystack/
|
||||
# Install Haystack
|
||||
RUN pip3 install --no-cache-dir --no-deps .[ocr] && \
|
||||
# Cleanup copied files after installation is completed
|
||||
rm -rf /home/user/*
|
||||
Loading…
x
Reference in New Issue
Block a user