Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Runs when this chart tree is the root of the GitHub repository (e.g. fluid-pub/chart-workload).

name: Helm chart CI

on:
pull_request:
push:
branches:
- main
- develop

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Helm
uses: azure/setup-helm@v4

- name: Helm lint
run: helm lint .
59 changes: 59 additions & 0 deletions .github/workflows/release-oci-on-semver-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Semver tags without `v` (e.g. 0.1.0). Tag must equal `version` in Chart.yaml.
name: Helm OCI release

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-*"

permissions:
contents: read
packages: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Helm
uses: azure/setup-helm@v4

- name: Verify tag matches Chart.yaml version
run: |
set -euo pipefail
TAG="${GITHUB_REF_NAME}"
CHART_LINE="$(grep -E '^version:[[:space:]]' Chart.yaml | head -1)"
CHART_VER="$(echo "$CHART_LINE" | sed -E 's/^version:[[:space:]]*//; s/[[:space:]]+#.*$//')"
CHART_VER="${CHART_VER%\"}"
CHART_VER="${CHART_VER#\"}"
CHART_VER="${CHART_VER%\'}"
CHART_VER="${CHART_VER#\'}"
CHART_VER="$(echo "$CHART_VER" | sed 's/[[:space:]]*$//')"
if [ "$TAG" != "$CHART_VER" ]; then
echo "::error::Git tag \"$TAG\" must equal Chart.yaml version field \"$CHART_VER\""
exit 1
fi
echo "Tag \"$TAG\" matches Chart.yaml version."

- name: Helm lint
run: helm lint .

- name: Package chart
run: helm package .

- name: Log in to GHCR (Helm OCI)
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u "${{ github.actor }}" --password-stdin

- name: Push chart to GHCR
run: |
set -euo pipefail
shopt -s nullglob
tgz=(./*.tgz)
if [ "${#tgz[@]}" -ne 1 ]; then
echo "::error::Expected exactly one packaged .tgz, got: ${tgz[*]:-none}"
exit 1
fi
helm push "${tgz[0]}" "oci://ghcr.io/${{ github.repository_owner }}/fluid-workload"
1 change: 0 additions & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ name: fluid-workload
description: Generic Helm chart for Fluid agents and probes
type: application
version: 0.1.0
appVersion: "0.1.0"
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Helm chart — fluid-workload

In the **`fluid`** monorepo this chart lives under `code/charts/fluid-workload/`; standalone Git (**`fluid-pub/chart-workload`**) uses the same layout at the repository root.

**Release (standalone repo)** — **`helm lint`** runs on PRs and `main` / `develop`; pushing a semver tag **without `v`** runs **`helm push … oci://ghcr.io/<GitHub-owner>/fluid-workload`** when the tag equals **`version`** in **`Chart.yaml`**.

**Install / pull from GHCR** — Helm OCI on GitHub stores the chart under a path that repeats the chart **`name:`** (see the package page `fluid-workload/fluid-workload`). Use **`--version`** with the full OCI prefix, for example:

```text
helm pull oci://ghcr.io/fluid-pub/fluid-workload/fluid-workload --version 0.1.0
```

or the equivalent tag form **`oci://ghcr.io/fluid-pub/fluid-workload/fluid-workload:0.1.0`**. The shorter reference **`oci://ghcr.io/fluid-pub/fluid-workload`** (without the second **`fluid-workload`**) does **not** resolve with **`helm pull` / `helm install`** against this registry layout.

Generic chart for **one** Fluid agent or probe image: ConfigMap-mounted YAML config, optional Secret-mounted credentials, extra env.

## Typical values
Expand Down
2 changes: 1 addition & 1 deletion templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
{{- end }}
containers:
- name: workload
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.service.enabled }}
ports:
Expand Down
1 change: 1 addition & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ workload:
# Label-only hint for selectors / docs (e.g. agent, probe)
kind: workload

# Example image; replace with your agent or probe image and tag at install time.
image:
repository: ghcr.io/fluid-pub/fluid-agent-example
tag: "0.1.0"
Expand Down
Loading