Commit ca48e8bc authored by Carlos Natalino's avatar Carlos Natalino
Browse files

Upgrade Forecaster from Python 3.9 to 3.13.

The image now builds on python:3.13-slim with common_requirements_py313.in and pip 26 tooling so grpcio, protobuf, and pytest match Context and Service. numpy, pandas, and scikit-learn are bumped to 3.13-capable releases, and the Deployment uses native gRPC probes.

Co-authored-by: default avatarCursor <cursoragent@cursor.com>
parent 8d38579b
Loading
Loading
Loading
Loading
+6 −6
Changes for manifests/forecasterservice.yaml: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -40,16 +40,16 @@ spec:
            - name: FORECAST_TO_HISTORY_RATIO
              value: "10"
          startupProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:10040"]
            grpc:
              port: 10040
            failureThreshold: 30
            periodSeconds: 1
          readinessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:10040"]
            grpc:
              port: 10040
          livenessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:10040"]
            grpc:
              port: 10040
          resources:
            requests:
              cpu: 250m
+6 −11
Changes for src/forecaster/Dockerfile: 6 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM python:3.9-slim
FROM python:3.13-slim

# Install dependencies
RUN apt-get --yes --quiet --quiet update && \
@@ -22,20 +22,15 @@ RUN apt-get --yes --quiet --quiet update && \
# Set Python to show logs as they occur
ENV PYTHONUNBUFFERED=0

# Download the gRPC health probe
RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \
    wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
    chmod +x /bin/grpc_health_probe

# Get generic Python packages
RUN python3 -m pip install --upgrade 'pip==25.2'
RUN python3 -m pip install --upgrade 'setuptools==79.0.0' 'wheel==0.45.1'
RUN python3 -m pip install --upgrade 'pip-tools==7.3.0'
RUN python3 -m pip install --upgrade 'pip==26.2.2'
RUN python3 -m pip install --upgrade 'setuptools==84.2.1' 'wheel==0.48.0'
RUN python3 -m pip install --upgrade 'pip-tools==7.6.2'

# Get common Python packages
# Note: this step enables sharing the previous Docker build steps among all the Python components
WORKDIR /var/teraflow
COPY common_requirements.in common_requirements.in
COPY common_requirements_py313.in common_requirements.in
RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in
RUN python3 -m pip install -r common_requirements.txt

@@ -57,7 +52,7 @@ RUN find . -type f -exec sed -i -E 's/^(import\ .*)_pb2/from . \1_pb2/g' {} \;
RUN mkdir -p /var/teraflow/forecaster
WORKDIR /var/teraflow/forecaster
COPY src/forecaster/requirements.in requirements.in
RUN pip-compile --quiet --output-file=requirements.txt requirements.in
RUN pip-compile --quiet --output-file=requirements.txt requirements.in /var/teraflow/common_requirements.in
RUN python3 -m pip install -r requirements.txt

# Add component files into working directory
+3 −3
Changes for src/forecaster/requirements.in: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

numpy<2.0.0
pandas==1.5.*
numpy==2.3.*
pandas==2.3.*
#prophet==1.1.*
scikit-learn==1.1.*
scikit-learn==1.7.*