Skip to content

Commit e867300

Browse files
committed
Merge remote-tracking branch 'upstream/main' into feature/jsc-92-ef-adr
2 parents 6970538 + 497b499 commit e867300

311 files changed

Lines changed: 22114 additions & 2563 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ updates:
4141
- "/health-monitors/slurm-drain-monitor"
4242
- "/health-monitors/syslog-health-monitor"
4343
- "/janitor"
44+
- "/lifecycle-manager"
4445
- "/janitor-provider"
4546
- "/labeler"
4647
- "/metadata-collector"

.github/workflows/cleanup-untagged-images.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
- nvsentinel/log-collector
8080
- nvsentinel/file-server-cleanup
8181
- nvsentinel/janitor
82+
- nvsentinel/lifecycle-manager
8283
- nvsentinel/health-events-analyzer
8384
- nvsentinel/maintenance-notifier
8485
- nvsentinel/event-exporter

.github/workflows/container-build-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ jobs:
145145
path: .
146146
- module: preflight
147147
path: .
148+
- module: lifecycle-manager
149+
path: .
148150
steps:
149151
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
150152

.github/workflows/e2e-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
uses: ./.github/actions/setup-ci-env
108108

109109
- name: Set up Docker Buildx
110-
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
110+
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
111111

112112
- name: Prep system for multi-node Kind cluster
113113
run: |

.github/workflows/fern-docs-preview-build.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,27 @@ jobs:
6969
if git show-ref --verify --quiet "refs/tags/${version}"; then
7070
mkdir -p "fern/versions/${version}-content"
7171
git archive "refs/tags/${version}" -- docs/ | tar -x --strip-components=1 -C "fern/versions/${version}-content"
72-
find "fern/versions/${version}-content" -name '*.md' -print0 | xargs -0 -r sed -i \
73-
-e 's/{/\\{/g' \
74-
-e 's/}/\\}/g' \
75-
-e 's/</\&lt;/g'
72+
# Escape {, }, < for MDX — but only outside fenced code blocks and inline code spans
73+
find "fern/versions/${version}-content" -name '*.md' -print0 | while IFS= read -r -d '' f; do
74+
awk '
75+
/^````*/ || /^~~~~*/ { fence = !fence; print; next }
76+
fence { print; next }
77+
{
78+
n = split($0, p, "`")
79+
out = ""
80+
for (i = 1; i <= n; i++) {
81+
if (i % 2 == 1) {
82+
gsub(/{/, "\\{", p[i])
83+
gsub(/}/, "\\}", p[i])
84+
gsub(/</, "\\&lt;", p[i])
85+
}
86+
out = out p[i]
87+
if (i < n) out = out "`"
88+
}
89+
print out
90+
}
91+
' "$f" > "${f}.tmp" && mv "${f}.tmp" "$f"
92+
done
7693
echo "Extracted docs from $version"
7794
else
7895
echo "::warning::Tag $version not found — skipping content checkout"

.github/workflows/lint-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ jobs:
179179
- node-drainer
180180
- fault-remediation
181181
- janitor
182+
- lifecycle-manager
182183
- preflight
183184
- tests
184185
steps:

.github/workflows/publish-fern-docs.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,27 @@ jobs:
164164
if git show-ref --verify --quiet "refs/tags/${version}"; then
165165
mkdir -p "fern/versions/${version}-content"
166166
git archive "refs/tags/${version}" -- docs/ | tar -x --strip-components=1 -C "fern/versions/${version}-content"
167-
find "fern/versions/${version}-content" -name '*.md' -print0 | xargs -0 -r sed -i \
168-
-e 's/{/\\{/g' \
169-
-e 's/}/\\}/g' \
170-
-e 's/</\&lt;/g'
167+
# Escape {, }, < for MDX — but only outside fenced code blocks and inline code spans
168+
find "fern/versions/${version}-content" -name '*.md' -print0 | while IFS= read -r -d '' f; do
169+
awk '
170+
/^````*/ || /^~~~~*/ { fence = !fence; print; next }
171+
fence { print; next }
172+
{
173+
n = split($0, p, "`")
174+
out = ""
175+
for (i = 1; i <= n; i++) {
176+
if (i % 2 == 1) {
177+
gsub(/{/, "\\{", p[i])
178+
gsub(/}/, "\\}", p[i])
179+
gsub(/</, "\\&lt;", p[i])
180+
}
181+
out = out p[i]
182+
if (i < n) out = out "`"
183+
}
184+
print out
185+
}
186+
' "$f" > "${f}.tmp" && mv "${f}.tmp" "$f"
187+
done
171188
echo "Extracted docs from $version"
172189
else
173190
echo "::error::Tag $version not found — cannot pin frozen docs content"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,3 +450,7 @@ tests/scale-tests/results/*.csv
450450
tests/scale-tests/cmd/fqm-scale-test/results/
451451
preflight-checks/dcgm-diag/dcgm-diag
452452
preflight/preflight
453+
454+
# Build output of tilt/simple-health-client (an 18MB binary that sits next to its
455+
# own source, so a bare `git add tilt/` would stage it).
456+
/tilt/simple-health-client/simple-health-client

.ko.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,3 +288,20 @@ builds:
288288
org.opencontainers.image.version: "{{.Env.VERSION}}"
289289
org.opencontainers.image.revision: "{{.Env.GIT_COMMIT}}"
290290
org.opencontainers.image.created: "{{.Env.BUILD_DATE}}"
291+
292+
- id: lifecycle-manager
293+
dir: lifecycle-manager
294+
main: .
295+
ldflags:
296+
- "-s -w"
297+
- "-X main.version={{.Env.VERSION}} -X main.commit={{.Env.GIT_COMMIT}} -X main.date={{.Env.BUILD_DATE}}"
298+
annotations:
299+
org.opencontainers.image.description: "Lifecycle manager controller for NVSentinel"
300+
labels:
301+
org.opencontainers.image.source: "https://github.com/nvidia/nvsentinel"
302+
org.opencontainers.image.licenses: "Apache-2.0"
303+
org.opencontainers.image.title: "NVSentinel Lifecycle Manager"
304+
org.opencontainers.image.description: "Lifecycle manager for GPU node validation and maintenance in NVSentinel"
305+
org.opencontainers.image.version: "{{.Env.VERSION}}"
306+
org.opencontainers.image.revision: "{{.Env.GIT_COMMIT}}"
307+
org.opencontainers.image.created: "{{.Env.BUILD_DATE}}"

Makefile

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ GO_MODULES := \
5151
node-drainer \
5252
fault-remediation \
5353
janitor \
54+
lifecycle-manager \
5455
metadata-collector \
5556
event-exporter \
5657
store-client \
@@ -79,7 +80,8 @@ PRIVATE_MODULES := \
7980
# Modules requiring kubebuilder for tests
8081
KUBEBUILDER_MODULES := \
8182
node-drainer \
82-
fault-remediation
83+
fault-remediation \
84+
lifecycle-manager
8385

8486
# Default target
8587
.PHONY: all
@@ -455,6 +457,11 @@ lint-test-janitor:
455457
@echo "Linting and testing janitor (using standardized Makefile)..."
456458
$(MAKE) -C janitor lint-test
457459

460+
.PHONY: lint-test-lifecycle-manager
461+
lint-test-lifecycle-manager:
462+
@echo "Linting and testing lifecycle-manager (using standardized Makefile)..."
463+
$(MAKE) -C lifecycle-manager lint-test
464+
458465
.PHONY: lint-test-store-client
459466
lint-test-store-client:
460467
@echo "Linting and testing store-client..."
@@ -485,6 +492,12 @@ kubernetes-distro-lint:
485492
$(MAKE) -C distros/kubernetes lint
486493

487494
# Helm chart validation
495+
# Subcharts that cannot render standalone: they reference umbrella helpers or
496+
# globals that only exist when rendered as part of the parent chart.
497+
UMBRELLA_ONLY_CHARTS := csp-health-monitor event-exporter fault-quarantine \
498+
fault-remediation health-events-analyzer mongodb-store \
499+
node-drainer
500+
488501
.PHONY: helm-lint
489502
helm-lint:
490503
@echo "🎯 Validating Helm charts..."
@@ -501,17 +514,38 @@ helm-lint:
501514
@echo ""
502515
@# Individual component charts
503516
@echo "Validating component charts..."
517+
@# Recipes run under /bin/sh, so this uses [ rather than [[.
518+
@# UMBRELLA_ONLY_CHARTS reference umbrella helpers (for example
519+
@# nvsentinel.mongodb.certVolume) or umbrella globals, so they cannot render
520+
@# standalone. They are skipped by name and reported, rather than being
521+
@# silently included in a success message they did not earn. They are still
522+
@# covered by the umbrella lint above and by helm-test.
504523
@for chart_dir in distros/kubernetes/nvsentinel/charts/*/; do \
505-
if [[ -f "$$chart_dir/Chart.yaml" ]]; then \
524+
if [ -f "$$chart_dir/Chart.yaml" ]; then \
506525
chart_name=$$(basename "$$chart_dir"); \
526+
case " $(UMBRELLA_ONLY_CHARTS) " in \
527+
*" $$chart_name "*) \
528+
echo "Skipping $$chart_name (needs umbrella context)"; \
529+
continue;; \
530+
esac; \
507531
echo "Validating chart: $$chart_name"; \
508532
helm lint "$$chart_dir" -f distros/kubernetes/nvsentinel/values.yaml || exit 1; \
509533
echo "Testing template rendering for: $$chart_name"; \
510534
helm template "$$chart_name" "$$chart_dir" -f distros/kubernetes/nvsentinel/values.yaml >/dev/null || exit 1; \
511535
echo ""; \
512536
fi; \
513537
done
514-
@echo "✅ All Helm charts validated successfully"
538+
@# The charts in UMBRELLA_ONLY_CHARTS ship disabled, so neither the parent
539+
@# lint above (which renders defaults) nor the loop above exercises them.
540+
@# Render once with every dependency condition turned on so they are
541+
@# validated with the parent chart context they need. The conditions are
542+
@# read from Chart.yaml so a newly added chart is picked up automatically.
543+
@echo "Validating disabled-by-default charts with full context..."
544+
helm template nvsentinel distros/kubernetes/nvsentinel \
545+
$$(grep -oE 'condition: *[a-zA-Z0-9_.]+' distros/kubernetes/nvsentinel/Chart.yaml \
546+
| awk '{print "--set "$$2"=true"}' | tr '\n' ' ') >/dev/null
547+
@echo ""
548+
@echo "✅ Parent chart, standalone-renderable component charts, and all charts with every dependency enabled validated"
515549

516550
# Helm chart unit tests
517551
.PHONY: helm-test
@@ -521,8 +555,17 @@ helm-test:
521555
echo "❌ Error: helm-unittest plugin not found. Install with: helm plugin install https://github.com/helm-unittest/helm-unittest"; \
522556
exit 1; \
523557
fi
558+
@# The umbrella's own suite covers the cross-chart consistency checks, which
559+
@# no subchart can see. --with-subchart=false because the subchart suites
560+
@# address their templates by chart-relative path and are run separately
561+
@# below.
562+
@if [ -d "distros/kubernetes/nvsentinel/tests" ]; then \
563+
echo "Running unit tests for chart: nvsentinel (umbrella)"; \
564+
helm unittest --with-subchart=false distros/kubernetes/nvsentinel || exit 1; \
565+
echo ""; \
566+
fi
524567
@for chart_dir in distros/kubernetes/nvsentinel/charts/*/; do \
525-
if [[ -d "$$chart_dir/tests" ]]; then \
568+
if [ -d "$$chart_dir/tests" ]; then \
526569
chart_name=$$(basename "$$chart_dir"); \
527570
echo "Running unit tests for chart: $$chart_name"; \
528571
helm unittest "$$chart_dir" || exit 1; \

0 commit comments

Comments
 (0)