Skip to content

Add Prow jobs, CI image and OWNERS - #1087

Merged
mjudeikis merged 6 commits into
railgrid:mainfrom
mjudeikis:prow-ci
Nov 12, 2026
Merged

mjudeikis merged 6 commits into
railgrid:mainfrom
mjudeikis:prow-ci

Conversation

@mjudeikis

Copy link
Copy Markdown
Contributor

Second half of moving CI to Prow. Prow itself is deployed on railgrid-dev from railgrid/ops#26 and serves https://prow-dev.railgrid.ai; this PR gives it jobs to run.

Nothing here gates merging. Every job is optional: true and runs next to the existing GitHub Actions workflows, which are untouched.

What is added

  • .prow.yaml: 13 presubmits. Six mirror ci.yaml (contracts, build, lint, test, test-providers, portals), seven mirror e2e.yaml (e2e-providers and the six kind suites).
  • hack/ci/prow/job.sh: what each job runs, one case per job, same commands as the workflow steps.
  • hack/ci/prow/mode.py: the full / provider-ui / docs selection, reusing hack/ci/selection.py.
  • hack/ci/prow/image/: the CI image (Go 1.26.10, Node 22, Python 3.12, Helm, kubectl, kind v0.33.0, Docker, PostgreSQL 16) and its entry point.
  • .github/workflows/ci-image.yaml: builds and pushes ghcr.io/railgrid/railgrid-ci.
  • OWNERS: approvers for Prow's approve plugin and Tide.
  • hack/ci/prow/README.md: how to use it.

Behaviour changes to know about

  • Tide. Once OWNERS is on main, a PR by an approver gets approved automatically and Tide merges it when every status and check is green, Actions included. /hold stops that.
  • Outside contributors need /ok-to-test from an org member before anything runs. The kind suites run privileged on the dev cluster's nodes, so read the diff first.
  • Speed. The cluster runs four jobs at a time and has no shared Go cache yet; a full Prow run is much slower than Actions.

After merge

  1. The CI image (Prow) workflow runs on main and pushes railgrid-ci:v1.
  2. Set the railgrid-ci package to public (new packages default to internal; the cluster pulls anonymously).
  3. /test all on any open PR.

Until steps 1 and 2 are done, Prow jobs fail to pull the image. That includes the jobs on this PR, which are expected to error.

Tested

In the CI image built locally (arm64):

  • contracts job end to end: passes, including verify-ci-selection and verify-workflows with these files in the tree.
  • PostgreSQL starts and accepts the store-test DSN as the unprivileged ci user.
  • Docker-in-Docker: kind create cluster reaches a Ready node inside a privileged container.
  • checkconfig --strict accepts .prow.yaml against the deployed Prow config.

Not run locally: the Go test jobs and the e2e suites themselves. Their first real run is on the cluster, which is what the shadow period is for.

Prow (https://prow-dev.railgrid.ai, deployed from railgrid/ops) reads
.prow.yaml from each pull request. The 13 jobs mirror the CI and E2E
workflows through hack/ci/prow/job.sh and run in a new CI image,
ghcr.io/railgrid/railgrid-ci, built by the ci-image workflow.

Every job is optional: Prow shadows GitHub Actions and blocks nothing.
OWNERS names the approvers Tide merges on. See hack/ci/prow/README.md.
@mjudeikis
mjudeikis requested a review from cwilhit as a code owner November 12, 2026 07:29
On the first run on the cluster, jobs without limits used 99% of the CPU
on two of the three nodes. The cluster's single CoreDNS replica runs on
one of them and stopped answering: clonerefs could not resolve
github.com and the OIDC suite could not reach proxy.golang.org. CPU
limit equals the request, so the scheduler never overcommits CI.
Prow's entrypoint is PID 1 in the job container and does not reap
orphans, so a killed grandchild stays a zombie and kill(pid, 0) still
finds it. The three process-group cleanup tests (supervisor, claude and
codex harnesses) failed on the cluster for that reason. runner.sh now
re-executes itself under tini as a child subreaper. CI image v2.
@mjudeikis

Copy link
Copy Markdown
Contributor Author

/test all

Kubernetes gives a privileged container the host cgroup namespace, so
the dockerd in a kind-suite pod created /docker at the node's cgroup
root: image builds and kind nodes ran outside the pod, with no CPU or
memory limit, beside the dev platform. runner.sh now parents dockerd
under the pod's own cgroup. Verified with --cgroupns=host: containers,
BuildKit steps and kind nodes all land under the outer container.
Kind suites get a 10Gi memory limit to cover what is now counted.
CI image v3.
All 13 Prow jobs pass on this PR, so the CI and E2E workflows stop running
on pull_request and keep running on pushes to main, where Prow has no
postsubmits. The Prow jobs lose optional: true, so Tide does not merge
past a red one.
The ssh branch was the integration branch for SSH server-mode, merged in
railgrid#70 in February; nothing targets it any more.
@mjudeikis

Copy link
Copy Markdown
Contributor Author

/approve
/lgtm

@mjudeikis

Copy link
Copy Markdown
Contributor Author

@mjudeikis-bot review

@mjudeikis mjudeikis left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three findings, none Critical. Details are in the inline comments.

PR description no longer matches the diff. The body says every job is optional: true, the image is railgrid-ci:v1, "Nothing here gates merging" and the Actions workflows are untouched. The head has no optional anywhere (.prow.yaml:10-12, hack/ci/prow/README.md:22), the tag is v3 (hack/ci/prow/image/VERSION), and ci.yaml and e2e.yaml lose their pull_request trigger. The /approve and /lgtm on the PR were given against the description, not the diff.

Not anchored: make verify-workflows lists its workflow files explicitly (Makefile:820). ci-image.yaml is not in that list, so the new workflow is never actionlinted (see the inline Warning).

Checked

  • Read beyond the diff: hack/ci/selection.py (classify, changed_paths, is_docs), hack/ci/matrices.json consumers, the full pre-change .github/workflows/ci.yaml and e2e.yaml (compared every step with its job.sh case), hack/ci/test_workflows.py, hack/ci/requirements-test.txt, the Makefile targets verify-ci-selection, verify-workflows and verify-charts, and the providers/*/go.mod list against the test-providers module loop.
  • Correctness: job.sh cases match the workflow commands. The module list matches every go.mod under providers/. The edges no-race exception is preserved. skip_if_only_changed: '^docs/|\.md$' matches is_docs. mode.py returns full for batch and non-presubmit jobs, which is the safe direction. Run locally with presubmit env vars it returned full for this diff. No defect found.
  • Concurrency: not applicable beyond runner.sh cgroup and reaper handling. I read it and found no race. I could not exercise the privileged DinD path here.
  • Tenancy and kcp, provider contract, API and codegen, portal: not applicable. The diff touches no Go, API, manifest, chart or portal code.
  • Security: /ok-to-test and privileged kind pods are documented in .prow.yaml and the README. Findings: the downloads in the Dockerfile are not checksum-verified, and approver self-merge reads job definitions from the PR head (both are Notes below).
  • Tests: python3 -I -m unittest discover -s hack/ci -p 'test_*.py' ran 32 tests and all passed. test_workflows.py now asserts that ci and e2e have no pull_request trigger. I added no tests of my own.
  • Build and run: I did not run make build, make vet, make lint or make verify-workflows. The diff has no Go changes, and I did not install the pinned actionlint or the full toolchain here. I did not run any e2e suite. They need privileged Docker and the CI image, which does not exist yet. This review does not cover whether the kind suites pass under Prow.
  • Pinned downloads: HTTP HEAD on the Go 1.26.10, Node 22.23.5, Helm v4.3.1, kubectl v1.37.1 and kind v0.33.0 URLs returned 200. ghcr.io/railgrid/railgrid-ci:v3 is not anonymously pullable right now (401).

Comment thread .prow.yaml
timeout: 25m
spec:
containers:
- image: ghcr.io/railgrid/railgrid-ci:v3

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning: Unverified: the PR cannot go green, and PR gating depends on a manual step after merge
I could not confirm this against the live cluster. Every job names railgrid-ci:v3, which only ci-image.yaml publishes, and only after merge to main. The anonymous manifest request returns 401, so the image is not pullable now. Because ci.yaml and e2e.yaml no longer run on pull_request, and no job is optional, this PR has no working PR-time validation at all (the body says "jobs on this PR are expected to error"). Tide cannot merge it without 13 /overrides. After merge, if the package is not set public, or ci-image.yaml fails, every PR to main has no CI. Actions no longer runs on PRs and Prow cannot pull. Consider merging in two steps: first the image workflow and image, then the ci.yaml/e2e.yaml trigger removal. Or keep the Actions pull_request triggers until Prow has run green on a PR, as the body's "shadow period" says. The body also still says optional: true and v1; please correct it.

# To change the image: bump VERSION and the tag in .prow.yaml in the same pull
# request, merge, and wait for this run. Until it finishes, jobs that name the
# new tag fail to pull. A manual run from main rebuilds the current VERSION.
on:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning: The CI image build is never validated before merge, and the new workflow is not actionlinted
The workflow triggers only on push to main and workflow_dispatch. A PR that breaks hack/ci/prow/image/Dockerfile (for example a moved download URL) merges green and only fails on main. At that point every Prow job fails to pull, and the Actions PR jobs are gone. Separately, make verify-workflows (Makefile:820) names its files explicitly and ci-image.yaml is not among them, so this file is not linted. Add a build-only PR run and add the file to the Makefile list:

on:
  pull_request:
    paths:
      - hack/ci/prow/image/**
      - .github/workflows/ci-image.yaml
# ...and on the build-push step: push: ${{ github.event_name != 'pull_request' }}
# and gate the ghcr login on the same condition
@$(ACTIONLINT) -shellcheck= -pyflakes= ... .github/workflows/ci-image.yaml

The workflow also overwrites the ${VERSION} tag on any change under hack/ci/prow/image/ without a VERSION bump. Nodes that already cached v3 (default pull policy IfNotPresent) keep the old image. Fail the job if the tag already exists, or tag by digest.

docker-ce docker-ce-cli containerd.io docker-buildx-plugin \
&& rm -rf /var/lib/apt/lists/*

RUN curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz" | tar -xz -C /usr/local

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Toolchains in the privileged CI image are downloaded without checksum verification
Go, Node, Helm, kubectl and kind are fetched with curl | tar or curl -o and run as root-equivalent (ci is in the docker group, and the kind suites run privileged). A compromised or truncated download is installed silently. Publish the expected sha256 as ARGs and verify them, for example:

ARG GO_SHA256_amd64=...
RUN curl -fsSLo /tmp/go.tgz "https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz" \
 && echo "${GO_SHA256}  /tmp/go.tgz" | sha256sum -c - && tar -xzf /tmp/go.tgz -C /usr/local && rm /tmp/go.tgz

Comment thread OWNERS
# request gets the `approved` label automatically; anyone else's needs
# /approve from one of them. Tide merges on `approved` once every check is
# green. See hack/ci/prow/README.md.
approvers:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: An approver's PR can change the jobs that gate it, with no second human
Per the README an approver's own PR is approved implicitly. .prow.yaml and hack/ci/prow/job.sh are read from the PR head, and the ci/e2e workflows no longer run on PRs. Such a PR can weaken or delete a job (for example make job.sh exit 0) and Tide merges it once the weakened jobs are green. Nothing in the diff, such as a .prow.yaml/hack/ci/ entry in a separate OWNERS approvers file, requires another person. With two approvers it is cheap to add hack/ci/prow/ and .prow.yaml to a path-scoped OWNERS requiring the other approver, or to keep branch protection requiring a review.

@mjudeikis

Copy link
Copy Markdown
Contributor Author

/approve

@railgrid-prow

railgrid-prow Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mjudeikis

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mjudeikis
mjudeikis merged commit 09bc5d7 into railgrid:main Nov 12, 2026
27 of 28 checks passed
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.

1 participant