Skip to content

[WIP] ci: PoC migrate to self-managed CI - #5104

Draft
maxknv wants to merge 9 commits into
mainfrom
praktika-rust-lint-pilot
Draft

maxknv wants to merge 9 commits into
mainfrom
praktika-rust-lint-pilot

Conversation

@maxknv

@maxknv maxknv commented Nov 20, 2026

Copy link
Copy Markdown

What

First real job in the GitHub Actions → Praktika migration (see PRAKTIKA_MIGRATION_ASSESSMENT.md). Ports .github/workflows/rust-lint.yml to Praktika as the pilot, running alongside the existing smoke test.

Job (ci/workflows/pull_request.py): on the arm-small runner pool —

  • pre_hook: buf generate protos (the generated bindings are gitignored, so they're produced per-run)
  • command: cd nexus && cargo clippy -- -D warnings

Image changes

Per the "bake everything into the image" approach, the runner AMI now carries the toolchain via a new build-phase Image Builder component (ci/infrastructure/projects.py), so jobs don't reinstall it each run:

  • pkg-config + libssl-dev — nexus's C/OpenSSL build deps (mirrors stacks/peerdb-server.Dockerfile)
  • protoc 23.4 — matches scripts/install-protobuf.sh
  • buf (latest release) — matches bufbuild/buf-action
  • Rust 1.99.1 + clippy — matches the prod build pin; the real toolchain binaries (not the rustup shims) are symlinked onto PATH, so jobs need no RUSTUP_HOME/CARGO_HOME

Image recipe bumped 1.0.0 → 1.1.0, and the image-test phase now asserts protoc/buf/cargo/cargo clippy are present and runnable. Infra already deployed.

Notes

  • No run_in_docker — PeerDB uses Tilt (which itself drives docker-compose), so jobs run directly on the runner.
  • buf generate uses buf.build remote plugins (no local protoc plugins needed); if anonymous access hits rate limits we'll wire in the GH token like genprotos does.
  • Secrets (*.secret) and the deploy-generated *_api_gateway.txt are intentionally not committed.

🤖 Generated with Claude Code

First real job in the GitHub Actions -> Praktika migration (see
PRAKTIKA_MIGRATION_ASSESSMENT.md). Ports .github/workflows/rust-lint.yml:
"buf generate protos" in a pre-hook, then "cargo clippy -- -D warnings"
over nexus, on the arm-small runner pool.

The runner image now bakes the toolchain (new build-phase Image Builder
component) so jobs don't reinstall it per run:
- pkg-config + libssl-dev (nexus build deps, per peerdb-server.Dockerfile)
- protoc 23.4 (matches scripts/install-protobuf.sh)
- buf (latest, matching bufbuild/buf-action)
- Rust 1.99.1 + clippy (matches the prod build pin), real toolchain
  binaries symlinked onto PATH so jobs need no RUSTUP_HOME/CARGO_HOME
Image recipe bumped 1.0.0 -> 1.1.0; image-test asserts the tools are runnable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maxknv
maxknv requested a review from a team as a code owner November 20, 2026 17:40
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@maxknv
maxknv marked this pull request as draft November 20, 2026 17:41
@maxknv maxknv changed the title ci: add Praktika Rust lint pilot job + bake toolchain into runner image ci: PoC migrate to self-managed CI Nov 20, 2026
@maxknv maxknv changed the title ci: PoC migrate to self-managed CI [WIP] ci: PoC migrate to self-managed CI Nov 20, 2026
@peerdb-ci

peerdb-ci Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Workflow [PR], commit [49a7354]

Summary: ❌

job_name test_name status info comment
Lint FAIL
golangci-lint flow FAIL
golangci-lint flow/pkg FAIL
golangci-lint e2e_cleanup FAIL
ui npm ci FAIL
ui eslint FAIL
ui prettier FAIL
UI build FAIL

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: TestApiMy/TestCancelTableAdditionRemoveAddRemove hit a 3-minute timeout waiting for the CDC flow to reach PAUSED on one of 14 matrix legs of a CI-infrastructure-only PR, while the same source-agnostic test code passed on the postgres/mongo legs — a timing/signal-delivery flake rather than a real bug.
Confidence: 0.85

✅ Automatically retrying the workflow

View workflow run

@maxknv
maxknv force-pushed the praktika-rust-lint-pilot branch from a2782de to 695da70 Compare November 21, 2026 11:08
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: Transient Google Cloud 500 internalError while deleting from the BigQuery staging bucket during source-connector validation failed Test_BigQuery_CDC_Ingestion_Methods in the bigquery_ch-lts shard only, while the identical suite passed in the ch-latest and ch-stable shards of the same run on an unrelated Rust-lint PR.
Confidence: 0.95

✅ Automatically retrying the workflow

View workflow run

Second increment of the GitHub Actions -> Praktika migration (follows the
rust-lint pilot). Ports flow.yml's self-contained jobs plus the first Tilt
e2e permutation.

Infra (ci/infrastructure/projects.py, ci/settings/settings.py):
- New heavy x86_64 runner pool amd_64cpu_128g (c7i.16xlarge, 200 GB) for the
  Tilt e2e stack; runner labels renamed to the <arch>_<Ncpu>_<Mg> convention.
- New x86_64-only image component peerdb-flow-host-toolchain: Go 1.27.3,
  gotestsum, Tilt 0.37.0, libgeos-dev, postgresql-client-18, retry, zstd, yq
  (HOME/GOCACHE set for the go install so Image Builder's root-no-HOME env
  doesn't break the build). Recipe bumped to 1.1.2.

Workflow jobs (ci/workflows/pull_request.py):
- Unit tests (no services) and Test selection coverage (self-contained).
- Flow test (postgres-16_ch-lts): first real Tilt e2e permutation,
  allow_failure while cloud suites are skipped (secret re-homing is Phase B).

Drivers (ci/scripts/):
- junit_result.py: JUnit XML -> structured praktika Result (per-test table).
- unit_tests.py / test_selection_coverage.py / flow_test.py: emit structured
  Results instead of bare exit codes.
- tilt_env.py: Tilt control-API orchestration (start, enable/wait ancillary,
  core-service recovery, docker diagnostics), port of tilt-flow.yml's bash.

Cloud-coupled suites (AWS/RDS-IAM/CloudSQL/destinations) are skipped this
increment; the 21-way matrix, build caches, secret re-homing and fork-PR gate
are Phase B.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maxknv
maxknv force-pushed the praktika-rust-lint-pilot branch 2 times, most recently from 87850df to a30f105 Compare November 21, 2026 12:28
maxknv and others added 2 commits November 21, 2026 13:29
Port flow.yml's 21-permutation flow_test matrix into flow_matrix.py as the
single source of truth. flow_test.py resolves the per-run env from the job
label; pull_request.py generates one parametrized job per target.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Black PeerDB logo on transparent background, 128x128. Uploaded to the
report bucket root by ReportPage.deploy and loaded by the report page.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: Flaky: Test_CDC_Live_PullRecords asserts all 6 CDC events land in one 5s-idle-timeout batch, but the CockroachDB connector by design drops records not yet covered by a resolved timestamp and re-reads them next batch — it got 3, while the identical test passed on the cockroachdb-v24 leg of the same run (the other 19 jobs were fail-fast cancellations, not failures).
Confidence: 0.8

✅ Automatically retrying the workflow

View workflow run

…C proposal

- flow_images (A1): ci/scripts/flow_images.py builds flow-api/worker/
  snapshot-worker once and publishes the `flow-images` S3 artifact; the matrix
  requires it and flow_test.py docker-loads it + sets
  PEERDB_CI_PREBUILT_FLOW_IMAGES=1 so Tilt skips the per-job image builds.
- Disable the cloud-destination-only permutations in flow_matrix.py
  (postgres_other x3, bigquery_ch-* x3) — they only fail with
  "TEST_BQ_CREDS env var not set" until cloud auth lands.
- MIGRATION_TODO B4: keyless cloud auth via OIDC / workload-identity
  federation (AWS instance role; GCP WIF — already supported by the flow
  code; Azure WIF), storing zero sensitive creds and enabling safe fork-PR
  cloud tests. Preferred over re-homing key secrets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: Infrastructure flake, not a code bug: the maria-11_ch-lts job failed during service startup because Docker could not bind fixed host debug port 40002 for flow-snapshot-worker ("address already in use" — the port lies in the runner's ephemeral range), so no tests ever ran while all 22 sibling matrix jobs passed.
Confidence: 0.93

✅ Automatically retrying the workflow

View workflow run

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: Infrastructure flake, not a test failure: the postgres-18_ch-latest job failed during Tilt startup because Docker could not bind host port 40002 for flow-snapshot-worker ("address already in use"), so no tests ran, while all 16 other matrix jobs on the same commit passed.
Confidence: 0.92

✅ Automatically retrying the workflow

View workflow run

Diagnostics (docker container logs incl. mongod, tilt resource state, tilt
startup log) + coverage were attached to the `flow` sub-result, but praktika
only uploads files on the job's top-level Result — so test-failure runs shipped
only job.log. Move them to the top-level Result so the mongod server log is
available to diagnose the mongo connection-reset failures.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maxknv
maxknv force-pushed the praktika-rust-lint-pilot branch from 207075f to efce78a Compare November 21, 2026 20:03
…nce)

The catalog Postgres backs Temporal; its fsync latency on network-attached CI
storage bottlenecks commit-heavy snapshots (the 50-table fuzzer blows the 120s
snapshot wait). The CI DBs are disposable, so durability is unneeded: run
catalog with fsync/synchronous_commit/full_page_writes off.

Env-gated via CATALOG_EXTRA_PG_FLAGS so local dev is unchanged (durability
preserved); flow_test.py sets it in .env, docker-compose-dev.yml interpolates
it into the catalog command.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: Both failing jobs died during infrastructure setup before any test ran — one on a transient HTTP 503 downloading the Tilt installer, the other on a Docker host-port collision (40002 already in use) preventing flow-snapshot-worker from starting.
Confidence: 0.95

✅ Automatically retrying the workflow

View workflow run

@maxknv
maxknv force-pushed the praktika-rust-lint-pilot branch 5 times, most recently from 531e7fa to 9371bf6 Compare November 22, 2026 19:50
Match GitHub runner sizes and modernize instances; fixes jobs stuck pending
after the pool rename (the deployed infra deleted the old amd_64cpu_128g queue
while the workflow still routed to it).

- amd_32cpu_64g (c8i.8xlarge, 32 vCPU / 64 GiB, 1:2): Tilt e2e matrix + unit
  tests. Matches ubuntu-latest-32-cores on CPU; RAM isn't the CI constraint.
- amd_8cpu_16g (c8i.2xlarge): flow_images build + test-selection (can't
  saturate the big pool).
- arm_2cpu_4g -> c8g.large (Graviton4).
- Image builders -> c8g.large / c8i.large (latest-gen, small).
- Keeps gp3 IOPS/throughput bump on the e2e pool; modest bump on the build pool.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maxknv
maxknv force-pushed the praktika-rust-lint-pilot branch from 9371bf6 to 412faa8 Compare November 22, 2026 20:13
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: The bigquery_ch-latest job's Test_BigQuery_CDC_Isolated_Table_Backpressure_Does_Not_Block_Sibling hit a 2-minute EnvWaitFor timeout on a timing-sensitive exact-state predicate (SyncedBatchID == 2 && NormalizedBatchID == 0), while the identical 64-test suite passed concurrently in the bigquery_ch-lts job on the same commit.
Confidence: 0.8

✅ Automatically retrying the workflow

View workflow run

Consolidated linters into one "Lint" job (per-step sub-results):
golangci-lint on flow/flow/pkg/e2e_cleanup + ui eslint + prettier
(ci/scripts/lint.py). Separate "UI build" job runs `next build`.

Image (x86): bake golangci-lint v2.15.0 (matches golang-lint.yml) and
Node 22 LTS; recipe 1.1.4 -> 1.1.5, flow component 1.0.3 -> 1.0.4.
Protos generated per-run in the pre-hook.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants