mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-09-26 00:24:14 +00:00
fix: do not override bake's platform definitions (#4518)
* do not override bake's platform definitions * test * fix job name and remove override from minor version job * test * bump docker login action * fix plurals * Remove platform from matrix and test both platform in a single job * Remove branch trigger used for testing --------- Co-authored-by: Silvano Cerza <silvanocerza@gmail.com>
This commit is contained in:
parent
651be37afc
commit
0dfa5d6ad7
20
.github/workflows/docker_release.yml
vendored
20
.github/workflows/docker_release.yml
vendored
@ -13,16 +13,13 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
name: Build ${{ matrix.target }} image for ${{ matrix.platform }}
|
name: Build ${{ matrix.target }} images
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
target:
|
target:
|
||||||
- "cpu"
|
- "cpu"
|
||||||
- "gpu"
|
- "gpu"
|
||||||
platform:
|
|
||||||
- "linux/amd64"
|
|
||||||
- "linux/arm64"
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -35,7 +32,7 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
@ -46,7 +43,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
images: $DOCKER_REPO_NAME
|
images: $DOCKER_REPO_NAME
|
||||||
|
|
||||||
- name: Build base image
|
- name: Build base images
|
||||||
uses: docker/bake-action@v2
|
uses: docker/bake-action@v2
|
||||||
env:
|
env:
|
||||||
IMAGE_TAG_SUFFIX: ${{ steps.meta.outputs.version }}
|
IMAGE_TAG_SUFFIX: ${{ steps.meta.outputs.version }}
|
||||||
@ -60,14 +57,19 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
EXPECTED_VERSION=$(cat VERSION.txt)
|
EXPECTED_VERSION=$(cat VERSION.txt)
|
||||||
TAG="base-${{ matrix.target }}-${{ steps.meta.outputs.version }}"
|
TAG="base-${{ matrix.target }}-${{ steps.meta.outputs.version }}"
|
||||||
PLATFORM="${{ matrix.platform }}"
|
|
||||||
|
|
||||||
|
PLATFORM="linux/amd64"
|
||||||
VERSION=$(docker run --platform "$PLATFORM" --rm "deepset/haystack:$TAG" python -c"import haystack; print(haystack.__version__)")
|
VERSION=$(docker run --platform "$PLATFORM" --rm "deepset/haystack:$TAG" python -c"import haystack; print(haystack.__version__)")
|
||||||
[[ "$VERSION" = "$EXPECTED_VERSION" ]] || echo "::error 'Haystack version in deepset/haystack:$TAG image for $PLATFORM is different from expected'"
|
[[ "$VERSION" = "$EXPECTED_VERSION" ]] || echo "::error 'Haystack version in deepset/haystack:$TAG image for $PLATFORM is different from expected'"
|
||||||
|
|
||||||
|
PLATFORM="linux/arm64"
|
||||||
|
VERSION=$(docker run --platform "$PLATFORM" --rm "deepset/haystack:$TAG" python -c"import haystack; print(haystack.__version__)")
|
||||||
|
[[ "$VERSION" = "$EXPECTED_VERSION" ]] || echo "::error 'Haystack version in deepset/haystack:$TAG image for $PLATFORM is different from expected'"
|
||||||
|
|
||||||
# Remove image after test to avoid filling the GitHub runner and prevent its failure
|
# Remove image after test to avoid filling the GitHub runner and prevent its failure
|
||||||
docker rmi "deepset/haystack:$TAG"
|
docker rmi "deepset/haystack:$TAG"
|
||||||
|
|
||||||
- name: Build api image
|
- name: Build api images
|
||||||
uses: docker/bake-action@v2
|
uses: docker/bake-action@v2
|
||||||
env:
|
env:
|
||||||
IMAGE_TAG_SUFFIX: ${{ steps.meta.outputs.version }}
|
IMAGE_TAG_SUFFIX: ${{ steps.meta.outputs.version }}
|
||||||
@ -76,7 +78,6 @@ jobs:
|
|||||||
workdir: docker
|
workdir: docker
|
||||||
targets: ${{ matrix.target }}
|
targets: ${{ matrix.target }}
|
||||||
push: true
|
push: true
|
||||||
set: "*.platform=${{ matrix.platform }}"
|
|
||||||
|
|
||||||
- name: Get latest version of Haystack
|
- name: Get latest version of Haystack
|
||||||
id: latest-version
|
id: latest-version
|
||||||
@ -111,4 +112,3 @@ jobs:
|
|||||||
workdir: docker
|
workdir: docker
|
||||||
targets: ${{ matrix.target }}-latest
|
targets: ${{ matrix.target }}-latest
|
||||||
push: true
|
push: true
|
||||||
set: "*.platform=${{ matrix.platform }}"
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user