Repository navigation
feat(dev_env): add explicit service fast reload and rollout restart - #696
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new reload command to the local development environment CLI (dev_env.py), enabling fast inner-loop hot-reloading of microservices into a running KinD cluster. The implementation includes parallel image compilation with Bazel, side-loading into KinD, and triggering non-blocking rollout restarts. Feedback on these changes highlights several key improvement opportunities: allowing Helm-only reloads without requiring explicit service arguments, properly tracking and reporting failed deployment restarts rather than silently skipping them, raising a RuntimeError on rollout failures to ensure non-zero exit codes in automated environments, and adding corresponding unit tests for these scenarios.
40546bc to
3bce93e
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new reload command to the local development environment tool (dev_env.py), enabling fast, parallel hot-reloading of microservices into the running KinD cluster. The core implementation in local_runner.py handles service alias resolution, Bazel image rebuilding, side-loading, and non-blocking rollout restarts, accompanied by comprehensive unit tests and updated documentation. The review feedback suggests capturing command output during concurrent rollout status checks to prevent terminal output interleaving, and replacing LaTeX math symbols in the README with standard Unicode arrows to ensure consistent rendering across Markdown viewers.
5746c0e to
9f31519
Compare
9f31519 to
943f920
Compare
b99592f to
bb64950
Compare
bb64950 to
b99592f
Compare
b99592f to
cd37556
Compare
cd37556 to
b99592f
Compare
b99592f to
81adc06
Compare
81adc06 to
8c25c1d
Compare
The merge-base changed after approval.
935ccf2 to
c7a7384
Compare
c7a7384 to
bc9dbc9
Compare
bc9dbc9 to
f209758
Compare
f209758 to
40c7dad
Compare
Enables fast inner-loop development by recompiling explicit microservices in parallel with Bazel, side-loading updated OCI image layers into KinD, and performing parallel rolling restarts on affected deployments without destroying or recreating the cluster. TAG=agy
- Allow empty services when --helm is specified (e.g. dev_env reload --helm). - Track failed kubectl rollout restart commands and include them in failure reports. - Raise RuntimeError on failed rollouts so CLI exits non-zero. - Add unit tests for helm-only reload and failure error handling. TAG=agy
…E arrows - Add capture_output=True to concurrent rollout status checks to prevent garbled terminal logs. - Replace LaTeX arrows with Unicode arrows in tools/dev_env/README.md. TAG=agy
…ata from LocalRunner - Create tools/dev_env/service_resolver.py with SERVICE_ALIASES, resolve_service_name, resolve_service_names, service_to_k8s_deployment_name, and resolve_target_services. - Add comprehensive unit tests in tools/dev_env/service_resolver_test.py. - Refactor LocalRunner to delegate service resolution to ServiceResolver, enforcing Single Responsibility Principle (SRP). - Update Bazel BUILD files with service_resolver targets and aliases. TAG=agy
…support without aliases - Clarify that any canonical snake_case or kebab-case service name can be passed directly to reload. - Add examples using experiment_state_server, actuator, reconciler, and xid-service. - Add tip highlighting automatic support for new microservices under cmd/<new_service>. TAG=agy
40c7dad to
3cc0477
Compare
Summary
Implements explicit microservice fast reload and concurrent Kubernetes deployment rollout restarting in
dev_env.py(dev_env.py reload <services...>), enabling fast sub-10s developer feedback loops without destroying or recreating the local KinD cluster.Motivation & Context
Full local cluster provisioning takes ~60–90 seconds. When iterating on individual backend microservices or UI components, developers need a fast inner-loop mechanism to recompile only modified binaries, side-load new OCI image layers into KinD, and trigger zero-downtime rolling restarts.
Key Changes
LocalRunner.reload(services, helm): Added execution pipeline coordinating parallel OCI image compilation viaImageBuilder, image side-loading viakind load docker-image, and non-blockingkubectl rollout restart+ status tracking across worker threads.service_to_k8s_deployment_name()andresolve_service_names()mapping short developer aliases (ess,ui,rod,gw,dash) to canonical Kubernetes deployment names.reloadsubcommand totools/dev_env/dev_env.pysupporting positional service names/aliases and--helmflag.local_runner_test.pyanddev_env_test.py, and documented CLI commands and service aliases intools/dev_env/README.md.Mandatory Assumptions Disclosure
xmc-<environment>) was previously bootstrapped viadev_env.py up. RaisesRuntimeErrorif the cluster is not running.xmcnamespace for microservice deployments.Verification & Testing
bazel test //tools/... //test/e2e/...(66/66 tests passing 100%).ruff,mypy,buildifier,addlicense).TAG=agy
CONV=4adc92f3-5e2b-459f-bf97-73230c96ba0e