Skip to content

More efficient fetching#235

Merged
gilesknap merged 58 commits into
mainfrom
more-efficient-fetching
Mar 27, 2026
Merged

More efficient fetching#235
gilesknap merged 58 commits into
mainfrom
more-efficient-fetching

Conversation

@gilesknap
Copy link
Copy Markdown
Member

@gilesknap gilesknap commented Mar 27, 2026

Summary

This PR significantly improves the performance and usability of the edge-containers CLI through several key changes:

Async I/O conversion

  • Convert subprocess calls to use asyncio-compatible equivalents, enabling concurrent fetching of service data
  • Add async_command wrapper for typer command compatibility
  • Propagate async/await throughout the codebase (cli.py, shell.py, git.py, helm.py, k8s_commands.py, argo_commands.py, monitor.py, etc.)
  • The monitor app no longer hangs on initial start and populates the table more efficiently

Description label for deployments

  • Add a description field to the deploy command (mandatory, to prevent accidental overwrites)
  • Display description labels in ec ps output and ec monitor
  • Change the label key from device to description

CLI output improvements

  • ec ps now renders as a Rich table
  • Deploy output uses rich formatting and colours

Bug fixes

  • Fix monitor stop/start/restart doing nothing after confirmation
  • Fix deploy failing for services not yet in ArgoCD
  • Fix async autocomplete callbacks incompatible with typer
  • Fix k8s TaskGroup iteration bug in _get_service_data
  • Fix ec ps output

Test plan

  • Unit tests updated for async changes across ArgoCD, k8s, and demo commands
  • Manual testing of ec deploy with description argument
  • Manual testing of ec ps Rich table output
  • Manual testing of ec monitor responsiveness improvements

OCopping added 30 commits March 4, 2026 08:57
… the table is more efficient

Also added a loading indicator
Missing await/async
OCopping and others added 28 commits March 26, 2026 09:08
The TaskGroup iterated over dict keys of self.sts_dicts instead of
items, creating duplicate tasks that exhausted mock responses. Since
k8s fetches all data in single kubectl/helm calls (unlike argocd which
needs per-app manifest fetches), TaskGroup is unnecessary here.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
webbrowser.open is sync in production but was mocked with the async
run_interactive method. Added a sync run_interactive_sync for mocking
sync callables that don't need to be awaited.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
avail_services and avail_versions were async but typer autocompletion
callbacks must be synchronous. Made them sync and use _run_async()
internally to call the async create_version_map.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
_check_description called _check_service which raised CommandError when
the service didn't exist yet. For first-time deployments, catch the
error and proceed with no existing description.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The command functions (start, stop, restart) are now async but were
called without await in the sync do_work thread worker. Wrapped with
_run_async() to properly execute the coroutine.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gilesknap gilesknap merged commit b56452c into main Mar 27, 2026
8 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