Skip to content

perf: parallelize Seqera calls and batch DB query#94

Merged
vtnphan merged 2 commits into
mainfrom
parallel-seqera-calls
Jul 2, 2026
Merged

perf: parallelize Seqera calls and batch DB query#94
vtnphan merged 2 commits into
mainfrom
parallel-seqera-calls

Conversation

@vtnphan

@vtnphan vtnphan commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

Optimise the job list endpoint to reduce dashboard load time.

Changes

  • Parallel Seqera callslist_jobs fans out all describe_workflow requests concurrently via asyncio.gather instead of awaiting each one in sequence. Load time drops from N × Seqera latency to roughly one round-trip.
  • Single DB query for owned runs — replaces N+1 per-run get_owned_run calls with one batch query (get_owned_runs_by_run_id) returning a dict[run_id → WorkflowRun]. The now-unused get_owned_run_ids helper is removed.

How to Test

  1. Open the job dashboard with several jobs — the list should appear in roughly the time of a single Seqera API call.
  2. Run tests:
    .venv/bin/python -m pytest

Type of change

  • Bug fix
  • New feature
  • Performance improvement
  • Breaking change

Checklist

  • Tests added/updated
  • All tests pass locally

@vtnphan vtnphan marked this pull request as ready for review July 2, 2026 23:26

@amandazhuyilan amandazhuyilan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow good improvement - lets ship this

@vtnphan vtnphan merged commit ca8ba6d into main Jul 2, 2026
2 checks passed
@vtnphan vtnphan deleted the parallel-seqera-calls branch July 2, 2026 23:54
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