Skip to content

ci(kubernetes): add server pool e2e to nightly build, trim pause/resume matrix - #1583

Open
Pangjiping wants to merge 6 commits into
mainfrom
ci/k8s-pool-e2e
Open

ci(kubernetes): add server pool e2e to nightly build, trim pause/resume matrix#1583
Pangjiping wants to merge 6 commits into
mainfrom
ci/k8s-pool-e2e

Conversation

@Pangjiping

Copy link
Copy Markdown
Collaborator

Summary

Two related CI changes in the Kubernetes e2e area:

1. Add server pool e2e to the nightly build

New k8s-pool-e2e job (ingress-header variant) in kubernetes-nightly-build.yml that runs the server-managed pool allocation path:

  • Pool CR (tests/python/tests/support/server-pool.yaml) installed via kubectl; pod template runs execd as PID 1 (/bootstrap.sh sleep 3600 + EXECD_INIT=1), so pooled sandboxes can execute SDK commands through execd
  • New test_server_pool_e2e_sync.py: pool warms buffer → SDK sandbox created with extensions.poolRef allocated from the pre-warmed pool → commands.run() works via execd → destroy releases the pod back to the pool
  • scripts/common/kubernetes-e2e.sh: E2E_TEST_SUITE=pool now runs the SDK-side pool suite (sync) plus the new server pool test
  • scripts/python-k8s-e2e*.sh: export OPENSANDBOX_E2E_NAMESPACE
  • detect-changes.yml: pool e2e files trigger the kubernetes-mini-e2e area

This complements the SDK-side pool tests (test_sandbox_pool_e2e_sync.py), which never create a Pool CR.

2. Trim pause/resume e2e k8s version matrix

Pause/resume uses only stable Pod/Job/CRD APIs across 1.21–1.34; the 8-version matrix was reduced to 1.22.4 (minimum supported), 1.28.6, 1.34.2 (newest containerd). The core e2e matrix is unchanged.

Verification

  • ruff check passes on the new test file
  • bash syntax checked on modified scripts
  • YAML validated on all modified workflows

Pause/resume only uses stable Pod/Job/CRD APIs across the whole 1.21-1.34
range; the matrix was reduced from 8 versions to 1.22.4 (minimum supported),
1.28.6, and 1.34.2 (newest containerd).
Adds a k8s-pool-e2e job (ingress-header variant) running the server pool
allocation e2e: a kubectl-installed Pool CR whose pod template runs execd
as PID 1, then SDK sandboxes created with extensions.poolRef are allocated
from the pre-warmed buffer and run commands through execd. Release returns
the pod to the pool.

The pool suite in scripts/common/kubernetes-e2e.sh now also runs the new
test_server_pool_e2e_sync.py (sync SDK pool tests stay as the SDK-side
counterpart). kubectl namespace is exported to the test env, and the
pool test files are added to the kubernetes-mini-e2e change detector.
@github-actions github-actions Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef4d687da4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tests/python/tests/test_server_pool_e2e_sync.py Outdated
Comment on lines +83 to +84
path === "tests/python/tests/test_sandbox_pool_e2e_sync.py" ||
path === "tests/python/tests/test_sandbox_pool_e2e_async.py" ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Trigger the pool job for its own test files

The kubernetes-mini-e2e matcher adds the existing SDK-side pool tests but omits both newly introduced inputs, tests/python/tests/test_server_pool_e2e_sync.py and tests/python/tests/support/server-pool.yaml. A pull request that changes only the new server-pool test or manifest therefore reports this area as irrelevant and skips the job that exercises those changes; include both new paths in this matcher.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 281c1cf: both new paths (test_server_pool_e2e_sync.py and support/server-pool.yaml) are now in the kubernetes-mini-e2e matcher.

run: |
kind delete cluster --name "${KIND_CLUSTER}" || true

k8s-pool-e2e:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Gate nightly image publication on the pool E2E

For scheduled and manually dispatched runs, the new job is not included in publish-nightly-latest.needs, which still lists only k8s-mini-e2e and execd-init-e2e. As a result, the workflow can push latest images while this pool test is still running, and can publish successfully even when the pool validation fails; the pool job is gated only through the pull-request-only required job. Add k8s-pool-e2e to the publication dependency so failed validation cannot release the nightly images.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 281c1cf: publish-nightly-latest now depends on k8s-pool-e2e, so failed pool validation blocks nightly image publication on scheduled/manual runs.

kind: Pool
metadata:
name: e2e-server-pool
namespace: opensandbox-e2e

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply the pool to the configured E2E namespace

When either Kubernetes E2E script is run with a non-default E2E_NAMESPACE, it exports that value as OPENSANDBOX_E2E_NAMESPACE, so the test queries and deletes the pool in the configured namespace, but kubectl apply still creates this manifest in hard-coded opensandbox-e2e. The fixture then times out polling a pool that does not exist in the selected namespace and leaves the created resource behind; render or override this namespace from the configured value before applying the manifest.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 281c1cf: the fixture now renders the namespace into the manifest before applying (kubectl apply -f -), honoring OPENSANDBOX_E2E_NAMESPACE instead of the hard-coded opensandbox-e2e.

test_03 waited for pool allocation to reach zero, but the sandbox from
test_02 was still allocated; assert the drop by one instead. The Pool CR
also now pins recycleStrategy=Noop so a released pod returns to the buffer
instead of being deleted (the CRD default is Delete).
- detect-changes: include the new server pool test file and manifest in
  the kubernetes-mini-e2e area so pool-only PRs trigger the job
- nightly publish: gate 'latest' image publication on k8s-pool-e2e so a
  failing pool validation cannot release nightly images
- server-pool.yaml: render the namespace from OPENSANDBOX_E2E_NAMESPACE
  when applying instead of hard-coding opensandbox-e2e
@github-actions github-actions Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 20, 2026
Fixes the spotlessKotlinCheck failure on main (introduced by the
lifecycle-allocation-core merge): SandboxAllocation must sort before
SandboxCreateResponse.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk/java sdks size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant