8000 feat(dev_env): add explicit service fast reload and rollout restart by VLukiantsev · Pull Request #696 · google/xmc · GitHub
[go: up one dir, main page]

Skip to content

feat(dev_env): add explicit service fast reload and rollout restart - #696

Merged
VLukiantsev merged 5 commits into
feat/tools-dev-env-cluster-diagnosticsfrom
feat/tools-dev-env-explicit-fast-reload
Sep 4, 2026
Merged

VLukiantsev merged 5 commits into
feat/tools-dev-env-cluster-diagnosticsfrom
feat/tools-dev-env-explicit-fast-reload

Conversation

@VLukiantsev
@VLukiantsev VLukiantsev commented Aug 31, 2026 •
Copy link
Copy Markdown
Collaborator

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 via ImageBuilder, image side-loading via kind load docker-image, and non-blocking kubectl rollout restart + status tracking across worker threads.
  • Service Name Conventions & Aliases: Added service_to_k8s_deployment_name() and resolve_service_names() mapping short developer aliases (ess, ui, rod, gw, dash) to canonical Kubernetes deployment names.
  • CLI Subcommand: Added reload subcommand to tools/dev_env/dev_env.py supporting positional service names/aliases and --helm flag.
  • Unit Tests & Documentation: Added unit tests in local_runner_test.py and dev_env_test.py, and documented CLI commands and service aliases in tools/dev_env/README.md.

Mandatory Assumptions Disclosure

  • Pre-existing KinD Cluster: Assumes the local KinD cluster (xmc-<environment>) was previously bootstrapped via dev_env.py up. Raises RuntimeError if the cluster is not running.
  • Kubernetes Namespacing: Targets the standard xmc namespace for microservice deployments.

Verification & Testing

  • Bazel Test Suite: bazel test //tools/... //test/e2e/... (66/66 tests passing 100%).
  • Linters & Static Analysis: Pre-commit hooks passed cleanly (ruff, mypy, buildifier, addlicense).

TAG=agy
CONV=4adc92f3-5e2b-459f-bf97-73230c96ba0e

@gemini-code-assist gemini-code-assist 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.

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.

Comment thread tools/dev_env/local_runner.py Resolved
Comment thread tools/dev_env/local_runner.py Resolved
Comment thread tools/dev_env/local_runner.py Resolved
Comment thread tools/dev_env/local_runner_test.py Resolved
@VLukiantsev
VLukiantsev force-pushed the feat/tools-dev-env-explicit-fast-reload branch from 40546bc to 3bce93e Compare August 31, 2026 17:37
@VLukiantsev
Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist 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.

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.

Comment thread tools/dev_env/local_runner.py Resolved
Comment thread tools/dev_env/README.md Resolved
@VLukiantsev
VLukiantsev force-pushed the feat/tools-dev-env-explicit-fast-reload branch 4 times, most recently from 5746c0e to 9f31519 Compare August 31, 2026 18:20
@VLukiantsev
VLukiantsev force-pushed the feat/tools-dev-env-explicit-fast-reload branch from 9f31519 to 943f920 Compare September 1, 2026 10:43
@VLukiantsev
VLukiantsev marked this pull request as ready for review September 1, 2026 13:44
@github-actions
github-actions Bot requested a review from janzak-dev September 1, 2026 13:44
@VLukiantsev
VLukiantsev force-pushed the feat/tools-dev-env-explicit-fast-reload branch from b99592f to bb64950 Compare September 2, 2026 07:40
@VLukiantsev
VLukiantsev force-pushed the feat/tools-dev-env-explicit-fast-reload branch from bb64950 to b99592f Compare September 2, 2026 07:49
janzak-dev
janzak-dev previously approved these changes 10000 Sep 2, 2026
@VLukiantsev
VLukiantsev force-pushed the feat/tools-dev-env-explicit-fast-reload branch from b99592f to cd37556 Compare September 2, 2026 12:24
@VLukiantsev
VLukiantsev force-pushed the feat/tools-dev-env-explicit-fast-reload branch from cd37556 to b99592f Compare September 2, 2026 12:46
@VLukiantsev
VLukiantsev force-pushed the feat/tools-dev-env-explicit-fast-reload branch from b99592f to 81adc06 Compare September 2, 2026 14:54
@VLukiantsev
VLukiantsev force-pushed the feat/tools-dev-env-explicit-fast-reload branch from 81adc06 to 8c25c1d Compare September 2, 2026 15:16
janzak-dev
janzak-dev previously approved these changes Sep 3, 2026
@VLukiantsev
VLukiantsev added this pull request to the merge queue Sep 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a manual request Sep 3, 2026
@VLukiantsev
VLukiantsev dismissed janzak-dev’s stale review September 3, 2026 13:26

The merge-base changed after approval.

@VLukiantsev
VLukiantsev force-pushed the feat/tools-dev-env-explicit-fast-reload branch 2 times, most recently from 935ccf2 to c7a7384 Compare September 3, 2026 14:16
@VLukiantsev
VLukiantsev changed the base branch from feat/tools-dev-env-helm-sanitizer-and-diagnostics to feat/tools-dev-env-cluster-diagnostics September 3, 2026 14:41
@VLukiantsev
VLukiantsev force-pushed the feat/tools-dev-env-explicit-fast-reload branch from c7a7384 to bc9dbc9 Compare September 3, 2026 14:41
@VLukiantsev
VLukiantsev force-pushed the feat/tools-dev-env-explicit-fast-reload branch from bc9dbc9 to f209758 Compare September 3, 2026 15:02
@VLukiantsev
VLukiantsev force-pushed the feat/tools-dev-env-explicit-fast-reload branch from f209758 to 40c7dad Compare September 4, 2026 08:20
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
@VLukiantsev
VLukiantsev force-pushed the feat/tools-dev-env-explicit-fast-reload branch from 40c7dad to 3cc0477 Compare September 4, 2026 08:57
@VLukiantsev
VLukiantsev added this pull request to the merge queue Sep 4, 2026
Merged via the queue into main with commit 7d958c7 Sep 4, 2026
16 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0