Commit Graph

4 Commits

Author SHA1 Message Date
unkinben 6e5aa578ee perf: offload virtual repo merge to thread pool via asyncio.to_thread
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
The synchronous handler.merge() call blocked the uvicorn event loop for
the entire merge duration (38s for a 19-member helm virtual repo), stalling
all other requests on the same worker during that window.

Wrapping the call in asyncio.to_thread() releases the event loop while the
CPU-bound YAML parse/merge/dump runs in the default thread pool, allowing
health checks and other requests to be served concurrently.

Measured impact (19-member helm-all, single worker):
  Before: first concurrent /health stalled for 37721ms
  After:  all concurrent /health requests served in <65ms

The change is at the generic handler dispatch site, so it applies to all
current and future _VirtualHandler implementations without modification.

Also fix base_url/package keys merged onto a single line in
examples/single-file/remotes.yaml, which prevented docker-compose startup.
2026-05-02 01:30:36 +10:00
unkinben 1656664dfa refactor: split config into remotes/virtuals/locals sections (#31)
ci/woodpecker/tag/docker Pipeline was successful
Repository types now live under dedicated top-level keys instead of a
shared remotes: block distinguished by a type field:

  remotes:   caching proxy remotes (no type field needed)
  virtuals:  virtual merged-index repositories
  locals:    local upload repositories

Routes for local repos move from /api/v1/remote/ to /api/v1/local/.
config.py gains get_virtual_config() and get_local_config() lookups.
Root endpoint now reports all three sections. Drop root conf.d/ (was
an exact duplicate of examples/conf.d-method/).

Reviewed-on: #31
2026-04-30 23:50:20 +10:00
unkinben c7baae8d0d feat: add virtual repository support for unified index merging (#30)
Adds a new virtual repo type that merges indexes from multiple member remotes
of the same package type. Currently supports helm (index.yaml merge with URL
rewriting). Member fetches run in parallel; merged index is Redis-cached at
min(mutable_ttl) across members.

Reviewed-on: #30
2026-04-29 23:01:14 +10:00
unkinben ba52fedd27 chore: restructure examples into single-file and conf.d-method subdirs
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
examples/single-file/remotes.yaml  — original monolithic config
examples/conf.d-method/            — one yaml per remote (alpine, github, pypi)

docker-compose updated to mount from examples/single-file/.
2026-04-28 23:46:06 +10:00