Skip to content

Commit 2d7b044

Browse files
authored
Merge pull request #2 from ykulazhenkov/pr-initial-content
add initial repo content
2 parents a812f71 + 9b9010f commit 2d7b044

22 files changed

+1322
-1
lines changed

.github/workflows/on-pr.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: PR Validation
2+
3+
on:
4+
pull_request:
5+
branches: ["*"]
6+
7+
jobs:
8+
validate:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
- name: Run lint
14+
run: make lint
15+
- name: Validate Helm chart package
16+
run: make helm-package
17+
- name: Validate Helm chart template
18+
run: make template

.github/workflows/on-tag-push.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
# Chart-specific versioning tags: chart-name/version
7+
# Matches: spdk-csi-controller/v1.0.0, nfs-csi-controller/v0.1.0, etc.
8+
# Legacy tags (without chart name) are not supported
9+
- '*/v[0-9]+.[0-9]+.[0-9]+*'
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Log in to Container Registry
19+
uses: docker/login-action@v3
20+
with:
21+
registry: ghcr.io
22+
username: ${{ github.repository_owner }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Extract tag and set environment variables
26+
id: version
27+
run: |
28+
# Convert repository owner to lowercase to handle uppercase characters
29+
REPOSITORY=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
30+
31+
echo "REGISTRY=ghcr.io/${REPOSITORY}" >> $GITHUB_ENV
32+
TAG_FULL=${GITHUB_REF#refs/tags/}
33+
34+
# Extract chart name and version from tag (format: chart-name/version)
35+
CHART_NAME=$(echo "$TAG_FULL" | cut -d'/' -f1)
36+
CHART_VERSION=$(echo "$TAG_FULL" | cut -d'/' -f2)
37+
echo "CHART_NAME=${CHART_NAME}" >> $GITHUB_ENV
38+
echo "TAG=${CHART_VERSION}" >> $GITHUB_ENV
39+
echo "Chart release: $CHART_NAME version $CHART_VERSION"
40+
41+
- name: Validate chart exists
42+
run: |
43+
if [ ! -d "charts/${{ env.CHART_NAME }}" ]; then
44+
echo "Error: Chart '${{ env.CHART_NAME }}' does not exist"
45+
exit 1
46+
fi
47+
48+
- name: Run lint
49+
run: make lint-${{ env.CHART_NAME }}
50+
51+
- name: Package and push Helm chart
52+
run: make helm-push-${{ env.CHART_NAME }}

.gitignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Local tools and build directories
2+
bin/
3+
output/
4+
5+
# Temporary files
6+
*.tmp
7+
*.log
8+
9+
# Go related files (if any Go code is added)
10+
vendor/
11+
*.test
12+
*.out
13+
14+
# IDE/Editor files
15+
.vscode/
16+
.idea/
17+
*.swp
18+
*.swo
19+
*~
20+
21+
# OS generated files
22+
.DS_Store
23+
.DS_Store?
24+
._*
25+
.Spotlight-V100
26+
.Trashes
27+
ehthumbs.db
28+
Thumbs.db
29+
30+
# Git related
31+
*.orig
32+
33+
# Documentation build artifacts
34+
docs/_build/
35+
docs/.doctrees/
36+
37+
# CI/CD artifacts
38+
.github/workflows/artifacts/
39+
40+
# Development and testing
41+
.env
42+
.env.local
43+
.env.development
44+
.env.test
45+
.env.production
46+
47+
# Backup files
48+
*.bak
49+
*.backup

Makefile

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
#
2+
#Copyright 2025 NVIDIA
3+
#
4+
#Licensed under the Apache License, Version 2.0 (the "License");
5+
#you may not use this file except in compliance with the License.
6+
#You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
#Unless required by applicable law or agreed to in writing, software
11+
#distributed under the License is distributed on an "AS IS" BASIS,
12+
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
#See the License for the specific language governing permissions and
14+
#limitations under the License.
15+
16+
# Get the directory of this Makefile, regardless of where make was invoked
17+
PROJECT_DIR := $(shell cd $(dir $(lastword $(MAKEFILE_LIST))) && pwd -L)
18+
PROJECT_DIR := $(patsubst %/,%,$(PROJECT_DIR))
19+
20+
# Export is needed here so that the envsubst used in make targets has access to those variables even when they are not
21+
# explicitly set when calling make.
22+
export TAG ?= v0.0.1
23+
export REGISTRY ?= example.com
24+
25+
26+
# By default the helm registry is assumed to be an OCI registry.
27+
export HELM_REGISTRY ?= oci://$(REGISTRY)
28+
29+
# Chart configuration
30+
CHARTS_DIR = $(PROJECT_DIR)/charts
31+
CHARTS_OUTPUT_DIR = $(PROJECT_DIR)/output
32+
33+
# Detect architecture and platform
34+
TOOL_ARCH ?= $(shell uname -m)
35+
TOOL_OS ?= $(shell uname -s | tr A-Z a-z)
36+
37+
HELM_ARCH = $(TOOL_ARCH)
38+
ifeq ($(TOOL_ARCH),x86_64)
39+
HELM_ARCH = amd64
40+
else ifeq ($(TOOL_ARCH),aarch64)
41+
HELM_ARCH = arm64
42+
endif
43+
44+
# Tool versions
45+
HELM_VER ?= v3.18.3
46+
HELM_CM_PUSH_VERSION ?= 0.10.4
47+
48+
# Tool binaries
49+
TOOLSDIR = $(PROJECT_DIR)/bin
50+
HELM ?= $(TOOLSDIR)/helm-$(HELM_VER)
51+
52+
# Setting SHELL to bash allows bash commands to be executed by recipes.
53+
SHELL = /usr/bin/env bash -o pipefail
54+
.SHELLFLAGS = -ec
55+
56+
##@ General
57+
58+
.PHONY: help
59+
help: ## Display this help.
60+
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
61+
62+
$(TOOLSDIR) $(CHARTS_OUTPUT_DIR):
63+
@mkdir -p $@
64+
65+
##@ Tools
66+
67+
.PHONY: helm
68+
helm: $(HELM) ## Download helm locally if necessary.
69+
$(HELM): | $(TOOLSDIR)
70+
@echo "Installing helm-$(HELM_VER) to $(TOOLSDIR)"
71+
@curl -fsSL https://get.helm.sh/helm-$(HELM_VER)-$(TOOL_OS)-$(HELM_ARCH).tar.gz | tar -xzf - --no-same-owner -C $(TOOLSDIR) --strip-components=1
72+
@mv $(TOOLSDIR)/helm $(HELM)
73+
@chmod +x $(HELM)
74+
75+
.PHONY: helm-cm-push
76+
helm-cm-push: helm
77+
@$(HELM) plugin list | grep cm-push | grep $(HELM_CM_PUSH_VERSION) || \
78+
( \
79+
($(HELM) plugin uninstall cm-push || true) && \
80+
$(HELM) plugin install https://github.com/chartmuseum/helm-push --version $(HELM_CM_PUSH_VERSION) \
81+
)
82+
83+
##@ Helm
84+
85+
HELM_PUSH_CMD ?= $(shell if echo $(HELM_REGISTRY) | grep -q '^http'; then echo cm-push; else echo push; fi)
86+
87+
# Individual chart targets
88+
89+
# spdk-csi-controller chart
90+
.PHONY: helm-package-spdk-csi-controller
91+
helm-package-spdk-csi-controller: $(CHARTS_OUTPUT_DIR) helm ## Package spdk-csi-controller chart
92+
$(HELM) package $(CHARTS_DIR)/spdk-csi-controller --destination $(CHARTS_OUTPUT_DIR) --version $(TAG)
93+
94+
.PHONY: helm-push-spdk-csi-controller
95+
helm-push-spdk-csi-controller: helm-package-spdk-csi-controller helm-cm-push ## Package and push spdk-csi-controller chart
96+
$(HELM) $(HELM_PUSH_CMD) $(CHARTS_OUTPUT_DIR)/spdk-csi-controller-$(TAG).tgz $(HELM_REGISTRY)
97+
98+
.PHONY: lint-spdk-csi-controller
99+
lint-spdk-csi-controller: helm ## Run helm lint on spdk-csi-controller chart
100+
$(HELM) lint $(CHARTS_DIR)/spdk-csi-controller
101+
102+
.PHONY: template-spdk-csi-controller
103+
template-spdk-csi-controller: helm ## Run helm template on spdk-csi-controller chart
104+
$(HELM) template --set dpu.enabled=true $(CHARTS_DIR)/spdk-csi-controller
105+
$(HELM) template --set host.enabled=true --set host.config.dpuClusterSecret=test-secret $(CHARTS_DIR)/spdk-csi-controller
106+
107+
# nfs-csi-controller chart
108+
.PHONY: helm-package-nfs-csi-controller
109+
helm-package-nfs-csi-controller: $(CHARTS_OUTPUT_DIR) helm ## Package nfs-csi-controller chart
110+
$(HELM) package $(CHARTS_DIR)/nfs-csi-controller --destination $(CHARTS_OUTPUT_DIR) --version $(TAG)
111+
112+
.PHONY: helm-push-nfs-csi-controller
113+
helm-push-nfs-csi-controller: helm-package-nfs-csi-controller helm-cm-push ## Package and push nfs-csi-controller chart
114+
$(HELM) $(HELM_PUSH_CMD) $(CHARTS_OUTPUT_DIR)/nfs-csi-controller-$(TAG).tgz $(HELM_REGISTRY)
115+
116+
.PHONY: lint-nfs-csi-controller
117+
lint-nfs-csi-controller: helm ## Run helm lint on nfs-csi-controller chart
118+
$(HELM) lint $(CHARTS_DIR)/nfs-csi-controller
119+
120+
.PHONY: template-nfs-csi-controller
121+
template-nfs-csi-controller: helm ## Run helm template on nfs-csi-controller chart
122+
$(HELM) template --set dpu.enabled=true $(CHARTS_DIR)/nfs-csi-controller
123+
$(HELM) template --set host.enabled=true --set host.config.dpuClusterSecret=test-secret $(CHARTS_DIR)/nfs-csi-controller
124+
125+
126+
.PHONY: helm-package
127+
helm-package: helm-package-spdk-csi-controller helm-package-nfs-csi-controller ## Package all helm charts
128+
129+
.PHONY: helm-push
130+
helm-push: helm-push-spdk-csi-controller helm-push-nfs-csi-controller ## Push all helm charts
131+
132+
.PHONY: lint
133+
lint: lint-spdk-csi-controller lint-nfs-csi-controller ## Run helm lint to validate all charts
134+
135+
.PHONY: template
136+
template: template-spdk-csi-controller template-nfs-csi-controller ## Run helm template to generate all charts
137+
138+
.PHONY: clean
139+
clean: ## Clean generated files
140+
@rm -rf $(CHARTS_OUTPUT_DIR)
141+
@rm -rf $(TOOLSDIR)

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1-
# dpf-storage-vendors-charts
1+
# DPF Storage Vendors Charts
2+
3+
This repository contains Helm charts for example Storage Vendor CSI controllers for [NVIDIA DOCA Platform](https://github.com/NVIDIA/doca-platform).
4+
5+
## Available Charts
6+
7+
### spdk-csi-controller
8+
9+
A specialized deployment of the SPDK-CSI controller for DPF clusters.
10+
11+
**Location:** `charts/spdk-csi-controller/`
12+
13+
### nfs-csi-controller
14+
15+
A specialized deployment of the NFS-CSI controller for DPF clusters.
16+
17+
**Location:** `charts/nfs-csi-controller/`
18+
19+
20+
**Note:** These charts are designed for use with the [NVIDIA DOCA Platform](https://github.com/NVIDIA/doca-platform) and are not intended for general Kubernetes clusters.
21+
22+
**Disclaimer:** These charts are provided as examples and are not intended for production environments.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: nfs-csi-controller
3+
description: A Helm chart for NFS CSI controller
4+
type: application
5+
version: 0.0.1
6+
appVersion: "0.0.1"
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "nfs-csi-controller.name" -}}
5+
{{- default "nfs-csi-controller" .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "nfs-csi-controller.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default "nfs-csi-controller" .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "nfs-csi-controller.chart" -}}
30+
{{- printf "%s-%s" "nfs-csi-controller" .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "nfs-csi-controller.labels" -}}
37+
helm.sh/chart: {{ include "nfs-csi-controller.chart" . }}
38+
{{ include "nfs-csi-controller.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "nfs-csi-controller.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "nfs-csi-controller.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.dpu.enabled }}
2+
apiVersion: storage.k8s.io/v1
3+
kind: CSIDriver
4+
metadata:
5+
name: nfs.csi.k8s.io
6+
labels:
7+
{{- include "nfs-csi-controller.labels" . | nindent 4 }}
8+
spec:
9+
attachRequired: false
10+
volumeLifecycleModes:
11+
- Persistent
12+
fsGroupPolicy: File
13+
{{- end }}

0 commit comments

Comments
 (0)