|
1 | | -# Haystack Docker image |
| 1 | +<p align="center"> |
| 2 | + <a href="https://www.deepset.ai/haystack/"><img src="https://raw.githubusercontent.com/deepset-ai/haystack/main/docs/img/haystack_logo_colored.png" alt="Haystack"></a> |
| 3 | +</p> |
2 | 4 |
|
3 | 5 | Haystack is an end-to-end framework that enables you to build powerful and production-ready |
4 | 6 | pipelines for different search use cases. The Docker image comes with a web service |
5 | | -configured to serve Haystack's `rest_api` to ease pipelines' deployments in containerized |
| 7 | +configured to serve Haystack's `rest_api` to ease pipeline deployments in containerized |
6 | 8 | environments. |
7 | 9 |
|
8 | | -Start the Docker container binding the TCP port `8000` locally: |
| 10 | +To start the Docker container binding the TCP port `8000` locally, run: |
9 | 11 | ```sh |
10 | 12 | docker run -p 8000:8000 deepset/haystack |
11 | 13 | ``` |
12 | 14 |
|
13 | | -If you need the container to access other services available in the host: |
| 15 | +If you need the container to access other services available in the host, run: |
14 | 16 | ```sh |
15 | 17 | docker run -p 8000:8000 --network="host" deepset/haystack |
16 | 18 | ``` |
17 | 19 |
|
18 | | -## Image variants |
| 20 | +## Image Variants |
19 | 21 |
|
20 | | -The Docker image comes in two variants: |
21 | | -- `haystack:cpu-<version>`: this image is smaller but doesn't support GPU |
22 | | -- `haystack:gpu-<version>`: this image comes with the Cuda runtime and is capable of running on GPUs |
| 22 | +The Docker image comes in four variants: |
| 23 | +- `haystack:gpu-<version>` contains Haystack dependencies as well as what's needed to run the REST API and UI. It comes with the CUDA runtime and is capable of running on GPUs. |
| 24 | +- `haystack:cpu-<version>` contains Haystack dependencies as well as what's needed to run the REST API and UI. It has no support for GPU so must be run on CPU. |
| 25 | +- `haystack:base-gpu-<version>` only contains the Haystack dependencies. It comes with the CUDA runtime and is capable of running on GPUs. |
| 26 | +- `haystack:base-cpu-<version>` only contains the Haystack dependencies. It has no support for GPU so must be run on CPU. |
23 | 27 |
|
24 | | - |
25 | | -## Image development |
| 28 | +## Image Development |
26 | 29 |
|
27 | 30 | Images are built with BuildKit and we use `bake` to orchestrate the process. |
28 | | -You can build a specific image by simply run: |
| 31 | +You can build a specific image by running: |
29 | 32 | ```sh |
30 | 33 | docker buildx bake gpu |
31 | 34 | ``` |
32 | 35 |
|
33 | 36 | You can override any `variable` defined in the `docker-bake.hcl` file and build custom |
34 | | -images, for example if you want to use a branch from the Haystack repo: |
| 37 | +images, for example if you want to use a branch from the Haystack repo, run: |
35 | 38 | ```sh |
36 | 39 | HAYSTACK_VERSION=mybranch_or_tag BASE_IMAGE_TAG_SUFFIX=latest docker buildx bake gpu --no-cache |
37 | 40 | ``` |
38 | 41 |
|
39 | | -### A note about multi-platform builds |
| 42 | +### Multi-Platform Builds |
| 43 | + |
| 44 | +Haystack images support multiple architectures. But depending on your operating system and Docker |
| 45 | +environment, you might not be able to build all of them locally. |
| 46 | + |
| 47 | +You may encounter the following error when trying to build the image: |
40 | 48 |
|
41 | | -Haystack images support multiple architectures, but depending on your operating system and Docker |
42 | | -environment you might not be able to build all of them locally. If you get an error like: |
43 | 49 | ``` |
44 | 50 | multiple platforms feature is currently not supported for docker driver. Please switch to a different driver |
45 | 51 | (eg. “docker buildx create --use”) |
46 | 52 | ``` |
47 | 53 |
|
48 | | -you might need to override the `platform` option and limit local builds to the same architecture as |
| 54 | +To get around this, you need to override the `platform` option and limit local builds to the same architecture as |
49 | 55 | your computer's. For example, on an Apple M1 you can limit the builds to ARM only by invoking `bake` like this: |
| 56 | + |
50 | 57 | ```sh |
51 | 58 | docker buildx bake base-cpu --set "*.platform=linux/arm64" |
52 | 59 | ``` |
|
0 commit comments