diff --git a/.tekton/odh-feature-server-pull-request.yaml b/.tekton/odh-feature-server-pull-request.yaml index b7a4d9dfb5d..280ec9d47cd 100644 --- a/.tekton/odh-feature-server-pull-request.yaml +++ b/.tekton/odh-feature-server-pull-request.yaml @@ -39,7 +39,7 @@ spec: - name: dockerfile value: Dockerfiles/Dockerfile.feature-server.konflux - name: path-context - value: "sdk/python/feast/infra/feature_servers/multicloud" + value: . - name: hermetic value: true - name: prefetch-input diff --git a/Dockerfiles/Dockerfile.feature-server.konflux b/Dockerfiles/Dockerfile.feature-server.konflux index 24ebc21db59..5e057927b8a 100644 --- a/Dockerfiles/Dockerfile.feature-server.konflux +++ b/Dockerfiles/Dockerfile.feature-server.konflux @@ -3,8 +3,6 @@ FROM registry.access.redhat.com/ubi9/python-312:1 AS builder USER 0 -COPY requirements.txt requirements.txt - # Power (ppc64le) only: Install a known stable pyarrow version # to avoid compatibility issues with the version from requirements. RUN if [ "$(uname -m)" = "ppc64le" ]; then \ @@ -14,7 +12,13 @@ RUN if [ "$(uname -m)" = "ppc64le" ]; then \ echo "Non-Power architecture detected; skipping Power-specific pyarrow installation."; \ fi -RUN pip install -r requirements.txt +# Install feast from local source (dependencies resolve from Cachi2 cache) +COPY sdk/python/feast/infra/feature_servers/multicloud/requirements.txt /tmp/feast-version.txt +COPY pyproject.toml README.md /src/ +COPY sdk/python /src/sdk/python +WORKDIR /src +RUN SETUPTOOLS_SCM_PRETEND_VERSION=$(awk -F'==' 'NR==2{gsub(/[[:space:]]/,"",$2); print $2}' /tmp/feast-version.txt) \ + pip install '.[minimal]' # Stage 2: Minimal runtime image (no compilers or dev headers) FROM registry.access.redhat.com/ubi9/python-312-minimal:1 @@ -24,27 +28,34 @@ USER 0 # Runtime shared libraries required by compiled Python extensions: # libicu - pyarrow (Arrow C++ depends on ICU) # libpq - psycopg[c] (PostgreSQL C adapter) -RUN microdnf install -y git libicu libpq python3.12-devel postgresql-devel gcc openblas-devel && microdnf clean all +RUN microdnf install -y git libicu libpq && microdnf clean all # Copy installed Python packages and entry-point scripts from builder COPY --from=builder /opt/app-root/lib /opt/app-root/lib COPY --from=builder /opt/app-root/lib64 /opt/app-root/lib64 COPY --from=builder /opt/app-root/bin /opt/app-root/bin ENV PATH="/opt/app-root/bin:${PATH}" \ - PYTHONPATH="/opt/app-root/lib64/python3.12/site-packages" \ - LD_LIBRARY_PATH=/opt/app-root/lib64/python3.12/site-packages/re2/lib + PYTHONPATH="/opt/app-root/lib64/python3.12/site-packages" -RUN echo "/opt/app-root/lib64/python3.12/site-packages/re2/lib" \ - > /etc/ld.so.conf.d/re2.conf && \ - ldconfig +# When building from source, setuptools does not include non-Python data files +# (static assets, UI build, templates, jinja2, sql) because there is no .git +# dir for setuptools-scm to list tracked files. Copy them from the source tree. +COPY --from=builder /src/sdk/python/feast/static /opt/app-root/lib64/python3.12/site-packages/feast/static +COPY --from=builder /src/sdk/python/feast/templates /opt/app-root/lib64/python3.12/site-packages/feast/templates +COPY --from=builder /src/sdk/python/feast/api/registry/rest/templates /opt/app-root/lib64/python3.12/site-packages/feast/api/registry/rest/templates +COPY --from=builder /src/sdk/python/feast/infra/utils/snowflake /opt/app-root/lib64/python3.12/site-packages/feast/infra/utils/snowflake -# modify permissions to support running with a random uid -RUN chmod g+w $(python -c "import feast.ui as ui; print(ui.__path__)" | tr -d "[']")/build/projects-list.json +# The PyPI wheel ships a pre-built React UI under feast/ui/build/; when +# building from source that directory does not exist. Create the minimal +# structure the runtime needs (projects-list.json is overwritten at startup). +RUN UI_DIR=$(python -c "import feast.ui as ui; print(ui.__path__)" | tr -d "[']") && \ + mkdir -p "${UI_DIR}/build" && \ + echo '{"projects":[]}' > "${UI_DIR}/build/projects-list.json" && \ + chmod g+w "${UI_DIR}/build/projects-list.json" # default user USER 1001 - LABEL com.redhat.component="odh-feature-server" \ name="odh-feature-server-rhel9" \ description="odh-feature-server" \