-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
108 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Docker image release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
tags: ["v[0-9].[0-9]+.[0-9]+*"] | ||
|
||
|
||
jobs: | ||
build-and-push: | ||
name: Build base image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USER }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: deepset/hayhooks | ||
|
||
- name: Build base images | ||
uses: docker/bake-action@v4 | ||
env: | ||
IMAGE_TAG_SUFFIX: ${{ steps.meta.outputs.version }} | ||
HAYSTACK_VERSION: ${{ steps.meta.outputs.version }} | ||
with: | ||
workdir: docker | ||
targets: hayhooks | ||
push: true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
ARG build_image | ||
ARG base_image | ||
|
||
FROM $build_image AS build-image | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
git | ||
|
||
ARG hayhooks_version | ||
|
||
# Shallow clone Hayhooks repo, we'll install from the local sources | ||
RUN git clone --depth=1 --branch=${hayhooks_version} https://github.com/deepset-ai/hayhooks.git /opt/hayhooks | ||
WORKDIR /opt/hayhooks | ||
|
||
# Use a virtualenv we can copy over the next build stage | ||
RUN python3 -m venv --system-site-packages /opt/venv | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
|
||
RUN pip install --upgrade pip && \ | ||
pip install --no-cache-dir . | ||
|
||
|
||
FROM $base_image AS final | ||
|
||
COPY --from=build-image /opt/venv /opt/venv | ||
|
||
EXPOSE 1416 | ||
|
||
ENV PATH="/opt/venv/bin:$PATH" | ||
|
||
CMD ["hayhooks", "run", "0.0.0.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
variable "HAYHOOKS_VERSION" { | ||
default = "main" | ||
} | ||
|
||
variable "GITHUB_REF" { | ||
default = "" | ||
} | ||
|
||
variable "IMAGE_NAME" { | ||
default = "deepset/hayhooks" | ||
} | ||
|
||
variable "IMAGE_TAG_SUFFIX" { | ||
default = "local" | ||
} | ||
|
||
variable "BASE_IMAGE_TAG_SUFFIX" { | ||
default = "local" | ||
} | ||
|
||
target "default" { | ||
dockerfile = "Dockerfile" | ||
tags = ["${IMAGE_NAME}:${IMAGE_TAG_SUFFIX}"] | ||
args = { | ||
build_image = "deepset/haystack:base-main" | ||
base_image = "deepset/haystack:base-main" | ||
hayhooks_version = "${HAYHOOKS_VERSION}" | ||
} | ||
platforms = ["linux/amd64", "linux/arm64"] | ||
} |