Repository navigation
feat(dev_env): support hybrid kind control plane with remote k8s data plane - #799
Merged
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a hybrid execution model to the development environment, allowing local control plane services in KinD to orchestrate workloads on a remote GKE cluster. The reviewer identified a critical bug in remote_k8s_manager.py where captured command output is not decoded from bytes, which would result in a malformed token in the generated kubeconfig. Additionally, a bug in config.py was flagged where falsy boolean-like strings are incorrectly treated as context names, and a corresponding test update was suggested to mock stdout as bytes to properly validate the decoding logic.
VLukiantsev
force-pushed
the
feat/tools-dev-env-remote-k8s-hybrid
branch
from
September 7, 2026 11:35
acf0b8d to
822369b
Compare
VLukiantsev
force-pushed
the
feat/tools-dev-env-remote-k8s-hybrid
branch
3 times, most recently
from
September 7, 2026 14:42
ea941af to
d4ac24c
Compare
VLukiantsev
marked this pull request as ready for review
September 7, 2026 14:45
VLukiantsev
force-pushed
the
feat/tools-dev-env-remote-k8s-hybrid
branch
from
September 7, 2026 15:05
d4ac24c to
2224ac3
Compare
… plane Enable a hybrid development and verification workflow where the lightweight XMC control plane (Web UI, Dex OIDC, Redis, ESS, Actuator, Reconciler) runs locally inside KinD with sub-second reload cycles, while workload compute execution (JobSets, Kueue) and Cloud Spanner run against a remote GKE cluster. Key changes: - cmd/actuator/k8s_client: check KUBECONFIG before falling back to in-cluster config. - deploy/helm: add remoteK8s configuration to mount remote-k8s-config kubeconfig secret and project GCP SA credentials alongside backend-oauth-secrets. - tools/dev_env: introduce RemoteK8sManager to generate static, self-contained kubeconfig secrets directly from remote cluster contexts without requiring gcloud inside KinD containers. - tools/dev_env: add --remote-k8s and --remote-k8s-context flags to dev_env CLI and auto-derive cluster context and workload service accounts. TAG=agy CONV=4adc92f3-5e2b-459f-bf97-73230c96ba0e
Address code review comments on PR #799: - Decode `res.stdout` if bytes in `extract_remote_cluster_endpoint_and_ca` and `mint_service_account_token` to prevent TypeError when `capture_output=True` returns bytes. - Introduce `_is_bool_flag` in `tools/dev_env/config.py` to recognize both truthy and falsy boolean flags so strings like "false" or "no" are not treated as cluster context names. - Update `test_mint_service_account_token_success` unit test to return bytes. TAG=agy CONV=4adc92f3-5e2b-459f-bf97-73230c96ba0e
…ation index - Expand tools/dev_env/README.md with a comprehensive user guide for the Hybrid Execution Model (`--remote-k8s`), including prerequisites, quickstart commands, configuration reference, security model, and troubleshooting. - Add Local & Hybrid Development Guide to Documentation Index in root README.md. - Add Local Development & Hybrid Execution section to docs/developer.md. - Streamline _is_bool_flag in tools/dev_env/config.py using _BOOL_STRINGS frozenset. TAG=agy CONV=4adc92f3-5e2b-459f-bf97-73230c96ba0e
VLukiantsev
force-pushed
the
feat/tools-dev-env-remote-k8s-hybrid
branch
from
September 7, 2026 15:10
2224ac3 to
72a4201
Compare
janzak-dev
requested changes
Sep 7, 2026
- Unify _parse_bool and _is_bool_flag in tools/dev_env/config.py. - Extract _resolve_field helper to standardize CLI > Env > YAML precedence. - Remove redundant aliases and standardize on REMOTE_K8S_CONTEXT and REMOTE_K8S_NAMESPACE. - Clarify gcloud credentials command reference in tools/dev_env/README.md. Comment links: - #799 (comment) - #799 (comment) - #799 (comment) - #799 (comment) TAG=agy CONV=4adc92f3-5e2b-459f-bf97-73230c96ba0e
janzak-dev
previously approved these changes
Sep 8, 2026
…799 - Sync branch with origin/main and resolve conflicts in tools/dev_env/dev_env.py and config_test.py. - Unify REMOTE_K8S and enable_remote_k8s to canonical remote_k8s flag in tools/dev_env/config.py. - Add test_remote_k8s_from_yaml unit test in tools/dev_env/config_test.py. Comment link: - #799 (comment) TAG=agy CONV=4adc92f3-5e2b-459f-bf97-73230c96ba0e
janzak-dev
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces automated developer tooling in
tools/dev_envfor the hybrid KinD control plane + remote Kubernetes data plane workflow, allowing local developers to target a remote GKE cluster for WorkUnit execution via--remote-k8s, accompanied by complete developer documentation intools/dev_env/README.md,README.md, anddocs/developer.md.Motivation & Context
Developing and testing XMC features that interact with real Kubernetes controllers (JobSet, Kueue admission, hardware-dependent pods on GPUs/TPUs) historically required deploying the entire heavy control plane to GKE, which takes 15–20 minutes per iteration. This PR enables a hybrid model where developers run the lightweight control plane locally in KinD (with 5-second reload cycles via
dev_env reload) while automatically dispatching compute workloads to a remote GKE cluster.Key Changes
tools/dev_env/remote_k8s_manager.pyto discover API server endpoints and CA data, mint self-contained ServiceAccount bearer tokens viakubectl create token, and generate staticremote-k8s-configSecrets in KinD with zero gcloud dependencies inside containers.tools/dev_env/config.pywithremote_k8s_context,remote_k8s_namespace,remote_k8s_service_account, and auto-derivation of GKE contexts and workload SAs.--remote-k8s-context(and--remote-k8sshorthand),--remote-k8s-namespace, and--remote-k8s-service-accountflags todev_env upintools/dev_env/dev_env.py.kind_manager.pyand Helm value overrides intohelm_deployer.py.kind_manager.pyandlocal_runner.pystatus displays to report hybrid mode and target remote clusters.tools/dev_env/README.mdwith an end-to-end Hybrid Mode guide (context discovery, prerequisites, step-by-step quickstart, verification, troubleshooting), updated rootREADME.mdDocumentation Index, and linked fromdocs/developer.md.Assumptions
None — requirements were fully specified.
Verification & Testing
bazel test //tools/dev_env/...(14/14 test targets passing, including new tests inconfig_test.pyandremote_k8s_manager_test.py)../.githooks/pre-commit(Clean pass across all linters and security scanners)....and Cloud Spanner instance....experiments/6002, submitted WorkUnit 4 targetingcpu-queue."Hello from Hybrid KinD-GKE XMC".COMPLETED(state: 10).TAG=agy
CONV=4adc92f3-5e2b-459f-bf97-73230c96ba0e
Stack created with GitHub Stacks CLI • Give Feedback 💬