diff --git a/libs/infinity_emb/Dockerfile.amd_auto b/libs/infinity_emb/Dockerfile.amd_auto index 072c55aa..f5e91c54 100644 --- a/libs/infinity_emb/Dockerfile.amd_auto +++ b/libs/infinity_emb/Dockerfile.amd_auto @@ -27,7 +27,7 @@ ENV INFINITY_BETTERTRANSFORMER="0" WORKDIR /app -FROM base as builder +FROM base AS builder # Set the working directory for the app # Define the version of Poetry to install (default is 1.8.4) # Define the directory to install Poetry to (default is /opt/poetry) @@ -89,7 +89,7 @@ fi # TODO: remove this line RUN apt-get install --no-install-recommends -y git && poetry run python -m pip install git+https://github.com/huggingface/transformers.git@42865860ec6dc135972d9555753cb7ee17f51fb4 && rm -rf ~/.cache/ /tmp/* -FROM builder as testing +FROM builder AS testing # install lint and test dependencies # "RUN poetry install --no-interaction --no-ansi --extras \"${EXTRAS}\" --with lint,test && poetry cache clear pypi --all" COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh diff --git a/libs/infinity_emb/Dockerfile.cpu_auto b/libs/infinity_emb/Dockerfile.cpu_auto index c5f3134a..cdcb561f 100644 --- a/libs/infinity_emb/Dockerfile.cpu_auto +++ b/libs/infinity_emb/Dockerfile.cpu_auto @@ -25,7 +25,7 @@ ENV INFINITY_ENGINE="optimum" WORKDIR /app -FROM base as builder +FROM base AS builder # Set the working directory for the app # Define the version of Poetry to install (default is 1.8.4) # Define the directory to install Poetry to (default is /opt/poetry) @@ -56,7 +56,7 @@ RUN poetry run $PYTHON -m pip install --no-cache-dir onnxruntime-openvino # TODO: remove this line RUN apt-get install --no-install-recommends -y git && poetry run python -m pip install git+https://github.com/huggingface/transformers.git@42865860ec6dc135972d9555753cb7ee17f51fb4 && rm -rf ~/.cache/ /tmp/* -FROM builder as testing +FROM builder AS testing # install lint and test dependencies # "RUN poetry install --no-interaction --no-ansi --extras \"${EXTRAS}\" --with lint,test && poetry cache clear pypi --all" COPY requirements_install_from_poetry.sh requirements_install_from_poetry.sh diff --git a/libs/infinity_emb/Dockerfile.jinja2 b/libs/infinity_emb/Dockerfile.jinja2 index be4282e0..c5065120 100644 --- a/libs/infinity_emb/Dockerfile.jinja2 +++ b/libs/infinity_emb/Dockerfile.jinja2 @@ -23,7 +23,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y build-essential {{extra_env_variables | default('')}} WORKDIR /app -FROM base as builder +FROM base AS builder # Set the working directory for the app # Define the version of Poetry to install (default is 1.8.4) # Define the directory to install Poetry to (default is /opt/poetry) @@ -46,7 +46,7 @@ COPY infinity_emb infinity_emb # TODO: remove this line RUN apt-get install --no-install-recommends -y git && poetry run python -m pip install git+https://github.com/huggingface/transformers.git@42865860ec6dc135972d9555753cb7ee17f51fb4 && rm -rf ~/.cache/ /tmp/* -FROM builder as testing +FROM builder AS testing # install lint and test dependencies {{main_install|replace("--without", "--with")|replace("--no-root","")}} # lint diff --git a/libs/infinity_emb/Dockerfile.nvidia_auto b/libs/infinity_emb/Dockerfile.nvidia_auto index 315c8376..18653388 100644 --- a/libs/infinity_emb/Dockerfile.nvidia_auto +++ b/libs/infinity_emb/Dockerfile.nvidia_auto @@ -23,7 +23,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y build-essential WORKDIR /app -FROM base as builder +FROM base AS builder # Set the working directory for the app # Define the version of Poetry to install (default is 1.8.4) # Define the directory to install Poetry to (default is /opt/poetry) @@ -46,7 +46,7 @@ RUN poetry install --no-interaction --no-ansi --extras "${EXTRAS}" --without li # TODO: remove this line RUN apt-get install --no-install-recommends -y git && poetry run python -m pip install git+https://github.com/huggingface/transformers.git@42865860ec6dc135972d9555753cb7ee17f51fb4 && rm -rf ~/.cache/ /tmp/* -FROM builder as testing +FROM builder AS testing # install lint and test dependencies RUN poetry install --no-interaction --no-ansi --extras "${EXTRAS}" --with lint,test && poetry cache clear pypi --all # lint diff --git a/libs/infinity_emb/Dockerfile.trt_onnx_auto b/libs/infinity_emb/Dockerfile.trt_onnx_auto index 6edb94e0..58c301bf 100644 --- a/libs/infinity_emb/Dockerfile.trt_onnx_auto +++ b/libs/infinity_emb/Dockerfile.trt_onnx_auto @@ -26,7 +26,7 @@ ENV PATH=/app/.venv/lib/${PYTHON}/site-packages/tensorrt/bin:${PATH} WORKDIR /app -FROM base as builder +FROM base AS builder # Set the working directory for the app # Define the version of Poetry to install (default is 1.8.4) # Define the directory to install Poetry to (default is /opt/poetry) @@ -53,7 +53,7 @@ RUN poetry run $PYTHON -m pip install --no-cache-dir "tensorrt==10.3.0" "tensorr # TODO: remove this line RUN apt-get install --no-install-recommends -y git && poetry run python -m pip install git+https://github.com/huggingface/transformers.git@42865860ec6dc135972d9555753cb7ee17f51fb4 && rm -rf ~/.cache/ /tmp/* -FROM builder as testing +FROM builder AS testing # install lint and test dependencies RUN poetry install --no-interaction --no-ansi --extras "${EXTRAS}" --with lint,test && poetry cache clear pypi --all # lint diff --git a/libs/infinity_emb/Makefile b/libs/infinity_emb/Makefile index 89023ae8..30ad4e08 100644 --- a/libs/infinity_emb/Makefile +++ b/libs/infinity_emb/Makefile @@ -49,21 +49,19 @@ template_docker: # Add new targets build-amd: - docker buildx build -t michaelf34/infinity:$(VERSION)-amd -f Dockerfile.amd_auto --push . + docker buildx build --platform linux/amd64 -t michaelf34/infinity:$(VERSION)-amd -f Dockerfile.amd_auto --push . build-trt: - docker buildx build -t michaelf34/infinity:$(VERSION)-trt-onnx -f Dockerfile.trt_onnx_auto --push . + docker buildx build --platform linux/amd64 -t michaelf34/infinity:$(VERSION)-trt-onnx -f Dockerfile.trt_onnx_auto --push . build-cpu: - docker buildx build -t michaelf34/infinity:$(VERSION)-cpu -f Dockerfile.cpu_auto --push . + docker buildx build --platform linux/amd64 -t michaelf34/infinity:$(VERSION)-cpu -f Dockerfile.cpu_auto --push . build-nvidia: - docker buildx build -t michaelf34/infinity:$(VERSION) -f Dockerfile.nvidia_auto --push . + docker buildx build --platform linux/amd64 -t michaelf34/infinity:$(VERSION) -f Dockerfile.nvidia_auto --push . # Combined target to build both -build-all-docker: - docker buildx build -t michaelf34/infinity:$(VERSION)-amd -f Dockerfile.amd_auto --push . & \ - docker buildx build -t michaelf34/infinity:$(VERSION)-trt-onnx -f Dockerfile.trt_onnx_auto --push . +build-all-docker: build-nvidia build-cpu build-amd build-trt poetry_check: poetry check