Extremely slow cloning when using large SemVer range
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- go
- 領域
- performance
調査の方向性
まず fluxcd/pkg/git のクローン処理のコードを読み、Issue に記載されている ImagePolicies のタグ抽出の動作と、大きな SemVer 範囲の処理方法を比較します。大きな範囲と報告されている少ないタグ数を使用する GitRepository で不一致を再現し、その後 source-controller の CPU 使用率をプロファイルします。完了条件は、GitRepositories の SemVer パターン抽出をサポートするか、範囲比較のボトルネックを特定して解消することです。
索引モデルが issue の本文から書いたものです。
説明
Some info to set the stage:
- We use a monorepo style structure
GitRepositoriesdo not support parsing and extracting tags likeImagePolicies- you can parse+extract SemVer in OCI tags like
my-app-v1.2.3=>1.2.3 - you must use exclusively plain SemVer tags for
GitRepositories
- you can parse+extract SemVer in OCI tags like
- To get around this deficiency, we've allocated chunks of major SemVer git tags to projects in the repo.
- project-1 gets 0.0.0 -> 999999.x.x
- project-2 gets 1000000.0.0 -> 1999999.x.x
- ...
This means when a team wants to deploy a dev version of kustomizations that control their app, it ends up looking something like this:
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: project-1-dev
namespace: flux-system
spec:
interval: 1m0s
ref:
semver: '>=1000000 <2000000'
secretRef:
name: example-ssh-key
url: ssh://[email protected]/owner/monorepo.git
This has been working very well for a long time, but there is a huge performance problem when the SemVar range is that big. I want to be clear, projects do not actually use that many tags (as writing, the most I see is ~60 majors).
Here is a graph of the enormous performance discrepancy:
In the graph you can see that dev cloning is 50-75x slower and this project in particular only has 49 tags. On top of this it also causes relatively high CPU usage from the source-controller pod.
Potential solutions (in order of preference)
- Allow SemVer pattern extractions like
ImagePolicies. This way we don't have to (ab)use git tags like this. - Figure out why it takes so long to compare SemVer tags. I looked around in fluxcd/pkg/git but nothing in the cloning code stood out to me.
- 主要言語
- Go
- スター
- 283
- フォーク
- 258
- 平均マージ
- 1日 17時間
- マージ済み PR(30日)
- 15
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fluxcd/source-controller のほかの issue
-
Improve documentation on debugging the controller locally再び着手できるかも @Bryandero98 が 28 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンarea/docs good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
fluxcd/source-controller#666 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
area/oci enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
fluxcd/source-controller#2180 ·
メンテナーはふだん 1 日以内に返信
-
`OCIRepository`/cosign verification: support TSA-only trusted roots (no transparency log) for private Sigstore instances like GitHub Artifact Attestations対応中かも @stealthybox が 142 日前に担当しました。 オープンarea/oci area/security enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
fluxcd/source-controller#2167 · コメント 4 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
fluxcd/source-controller#2150 ·
メンテナーはふだん 1 日以内に返信
-
GitRepository `.spec.ref.commit` + `.spec.ref.branch` does not shallow clone, contrary to the docsオープン
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
fluxcd/source-controller#2146 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
fluxcd/source-controller の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
SAP/crossplane-provider-btp#1118 ·
メンテナーはふだん 1 日以内に返信
-
benchmark: `make setup` fails because audit-exporter builds with Go 1.25.0 while go.mod requires 1.26.0対応中かも @xsvm が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
volcano-sh/volcano#6097 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Bedrock invoke-with-response-stream reports `stop_reason: "end_turn"` for tool-use turnsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信