Skip to content

Commit

Permalink
feat: Add shared Helm cache, based on flock (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
yorik authored Sep 11, 2024
1 parent e4b5de5 commit 9459b5c
Show file tree
Hide file tree
Showing 7 changed files with 513 additions and 151 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ docker pull ghcr.io/doodlescheduling/flux-build:v2
| `--workers` | `WORKERS` | `Number of CPU cores` | Workers used to template the HelmReleases. Greatly improves speed if there are many HelmReleases |
| `--fail-fast` | `FAIL_FAST` | `false` | Exit early if an error occured |
| `--allow-failure` | `ALLOW_FAILURE` | `false` | Do not exit > 0 if an error occured |
| `--cache-enabled` | `CACHE_ENABLED` | `true` | Enable Helm charts cache |
| `--cache` | `CACHE` | `inmemory` | Type of Helm charts cache to use, options: `none`, `inmemory`, `fs`|
| `--cache-dir` | `CACHE_DIR` | `` | Directory for `fs` Helm charts cache |
| `--api-versions` | `API_VERSIONS` | `` | Kubernetes api versions used for Capabilities.APIVersions (See helm help) |
| `--kube-version` | `KUBE_VERSION` | `1.27.0` | Kubernetes version (Some helm charts validate manifests against a specific kubernetes version) |
| `--output` | `OUTPUT` | `/dev/stdout` | Path to output file |
Expand Down
6 changes: 3 additions & 3 deletions internal/action/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"

"github.com/doodlescheduling/flux-build/internal/build"
"github.com/doodlescheduling/flux-build/internal/cachemgr"
"github.com/doodlescheduling/flux-build/internal/worker"
helmv1 "github.com/fluxcd/helm-controller/api/v2beta1"
"github.com/go-logr/logr"
Expand All @@ -18,8 +19,7 @@ type Action struct {
AllowFailure bool
FailFast bool
Workers int
CacheDir string
CacheEnabled bool
Cache *cachemgr.Cache
Paths []string
APIVersions []string
IncludeHelmHooks bool
Expand Down Expand Up @@ -65,7 +65,7 @@ func (a *Action) Run(ctx context.Context) error {
APIVersions: a.APIVersions,
KubeVersion: a.KubeVersion,
IncludeHelmHooks: a.IncludeHelmHooks,
CacheEnabled: a.CacheEnabled,
Cache: a.Cache,
})

helmResultPool.Push(worker.Task(func(ctx context.Context) error {
Expand Down
Loading

0 comments on commit 9459b5c

Please sign in to comment.