| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  | variable "HAYSTACK_VERSION" { | 
					
						
							|  |  |  |   default = "main" | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | variable "GITHUB_REF" { | 
					
						
							|  |  |  |   default = "" | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | variable "IMAGE_NAME" { | 
					
						
							|  |  |  |   default = "deepset/haystack" | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | variable "IMAGE_TAG_SUFFIX" { | 
					
						
							|  |  |  |   default = "local" | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | variable "BASE_IMAGE_TAG_SUFFIX" { | 
					
						
							|  |  |  |   default = "local" | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | variable "HAYSTACK_EXTRAS" { | 
					
						
							|  |  |  |   default = "" | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | group "base" { | 
					
						
							| 
									
										
										
										
											2023-07-07 10:23:14 +02:00
										 |  |  |   targets = ["base-cpu", "base-gpu", "base-cpu-remote-inference"] | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | group "api" { | 
					
						
							| 
									
										
										
										
											2023-07-07 10:23:14 +02:00
										 |  |  |   targets = ["cpu", "gpu", "cpu-remote-inference"] | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | group "api-latest" { | 
					
						
							| 
									
										
										
										
											2023-07-07 10:23:14 +02:00
										 |  |  |   targets = ["cpu-latest", "gpu-latest", "cpu-remote-inference-latest"] | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | group "all" { | 
					
						
							| 
									
										
										
										
											2023-07-07 10:23:14 +02:00
										 |  |  |   targets = ["base", "base-gpu", "cpu", "gpu", "cpu-remote-inference"] | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-16 15:33:24 +02:00
										 |  |  | target "base-cpu" { | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  |   dockerfile = "Dockerfile.base" | 
					
						
							| 
									
										
										
										
											2022-09-16 15:33:24 +02:00
										 |  |  |   tags = ["${IMAGE_NAME}:base-cpu-${IMAGE_TAG_SUFFIX}"] | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  |   args = { | 
					
						
							|  |  |  |     build_image = "python:3.10-slim" | 
					
						
							| 
									
										
										
										
											2023-01-27 09:48:05 +01:00
										 |  |  |     base_image = "python:3.10-slim" | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  |     haystack_version = "${HAYSTACK_VERSION}" | 
					
						
							| 
									
										
										
										
											2023-06-27 11:47:40 +02:00
										 |  |  |     haystack_extras = notequal("",HAYSTACK_EXTRAS) ? "${HAYSTACK_EXTRAS}" : "[docstores,inference,crawler,preprocessing,file-conversion,ocr,onnx,metrics,beir]" | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2022-10-11 12:29:33 +02:00
										 |  |  |   platforms = ["linux/amd64", "linux/arm64"] | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-07 10:23:14 +02:00
										 |  |  | target "base-cpu-remote-inference" { | 
					
						
							|  |  |  |   inherits = ["base-cpu"] | 
					
						
							|  |  |  |   tags = ["${IMAGE_NAME}:base-cpu-remote-inference-${IMAGE_TAG_SUFFIX}"] | 
					
						
							|  |  |  |   args = { | 
					
						
							|  |  |  |     haystack_extras = notequal("",HAYSTACK_EXTRAS) ? "${HAYSTACK_EXTRAS}" : "[preprocessing]" | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  | target "base-gpu" { | 
					
						
							|  |  |  |   dockerfile = "Dockerfile.base" | 
					
						
							|  |  |  |   tags = ["${IMAGE_NAME}:base-gpu-${IMAGE_TAG_SUFFIX}"] | 
					
						
							|  |  |  |   args = { | 
					
						
							| 
									
										
										
										
											2022-12-30 11:34:27 +01:00
										 |  |  |     # pytorch/pytorch:1.13.1-cuda11.6 ships Python 3.10.8
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     build_image = "pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime" | 
					
						
							| 
									
										
										
										
											2023-01-27 09:48:05 +01:00
										 |  |  |     base_image = "pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime" | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  |     haystack_version = "${HAYSTACK_VERSION}" | 
					
						
							| 
									
										
										
										
											2023-06-27 11:47:40 +02:00
										 |  |  |     haystack_extras = notequal("",HAYSTACK_EXTRAS) ? "${HAYSTACK_EXTRAS}" : "[docstores-gpu,inference,crawler,preprocessing,file-conversion,ocr,onnx-gpu,metrics]" | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2022-10-11 12:29:33 +02:00
										 |  |  |   platforms = ["linux/amd64", "linux/arm64"] | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | target "cpu" { | 
					
						
							|  |  |  |   dockerfile = "Dockerfile.api" | 
					
						
							|  |  |  |   tags = ["${IMAGE_NAME}:cpu-${IMAGE_TAG_SUFFIX}"] | 
					
						
							|  |  |  |   args = { | 
					
						
							| 
									
										
										
										
											2023-01-03 12:26:26 +01:00
										 |  |  |     base_image = "${IMAGE_NAME}" | 
					
						
							| 
									
										
										
										
											2022-09-16 15:33:24 +02:00
										 |  |  |     base_image_tag = "base-cpu-${BASE_IMAGE_TAG_SUFFIX}" | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2022-10-11 12:29:33 +02:00
										 |  |  |   platforms = ["linux/amd64", "linux/arm64"] | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-07 10:23:14 +02:00
										 |  |  | target "cpu-remote-inference" { | 
					
						
							|  |  |  |   dockerfile = "Dockerfile.api" | 
					
						
							|  |  |  |   tags = ["${IMAGE_NAME}:cpu-remote-inference-${IMAGE_TAG_SUFFIX}"] | 
					
						
							|  |  |  |   args = { | 
					
						
							|  |  |  |     base_image = "${IMAGE_NAME}" | 
					
						
							|  |  |  |     base_image_tag = "base-cpu-remote-inference-${BASE_IMAGE_TAG_SUFFIX}" | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   platforms = ["linux/amd64", "linux/arm64"] | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | target "cpu-remote-inference-latest" { | 
					
						
							|  |  |  |   inherits = ["cpu-remote-inference"] | 
					
						
							|  |  |  |   tags = ["${IMAGE_NAME}:cpu-remote-inference"] | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  | target "cpu-latest" { | 
					
						
							|  |  |  |   inherits = ["cpu"] | 
					
						
							|  |  |  |   tags = ["${IMAGE_NAME}:cpu"] | 
					
						
							| 
									
										
										
										
											2022-10-11 12:29:33 +02:00
										 |  |  |   platforms = ["linux/amd64", "linux/arm64"] | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | target "gpu" { | 
					
						
							|  |  |  |   dockerfile = "Dockerfile.api" | 
					
						
							|  |  |  |   tags = ["${IMAGE_NAME}:gpu-${IMAGE_TAG_SUFFIX}"] | 
					
						
							|  |  |  |   args = { | 
					
						
							| 
									
										
										
										
											2023-01-03 12:26:26 +01:00
										 |  |  |     base_image = "${IMAGE_NAME}" | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  |     base_image_tag = "base-gpu-${BASE_IMAGE_TAG_SUFFIX}" | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2022-10-11 12:29:33 +02:00
										 |  |  |   platforms = ["linux/amd64", "linux/arm64"] | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | target "gpu-latest" { | 
					
						
							|  |  |  |   inherits = ["gpu"] | 
					
						
							|  |  |  |   tags = ["${IMAGE_NAME}:gpu"] | 
					
						
							| 
									
										
										
										
											2022-10-11 12:29:33 +02:00
										 |  |  |   platforms = ["linux/amd64", "linux/arm64"] | 
					
						
							| 
									
										
										
										
											2022-09-12 16:33:56 +02:00
										 |  |  | } |