Repository navigation
feat(tools): add local KinD environment bootstrap and deployment to dev_env.py - #559
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a fully automated local Kubernetes in Docker (KinD) development environment and a headless end-to-end (E2E) integration testing suite using Playwright. It adds a modular orchestration library to manage local KinD clusters, Cloud Spanner databases, OIDC authentication via Dex, and parallel container image compilation with Bazel. Feedback on the changes highlights a missing mapping in local_runner.py for several services (such as log_monitor, health_service, and dashboard_service) which will cause reload failures, as well as dead code in kind_manager.py involving if False conditional statements that should be removed.
f7cb6df to
4f00d0c
Compare
f4b2bfd to
390c2be
Compare
79eacac to
b6704f3
Compare
b6704f3 to
a3e6615
Compare
a3e6615 to
4073f5e
Compare
4073f5e to
2c1a599
Compare
2c1a599 to
97d06f0
Compare
97d06f0 to
b40aaf9
Compare
b40aaf9 to
2450fa4
Compare
2450fa4 to
3e6397a
Compare
32d9e73 to
cfc7cd1
Compare
cfc7cd1 to
33fff52
Compare
33fff52 to
75fdc10
Compare
75fdc10 to
19af
8000
380
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a local KinD development environment orchestrator, adding the LocalRunner and HelmDeployer modules along with corresponding CLI subcommands (up and down) in dev_env.py, updated documentation in README.md, and comprehensive unit tests. The feedback highlights a potential permission conflict in the temporary directory path on shared machines, recommends adding the --create-namespace flag to the Helm deployment command to support custom namespaces, and points out several discrepancies between the implemented CLI arguments and the documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a local development environment orchestrator (LocalRunner) and a Helm deployment manager (HelmDeployer) to bootstrap and tear down the local KinD developer stack, along with corresponding Bazel targets, CLI subcommands (up and down), tests, and updated documentation. The review feedback suggests making the rollout check more robust by verifying deployment existence before checking status, replacing direct print() statements with log_info() to respect logging configurations, correcting the Dex OIDC Provider URL, and updating the unit tests accordingly.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a local development environment orchestrator (LocalRunner) and a Helm deployment manager (HelmDeployer) to automate bootstrapping (up) and tearing down (down) local KinD environments. It also updates the CLI, Bazel build configurations, tests, and documentation. The feedback highlights a potential issue in helm_deployer.py where getpass.getuser() could raise a KeyError in minimal environments (like Docker or CI/CD), and suggests implementing a safer fallback mechanism.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a local KinD development environment lifecycle orchestrator (LocalRunner) and a Helm deployment manager (HelmDeployer), along with CLI subcommands up and down to automate local environment bootstrapping and teardown. The feedback highlights a critical bug in helm_deployer.py where res.stdout is treated as a string instead of bytes, which would cause rollout checks to fail. Additionally, several Windows compatibility issues were identified, including the use of os.getuid in fallback logic and the patching of os.getuid in unit tests without create=True.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a local KinD development environment lifecycle orchestrator (LocalRunner) and a Helm deployment manager (HelmDeployer) to automate the bootstrapping (up) and teardown (down) of the local development stack, alongside CLI updates, unit tests, and documentation. The review feedback highlights several critical improvements for HelmDeployer, including securing temporary file paths against symlink attacks, using a standard YAML library instead of manual string formatting to prevent syntax errors, handling command execution failures robustly when querying deployments, and validating the existence of custom values files before deployment.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces automated bootstrap (up) and teardown (down) capabilities for the local KinD development environment, including a new LocalRunner orchestrator, a HelmDeployer utility, and associated unit tests and documentation. The review feedback is highly constructive and identifies three key improvements: optimizing the recursive _dump_yaml function to avoid redundant imports, handling potential RuntimeError exceptions gracefully in the CLI entry point, and ensuring that the --no-build-images flag correctly skips both the compilation and side-loading of OCI images.
There was a problem hiding this comment.
A screenshot of a terminal that shows the output of this would be great :)
Introduces LocalRunner orchestrator connecting SpannerManager, KindManager, ImageBuilder, and HelmDeployer into a unified pipeline. Exposes 'dev_env up' and 'dev_env down' CLI subcommands and updates documentation. TAG=agy
Summary
Implements minimal local KinD environment bootstrap and deployment orchestration in
dev_env.py(dev_env.py up,down), integrating Spanner provisioning, KinD clustering, OCI image builds, and Helm chart deployment.Motivation & Context
Delivers the core happy-path bootstrap command (
dev_env up) by generating dynamic values connecting pods to local Dex, Redis, and Spanner and executing Helm deployment.Key Changes
tools/dev_env/helm_deployer.pywith coreHelmDeployer:generate_values_file(): dynamicvalues.yamlconnecting pods to local Dex OIDC, Redis, and Cloud Spanner.deploy(): executeshelm upgrade --installand waits for rollout confirmation.tools/dev_env/local_runner.pywith coreLocalRunner:upanddownlifecycle workflows with status banner.upanddownsubcommands indev_env.py.tools/dev_env/helm_deployer_test.pyandtools/dev_env/local_runner_test.py(272 test lines).PR Sizing & Vertical Slicing Rationale
Verification & Testing
bazel test //tools/... //test/e2e/...(54/54 tests passing)ruff,mypy,buildifier,addlicense).Related Issues / Bugs
Part of Stacked PR sequence for Local KinD developer environment support.
TAG=agy
CONV=4adc92f3-5e2b-459f-bf97-73230c96ba0e