Commit 06eb46c6 authored by Carlos Natalino's avatar Carlos Natalino
Browse files

Improving probes for Kubernetes

parent 52fd4894
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -52,12 +52,17 @@ spec:
                name: crdb-data
            - secretRef:
                name: nats-data
          startupProbe:
            grpc:
              port: 1010
            failureThreshold: 30
            periodSeconds: 1
          readinessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:1010"]
            grpc:
              port: 1010
          livenessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:1010"]
            grpc:
              port: 1010
          resources:
            requests:
              cpu: 250m
+9 −4
Original line number Diff line number Diff line
@@ -37,12 +37,17 @@ spec:
          env:
            - name: LOG_LEVEL
              value: "INFO"
          startupProbe:
            grpc:
              port: 3030
            failureThreshold: 30
            periodSeconds: 1
          readinessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:3030"]
            grpc:
              port: 3030
          livenessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:3030"]
            grpc:
              port: 3030
          resources:
            requests:
              cpu: 250m
+5 −5
Original line number Diff line number Diff line
@@ -23,9 +23,9 @@ RUN apt-get --yes --quiet --quiet update && \
ENV PYTHONUNBUFFERED=0

# Download the gRPC health probe
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.40 && \
    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
# RUN GRPC_HEALTH_PROBE_VERSION=v0.4.40 && \
#     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
@@ -35,7 +35,7 @@ RUN python3 -m pip install --upgrade pip-tools
# 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 +57,7 @@ RUN find . -type f -exec sed -i -E 's/^(import\ .*)_pb2/from . \1_pb2/g' {} \;
RUN mkdir -p /var/teraflow/context
WORKDIR /var/teraflow/context
COPY src/context/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
Original line number Diff line number Diff line
@@ -14,6 +14,6 @@

nats-py==2.10.*
psycopg2-binary==2.9.*
SQLAlchemy==2.0.*
sqlalchemy-cockroachdb==2.0.*
SQLAlchemy-Utils==0.42.*
SQLAlchemy==1.4.*  # TODO: Update to 2.0 due to deprecated build step
sqlalchemy-cockroachdb==1.4.*  # TODO: Update to 2.0 due to deprecated build step
SQLAlchemy-Utils==0.41.*
+5 −5
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 && \
@@ -23,9 +23,9 @@ RUN apt-get --yes --quiet --quiet update && \
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
# RUN GRPC_HEALTH_PROBE_VERSION=v0.4.40 && \
#     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
@@ -57,7 +57,7 @@ RUN find . -type f -exec sed -i -E 's/^(import\ .*)_pb2/from . \1_pb2/g' {} \;
RUN mkdir -p /var/teraflow/service
WORKDIR /var/teraflow/service
COPY src/service/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