Repository navigation
Add Prow jobs, CI image and OWNERS - #1087
Conversation
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.
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.
|
/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.
|
/approve |
|
@mjudeikis-bot review |
mjudeikis
left a comment
There was a problem hiding this comment.
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.jsonconsumers, the full pre-change.github/workflows/ci.yamlande2e.yaml(compared every step with itsjob.shcase),hack/ci/test_workflows.py,hack/ci/requirements-test.txt, the Makefile targetsverify-ci-selection,verify-workflowsandverify-charts, and theproviders/*/go.modlist against thetest-providersmodule loop. - Correctness:
job.shcases match the workflow commands. The module list matches everygo.modunderproviders/. The edges no-race exception is preserved.skip_if_only_changed: '^docs/|\.md$'matchesis_docs.mode.pyreturnsfullfor batch and non-presubmit jobs, which is the safe direction. Run locally with presubmit env vars it returnedfullfor this diff. No defect found. - Concurrency: not applicable beyond
runner.shcgroup 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-testand privileged kind pods are documented in.prow.yamland 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.pynow asserts that ci and e2e have nopull_requesttrigger. I added no tests of my own. - Build and run: I did not run
make build,make vet,make lintormake 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:v3is not anonymously pullable right now (401).
| timeout: 25m | ||
| spec: | ||
| containers: | ||
| - image: ghcr.io/railgrid/railgrid-ci:v3 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.yamlThe 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 |
There was a problem hiding this comment.
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| # 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: |
There was a problem hiding this comment.
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.
|
/approve |
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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: trueand runs next to the existing GitHub Actions workflows, which are untouched.What is added
.prow.yaml: 13 presubmits. Six mirrorci.yaml(contracts,build,lint,test,test-providers,portals), seven mirrore2e.yaml(e2e-providersand the six kind suites).hack/ci/prow/job.sh: what each job runs, onecaseper job, same commands as the workflow steps.hack/ci/prow/mode.py: the full / provider-ui / docs selection, reusinghack/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 pushesghcr.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
OWNERSis on main, a PR by an approver getsapprovedautomatically and Tide merges it when every status and check is green, Actions included./holdstops that./ok-to-testfrom an org member before anything runs. The kind suites run privileged on the dev cluster's nodes, so read the diff first.After merge
CI image (Prow)workflow runs on main and pushesrailgrid-ci:v1.railgrid-cipackage to public (new packages default to internal; the cluster pulls anonymously)./test allon 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):
contractsjob end to end: passes, includingverify-ci-selectionandverify-workflowswith these files in the tree.ciuser.kind create clusterreaches a Ready node inside a privileged container.checkconfig --strictaccepts.prow.yamlagainst 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.