feat: rewrite pipeline-bridge in Go

Replace Python implementation with Go for smaller container images.
Uses handler-base Go module for NATS, health, and telemetry.

- main.go: pipeline bridge with Argo/Kubeflow HTTP submission
- main_test.go: 8 tests covering helpers and HTTP submit functions
- Dockerfile: multi-stage golang:1.25-alpine → scratch
- CI: Gitea Actions with lint/test/release/docker/notify
This commit is contained in:
2026-02-19 17:52:31 -05:00
parent da6e96b9f6
commit aeb1b749be
14 changed files with 769 additions and 3433 deletions

View File

@@ -1,13 +1,31 @@
# Pipeline Bridge - Using handler-base
ARG BASE_TAG=latest
FROM ghcr.io/billy-davies-2/handler-base:${BASE_TAG}
# Build stage
FROM golang:1.25-alpine AS builder
WORKDIR /app
# Install additional dependencies from pyproject.toml
COPY pyproject.toml .
RUN uv pip install --system --no-cache httpx kubernetes
# Install ca-certificates for HTTPS
RUN apk add --no-cache ca-certificates
COPY pipeline_bridge.py .
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
CMD ["python", "pipeline_bridge.py"]
# Copy source code
COPY . .
# Build static binary
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /pipeline-bridge .
# Runtime stage - scratch for minimal image
FROM scratch
# Copy CA certificates for HTTPS
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
# Copy binary
COPY --from=builder /pipeline-bridge /pipeline-bridge
# Run as non-root
USER 65534:65534
ENTRYPOINT ["/pipeline-bridge"]