Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Bad feature_servers/multicloud Dockerfile #4138

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ build-feast-operator-docker:
build-feature-server-dev:
docker buildx build --build-arg VERSION=dev \
-t feastdev/feature-server:dev \
-f sdk/python/feast/infra/feature_servers/multicloud/Dockerfile.dev --load .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this used at all for deploying any images? Do you want to ask achal or any of the old maintainers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only difference in the previous Dockerfile vs Dockerfile.dev was the COPY . . instruction.

The old Dockerfile installs only the pypi available feast package, whereas the old Dockerfile.dev installs the pypi + copies the current codebase into the image.

With the changes I made to the Dockerfile, it does not rely on pypi for the feast package and we would only use the current codebase to install feast. Essentially the same as what old Dockerfile.dev was doing.

-f sdk/python/feast/infra/feature_servers/multicloud/Dockerfile --load .

build-java-docker-dev:
make build-java-no-tests REVISION=dev
Expand Down
49 changes: 35 additions & 14 deletions sdk/python/feast/infra/feature_servers/multicloud/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,40 @@
FROM python:3.11
FROM python:3.11 AS builder

RUN apt update && \
apt install -y \
jq \
python3-dev \
build-essential
RUN apt-get update && apt-get install -y git

RUN pip install pip --upgrade
RUN pip install "feast[aws,gcp,snowflake,redis,go,mysql,postgres]"
# Allow statements and log messages to immediately appear in the Knative logs
ENV PYTHONUNBUFFERED True

# Copy local code to the container image.
ENV APP_HOME /app
WORKDIR $APP_HOME

# Copy necessary parts of the Feast codebase
COPY . .

# Install production dependencies into the virtual environment
RUN python -m venv .venv && . .venv/bin/activate && pip install '.[aws,gcp,snowflake,redis,go,mysql,postgres]'

FROM python:3.11-slim AS runner

# Allow statements and log messages to immediately appear in the Knative logs
ENV PYTHONUNBUFFERED True

# Copy local code to the container image.
ENV APP_HOME /app
WORKDIR $APP_HOME

# Copy the virtual environment with the production dependencies from the builder stage
COPY --from=builder $APP_HOME/.venv $APP_HOME/.venv
ENV PATH="$APP_HOME/.venv/bin:${PATH}"

# Add runtime dependencies such as libarrow
RUN apt-get update && \
apt-get install -y git cmake ca-certificates lsb-release wget && \
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb &&\
apt-get install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb &&\
apt-get update &&\
apt-get install -y libarrow-dev &&\
apt-get clean

RUN apt update
RUN apt install -y -V ca-certificates lsb-release wget
RUN wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
RUN apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
RUN apt update
RUN apt -y install libarrow-dev
RUN mkdir -m 775 /.cache

This file was deleted.

Loading