From 915ce9b225ec621e03b5b07e2bb3f0f15a1cbe73 Mon Sep 17 00:00:00 2001 From: Depo-dev Date: Fri, 3 Jul 2026 17:43:36 +0100 Subject: [PATCH 1/2] chore(infra): pin Rust base image, add missing Helm probes, drop obsolete compose version keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - crates/{api,indexer}/Dockerfile: pin FROM rust:1-slim -> rust:1.83-slim for reproducible builds (edition 2021, all locked deps build on 1.83). - helm: add liveness/readiness probes to the grpc-api (tcpSocket 5000), nginx (tcpSocket 80), and indexer (httpGet /metrics on the Prometheus port 9090, now exposed) deployments — only go-api had probes before. - docker/docker-compose{,.dev}.yml: remove the obsolete top-level version: key (Compose v2 ignores it and warns; dev's was malformed). --- crates/api/Dockerfile | 2 +- crates/indexer/Dockerfile | 2 +- docker/docker-compose.dev.yml | 3 -- docker/docker-compose.yml | 2 - .../templates/grpc-api-deployment.yaml | 4 ++ .../trident/templates/indexer-deployment.yaml | 8 ++++ helm/trident/templates/nginx-deployment.yaml | 4 ++ helm/trident/values.yaml | 47 +++++++++++++++++++ 8 files changed, 65 insertions(+), 7 deletions(-) diff --git a/crates/api/Dockerfile b/crates/api/Dockerfile index db98fb4..635c74a 100644 --- a/crates/api/Dockerfile +++ b/crates/api/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 # ── builder ────────────────────────────────────────────────────────────────── -FROM rust:1-slim AS builder +FROM rust:1.83-slim AS builder WORKDIR /app diff --git a/crates/indexer/Dockerfile b/crates/indexer/Dockerfile index 69b995e..a720d60 100644 --- a/crates/indexer/Dockerfile +++ b/crates/indexer/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 # ── builder ────────────────────────────────────────────────────────────────── -FROM rust:1-slim AS builder +FROM rust:1.83-slim AS builder WORKDIR /app diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 5873f37..9072100 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -1,6 +1,3 @@ -version: \ -3.9\ - # Development compose — runs only the infrastructure dependencies. # The indexer and API service are run locally (cargo run / go run) so that # code changes reflect immediately without rebuilding containers. diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index c46f6ed..58a317f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3.9" - # Production compose — runs all four services. # All secrets are passed via environment variables; never hardcode values here. diff --git a/helm/trident/templates/grpc-api-deployment.yaml b/helm/trident/templates/grpc-api-deployment.yaml index c375372..44636e3 100644 --- a/helm/trident/templates/grpc-api-deployment.yaml +++ b/helm/trident/templates/grpc-api-deployment.yaml @@ -35,6 +35,10 @@ spec: secretKeyRef: name: {{ .Values.global.existingSecret }} key: REDIS_URL + livenessProbe: + {{- toYaml .Values.grpcApi.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.grpcApi.readinessProbe | nindent 12 }} resources: {{- toYaml .Values.grpcApi.resources | nindent 12 }} {{- with .Values.grpcApi.nodeSelector }} diff --git a/helm/trident/templates/indexer-deployment.yaml b/helm/trident/templates/indexer-deployment.yaml index 5553d0d..89a15df 100644 --- a/helm/trident/templates/indexer-deployment.yaml +++ b/helm/trident/templates/indexer-deployment.yaml @@ -21,6 +21,10 @@ spec: - name: indexer image: "{{ .Values.indexer.image.repository }}:{{ .Values.indexer.image.tag }}" imagePullPolicy: {{ .Values.global.imagePullPolicy }} + ports: + - name: metrics + containerPort: {{ .Values.indexer.metricsPort }} + protocol: TCP env: - name: DATABASE_URL valueFrom: @@ -36,6 +40,10 @@ spec: - name: {{ $k }} value: {{ $v | quote }} {{- end }} + livenessProbe: + {{- toYaml .Values.indexer.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.indexer.readinessProbe | nindent 12 }} resources: {{- toYaml .Values.indexer.resources | nindent 12 }} {{- with .Values.indexer.nodeSelector }} diff --git a/helm/trident/templates/nginx-deployment.yaml b/helm/trident/templates/nginx-deployment.yaml index f098d7a..797aa96 100644 --- a/helm/trident/templates/nginx-deployment.yaml +++ b/helm/trident/templates/nginx-deployment.yaml @@ -58,6 +58,10 @@ spec: - name: nginx-config mountPath: /etc/nginx/nginx.conf subPath: nginx.conf + livenessProbe: + {{- toYaml .Values.nginx.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.nginx.readinessProbe | nindent 12 }} resources: {{- toYaml .Values.nginx.resources | nindent 12 }} volumes: diff --git a/helm/trident/values.yaml b/helm/trident/values.yaml index 2d82e4f..7775ea8 100644 --- a/helm/trident/values.yaml +++ b/helm/trident/values.yaml @@ -29,6 +29,25 @@ indexer: env: # GRPC_ADDR of the Rust gRPC service (in-cluster DNS) GRPC_ADDR: "trident-grpc-api:5000" + # Prometheus metrics server (METRICS_PORT, default 9090) doubles as the + # liveness/readiness signal for this otherwise portless worker. + metricsPort: 9090 + livenessProbe: + httpGet: + path: /metrics + port: 9090 + initialDelaySeconds: 15 + periodSeconds: 20 + failureThreshold: 3 + timeoutSeconds: 2 + readinessProbe: + httpGet: + path: /metrics + port: 9090 + initialDelaySeconds: 10 + periodSeconds: 10 + failureThreshold: 3 + timeoutSeconds: 2 nodeSelector: {} tolerations: [] affinity: {} @@ -43,6 +62,20 @@ grpcApi: replicaCount: 1 service: port: 5000 + livenessProbe: + tcpSocket: + port: 5000 + initialDelaySeconds: 10 + periodSeconds: 10 + failureThreshold: 3 + timeoutSeconds: 2 + readinessProbe: + tcpSocket: + port: 5000 + initialDelaySeconds: 5 + periodSeconds: 5 + failureThreshold: 3 + timeoutSeconds: 2 resources: requests: cpu: "250m" @@ -112,6 +145,20 @@ nginx: service: type: LoadBalancer port: 80 + livenessProbe: + tcpSocket: + port: 80 + initialDelaySeconds: 5 + periodSeconds: 10 + failureThreshold: 3 + timeoutSeconds: 2 + readinessProbe: + tcpSocket: + port: 80 + initialDelaySeconds: 5 + periodSeconds: 10 + failureThreshold: 3 + timeoutSeconds: 2 resources: requests: cpu: "50m" From 6b6314f64f4647e30c8c8d3a1c02885e2a2fbfe5 Mon Sep 17 00:00:00 2001 From: Depo-dev Date: Fri, 3 Jul 2026 17:49:30 +0100 Subject: [PATCH 2/2] chore(docker): bump pinned Rust base to 1.88-slim 1.83 was too old to parse the edition-2024 manifest of the idna_adapter dependency (needs rustc >= 1.85); 1.88 matches the recent stable the floating rust:1 tag was resolving to. --- crates/api/Dockerfile | 2 +- crates/indexer/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/api/Dockerfile b/crates/api/Dockerfile index 635c74a..c711ad6 100644 --- a/crates/api/Dockerfile +++ b/crates/api/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 # ── builder ────────────────────────────────────────────────────────────────── -FROM rust:1.83-slim AS builder +FROM rust:1.88-slim AS builder WORKDIR /app diff --git a/crates/indexer/Dockerfile b/crates/indexer/Dockerfile index a720d60..90a0fcc 100644 --- a/crates/indexer/Dockerfile +++ b/crates/indexer/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 # ── builder ────────────────────────────────────────────────────────────────── -FROM rust:1.83-slim AS builder +FROM rust:1.88-slim AS builder WORKDIR /app