Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a helm chart package #594

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
7 changes: 4 additions & 3 deletions .azure/pipelines/azure-pipelines-external-release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
######################################
# NOTE: Before running this pipeline to generate a new nuget package, update the version string in two places
# NOTE: Before running this pipeline to generate a new nuget package, update the version string in three places
# 1) update the name: string below (line 6) -- this is the version for the nuget package (e.g. 1.0.0)
# 2) update \libs\host\GarnetServer.cs readonly string version (~line 53) -- NOTE - these two values need to be the same
# 2) update \libs\host\GarnetServer.cs readonly string version (~line 53) -- NOTE - these two values need to be the same
# 3) update \charts\garnet\Chart.yaml (~line 5 & 6) and generate \charts\garnet\README.md with helm-docs.
######################################
name: 1.0.24
trigger:
Expand Down Expand Up @@ -195,4 +196,4 @@ jobs:
command: push
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: GarnetADO_to_Nuget
publishFeedCredentials: GarnetADO_to_Nuget
56 changes: 56 additions & 0 deletions .github/workflows/helm-chart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
on:
push:
branches:
- main
paths:
- 'charts/**'

permissions:
packages: write

jobs:
helm-chart:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"

- name: Install helm
uses: azure/setup-helm@v4
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Helm lint and package
run: |
mkdir .cr-release-packages
for chart in $(find charts -depth 1 -type d); do
if [ -z "${chart:-}" ]; then
break
fi
helm lint "${chart}"
helm package "${chart}" --dependency-update --destination .cr-release-packages
done

- name: Login to GHCR
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
echo "$GITHUB_TOKEN" | helm registry login ghcr.io --username "$GITHUB_ACTOR" --password-stdin

- name: Push charts to GHCR
run: |
shopt -s nullglob
for pkg in .cr-release-packages/*.tgz; do
if [ -z "${pkg:-}" ]; then
break
fi
helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/helm-charts"
done

17 changes: 17 additions & 0 deletions charts/garnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@ A Helm chart for Microsoft garnet

* <https://github.com/microsoft/garnet.git>

## Usage

[Helm](https://helm.sh) must be installed to use the charts. Please refer to
Helm's [documentation](https://helm.sh/docs) to get started.

To install the garnet chart (using an OCI-based registry):

```sh
helm upgrade --install garnet oci://ghcr.io/microsoft/helm-charts/garnet --version <version>
```

To uninstall the chart:

```sh
helm delete garnet
```

## Values

| Key | Type | Default | Description |
Expand Down
35 changes: 35 additions & 0 deletions charts/garnet/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.badgesSection" . }}

{{ template "chart.description" . }}

{{ template "chart.homepageLine" . }}

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourcesSection" . }}

## Usage

[Helm](https://helm.sh) must be installed to use the charts. Please refer to
Helm's [documentation](https://helm.sh/docs) to get started.

To install the garnet chart (using an OCI-based registry):

```sh
helm upgrade --install garnet oci://ghcr.io/microsoft/helm-charts/garnet --version <version>
```

To uninstall the chart:

```sh
helm delete garnet
```

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}

{{ template "helm-docs.versionFooter" . }}
3 changes: 2 additions & 1 deletion libs/host/GarnetServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public class GarnetServer : IDisposable
/// </summary>
protected StoreWrapper storeWrapper;

// IMPORTANT: Keep the version in sync with .azure\pipelines\azure-pipelines-external-release.yml line ~6.
// IMPORTANT: Keep the version in sync with .azure\pipelines\azure-pipelines-external-release.yml line ~6,
// charts\garnet\Chart.yaml line ~6 and increment line ~5 and generate charts\garnet\README.md with helm-docs.
readonly string version = "1.0.24";

/// <summary>
Expand Down