Skip to content

Commit

Permalink
building feast-dev locally into docker image
Browse files Browse the repository at this point in the history
Signed-off-by: Chester Ong <[email protected]>
  • Loading branch information
bushwhackr committed Apr 23, 2024
1 parent 9537946 commit 9f397fe
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 38 deletions.
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,6 @@ build-feature-server-java-docker:

# Dev images

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 .

build-java-docker-dev:
make build-java-no-tests REVISION=dev
docker buildx build --build-arg VERSION=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.9
FROM python:3.9-slim 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.9-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
19 changes: 0 additions & 19 deletions sdk/python/feast/infra/feature_servers/multicloud/Dockerfile.dev

This file was deleted.

0 comments on commit 9f397fe

Please sign in to comment.