helm / chartmuseum

helm chart repository server
https://chartmuseum.com
Apache License 2.0
3.52k stars 396 forks source link

Add support for creating repository indexes in JSON format #739

Closed MeurillonGuillaume closed 5 months ago

MeurillonGuillaume commented 7 months ago

What this PR does

Adds support for generating an index.yaml in JSON-format to improve parsing performance (client-side) by using the default json library. Related to https://github.com/helm/helm/pull/12245 and #738.

Testing results

When templating releases for my personal projects, I noticed a ~27% speed improvement in direct comparison of the chartmuseum creating a YAML-formatted versus a JSON-formatted index.yaml. To be specific, a (rather large) Helmfile release used to take around 6min38s (user time), now takes 5m12s.

What was changed

A flag was added (--json-index) which defaults to false. When set to true chartmuseum will return the index.yaml with JSON-formatted content, as described in the PR mentionned above. This change should be backwards compatible with all Helm-clients before 3.13.0, since YAML is a superset of JSON, meaning all JSON can be parsed using YAML parsers. To be able to fully take advantage of the performance improvement the client will have to be updated to Helm >3.13.0.

scbizu commented 6 months ago

I'd plan to ship v0.16.1 soon with some critical CVE fixes , and this PR may delay to next release window .

scbizu commented 6 months ago

Maybe should upgrade helm dependency together #735

scbizu commented 6 months ago

LGTM , will merge it after v0.16.1 released.

MeurillonGuillaume commented 6 months ago

Thanks for the review @scbizu. Is there an ETA for v0.16.1?

scbizu commented 6 months ago

Sorry but currently has no ETA , still waiting for other maintainers . We will rc ASAP when we are ready for that .