Skip to content

Commit

Permalink
update docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfeil committed Jan 3, 2025
1 parent 85c3158 commit 27cacc4
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 17 deletions.
4 changes: 2 additions & 2 deletions libs/infinity_emb/Dockerfile.amd_auto
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions libs/infinity_emb/Dockerfile.cpu_auto
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions libs/infinity_emb/Dockerfile.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions libs/infinity_emb/Dockerfile.nvidia_auto
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions libs/infinity_emb/Dockerfile.trt_onnx_auto
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
12 changes: 5 additions & 7 deletions libs/infinity_emb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27cacc4

Please sign in to comment.