Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
cache-dependency-path: web/package-lock.json

- name: Install Python package
run: python -m pip install -e .
run: python -m pip install -e ".[dev]"

- name: Run Python contracts
run: make test
Expand All @@ -56,7 +56,7 @@ jobs:
run: make web-typecheck web-build

- name: Run native Go tests
run: make native-go-test native-vuln-scan-test native-ci-contract-test
run: make native-go-test native-vuln-scan-test native-ci-contract-test native-live-supply-chain-test

- name: Run Rust gateway tests
run: make native-rust-test
Expand All @@ -83,7 +83,7 @@ jobs:
run: make native-incident-workflow-sample

- name: Validate CI contract
run: make native-ci-contract-sample
run: make native-ci-contract-live

- name: Refresh evaluation index
run: make evaluation-index-sample
Expand Down Expand Up @@ -124,6 +124,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Normalize image prefix
run: |
LOWER_REPOSITORY="$(printf '%s' "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')"
echo "IMAGE_PREFIX=${REGISTRY}/${LOWER_REPOSITORY}" >> "${GITHUB_ENV}"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -145,8 +150,8 @@ jobs:
${{ env.IMAGE_PREFIX }}/tryops-${{ matrix.image.role }}:ci
load: ${{ github.event_name == 'pull_request' }}
push: ${{ github.event_name != 'pull_request' }}
sbom: true
provenance: true
sbom: ${{ github.event_name != 'pull_request' }}
provenance: ${{ github.event_name != 'pull_request' }}

- name: Prepare image evidence directories
run: mkdir -p artifacts/eval/ci/sbom artifacts/eval/ci/trivy artifacts/eval/ci/signatures
Expand All @@ -159,12 +164,13 @@ jobs:
output-file: artifacts/eval/ci/sbom/${{ matrix.image.role }}.spdx.json

- name: Run Trivy image scan
uses: aquasecurity/trivy-action@0.29.0
uses: aquasecurity/trivy-action@v0.36.0
with:
image-ref: ${{ env.IMAGE_PREFIX }}/tryops-${{ matrix.image.role }}:${{ github.sha }}
scanners: vuln,secret,misconfig
vuln-type: os,library
severity: HIGH,CRITICAL
limit-severities-for-sarif: true
ignore-unfixed: true
format: sarif
output: artifacts/eval/ci/trivy/${{ matrix.image.role }}.sarif
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile.api
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ COPY configs ./configs
RUN pip install --no-cache-dir fastapi uvicorn prometheus-client
ENV PYTHONPATH=/app/src
EXPOSE 8080
RUN addgroup --system tryops && adduser --system --ingroup tryops --home /nonexistent --no-create-home tryops
USER tryops
CMD ["uvicorn", "tryops.api:create_app", "--factory", "--host", "0.0.0.0", "--port", "8080"]
6 changes: 5 additions & 1 deletion Dockerfile.benchmark
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22-alpine AS go-build
FROM golang:1.26.4-alpine AS go-build

WORKDIR /src
COPY native/go/tryops-benchmark/go.mod ./
Expand All @@ -22,5 +22,9 @@ COPY --from=go-build /out/tryops_benchmark /usr/local/bin/tryops_benchmark
COPY --from=gateway-build /build/target/release/tryops-gateway /usr/local/bin/tryops-gateway
RUN pip install --no-cache-dir fastapi uvicorn prometheus-client
ENV PYTHONPATH=/app/src
RUN addgroup --system tryops && adduser --system --ingroup tryops --home /nonexistent --no-create-home tryops \
&& mkdir -p /tmp/tryops-benchmark-output \
&& chown -R tryops:tryops /tmp/tryops-benchmark-output
USER tryops
ENTRYPOINT ["tryops_benchmark"]
CMD ["--gateway-bin", "/usr/local/bin/tryops-gateway", "--python-bin", "python", "--output", "/tmp/tryops-benchmark-output/native_gateway_benchmark.json"]
2 changes: 1 addition & 1 deletion Dockerfile.controller
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22-alpine AS build
FROM golang:1.26.4-alpine AS build

WORKDIR /src
COPY native/go/tryops-controller/go.mod ./
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile.cpp-tools
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ FROM debian:bookworm-slim

RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates libstdc++6 \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& groupadd --system tryops \
&& useradd --system --gid tryops --home-dir /nonexistent --no-create-home --shell /usr/sbin/nologin tryops
COPY --from=build /out/tryops_* /usr/local/bin/
USER tryops
ENTRYPOINT ["/bin/sh", "-lc"]
CMD ["ls -1 /usr/local/bin/tryops_*"]
5 changes: 4 additions & 1 deletion Dockerfile.gateway
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ FROM debian:bookworm-slim

RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& groupadd --system tryops \
&& useradd --system --gid tryops --home-dir /nonexistent --no-create-home --shell /usr/sbin/nologin tryops

COPY --from=builder /build/target/release/tryops-gateway /usr/local/bin/tryops-gateway
COPY --from=web-builder /web/dist /opt/tryops/web
COPY configs/api_keys.json /opt/tryops/configs/api_keys.json
ENV TRYOPS_GATEWAY_STATIC_DIR=/opt/tryops/web
ENV TRYOPS_GATEWAY_API_KEYS_PATH=/opt/tryops/configs/api_keys.json
EXPOSE 8081
USER tryops

CMD ["tryops-gateway"]
3 changes: 2 additions & 1 deletion Dockerfile.guardrail
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22-alpine AS build
FROM golang:1.26.4-alpine AS build

WORKDIR /src
COPY native/go/tryops-guardrail/go.mod ./
Expand All @@ -9,4 +9,5 @@ FROM scratch

COPY --from=build /out/tryops_guardrail /tryops_guardrail
EXPOSE 18083
USER 65532:65532
ENTRYPOINT ["/tryops_guardrail", "serve"]
1 change: 1 addition & 0 deletions Dockerfile.mlflow
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
FROM ghcr.io/mlflow/mlflow:v2.14.3

RUN pip install --no-cache-dir boto3 psycopg2-binary
USER 1000
9 changes: 6 additions & 3 deletions Dockerfile.web-assets
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ COPY web/index.html web/tsconfig.json web/tsconfig.node.json web/vite.config.ts
COPY web/src ./src
RUN npm run build

FROM nginx:alpine
FROM nginxinc/nginx-unprivileged:alpine

USER root
RUN apk upgrade --no-cache libcrypto3 libssl3
COPY --from=build /web/dist /usr/share/nginx/html
EXPOSE 80
HEALTHCHECK --interval=10s --timeout=3s --retries=5 CMD wget -qO- http://127.0.0.1/ >/dev/null || exit 1
EXPOSE 8080
USER nginx
HEALTHCHECK --interval=10s --timeout=3s --retries=5 CMD wget -qO- http://127.0.0.1:8080/ >/dev/null || exit 1
Loading
Loading