Skip to content

Commit 1bbb996

Browse files
authored
build(helm): Set up Spider Huntsman Helm chart scaffolding and linting. (#383)
1 parent 7e4ada4 commit 1bbb996

8 files changed

Lines changed: 100 additions & 0 deletions

File tree

.github/workflows/code-linting-checks.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
steps:
3939
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
4040
with:
41+
fetch-depth: 0
4142
submodules: "recursive"
4243

4344
- uses: "./tools/yscope-dev-utils/exports/github/actions/install-python"
@@ -53,6 +54,8 @@ jobs:
5354

5455
- run: "task lint:yml-check"
5556

57+
- run: "task lint:check-helm"
58+
5659
lint-cpp:
5760
needs: "filter-relevant-changes"
5861
if: >-

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ gersemi>=0.16.2
88
mypy>=1.12.0
99
ruff>=0.4.4
1010
tombi>=0.4.35
11+
yamale>=6.1.0
1112
yamllint>=1.35.1
1213

1314
# Test dependencies

taskfile.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
version: "3"
22

3+
set: ["pipefail"]
4+
35
includes:
46
build: "taskfiles/build.yaml"
57
deps: "taskfiles/deps.yaml"

taskfiles/lint.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ tasks:
1515

1616
- task: "cmake-check"
1717
- task: "cpp-check"
18+
- task: "check-helm"
1819
- task: "py-check"
1920
- task: "toml-check"
2021
- task: "yml-check"
@@ -25,6 +26,7 @@ tasks:
2526

2627
- task: "cmake-fix"
2728
- task: "cpp-fix"
29+
- task: "fix-helm"
2830
- task: "py-fix"
2931
- task: "toml-fix"
3032
- task: "yml-fix"
@@ -122,6 +124,22 @@ tasks:
122124
- "{{.G_EXAMPLES_WOLF_DIR}}"
123125
VENV_DIR: "{{.G_LINT_VENV_DIR}}"
124126

127+
helm:
128+
aliases:
129+
- "check-helm"
130+
- "fix-helm"
131+
deps:
132+
- "toolchains:helm"
133+
- "venv"
134+
cmds:
135+
- |-
136+
. "{{.G_LINT_VENV_DIR}}/bin/activate"
137+
. "{{.G_HELM_TOOLCHAIN_ENV_FILE}}"
138+
ct lint \
139+
--chart-dirs="tools/deployment" \
140+
--chart-yaml-schema="{{.G_HELM_TOOLCHAIN_DIR}}/etc/chart_schema.yaml" \
141+
--lint-conf="tools/yscope-dev-utils/exports/lint-configs/.yamllint.yml"
142+
125143
py-check:
126144
cmds:
127145
- task: "spider-py-check"

taskfiles/toolchains.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
version: "3"
22

33
includes:
4+
remote: "../tools/yscope-dev-utils/exports/taskfiles/utils/remote.yaml"
45
utils: "../tools/yscope-dev-utils/exports/taskfiles/utils/utils.yaml"
56

67
vars:
8+
G_HELM_TOOLCHAIN_DIR: "{{.G_BUILD_DIR}}/toolchains/helm"
9+
G_HELM_TOOLCHAIN_ENV_FILE: "{{.G_HELM_TOOLCHAIN_DIR}}/env"
710
G_RUST_TOOLCHAIN_DIR: "{{.G_BUILD_DIR}}/toolchains/rust"
811
G_RUST_TOOLCHAIN_ENV_FILE: "{{.G_RUST_TOOLCHAIN_DIR}}/env"
912

@@ -15,6 +18,44 @@ vars:
1518
G_RUST_TOOLCHAIN_CHECKSUM_FILE: "{{.G_BUILD_DIR}}/toolchains-rust.md5"
1619

1720
tasks:
21+
helm:
22+
vars:
23+
CHART_TESTING_VERSION: "3.14.0"
24+
HELM_VERSION: "v4.2.3"
25+
run: "once"
26+
cmds:
27+
- "mkdir -p '{{.G_HELM_TOOLCHAIN_DIR}}'"
28+
- task: "remote:download-and-extract-tar"
29+
vars:
30+
OUTPUT_DIR: "{{.G_HELM_TOOLCHAIN_DIR}}"
31+
URL: "https://github.com/helm/chart-testing/releases/download/v{{.CHART_TESTING_VERSION}}\
32+
/chart-testing_{{.CHART_TESTING_VERSION}}_{{OS}}_{{ARCH}}.tar.gz"
33+
FILE_SHA256: >-
34+
{{- if and (eq OS "linux") (eq ARCH "amd64") -}}
35+
d16f0583616885423826241164ce1f6589c6fe5332fa74f374ebd2bd3cb3fe1f
36+
{{- else if and (eq OS "linux") (eq ARCH "arm64") -}}
37+
7b035bbbd0768fba33983e81c15445e33e9c8281d329100852a342ecfd0b16b7
38+
{{- else if and (eq OS "darwin") (eq ARCH "arm64") -}}
39+
db10dbbb42b110c7a5da5a3202908f32ad2ca6ad600d423426dc7886d09aad07
40+
{{- else -}}
41+
unsupported
42+
{{- end }}
43+
INCLUDE_PATTERNS: ["ct", "etc/chart_schema.yaml"]
44+
NUM_COMPONENTS_TO_STRIP: "0"
45+
- |-
46+
export PATH="{{.G_HELM_TOOLCHAIN_DIR}}:$PATH"
47+
export HELM_INSTALL_DIR="{{.G_HELM_TOOLCHAIN_DIR}}"
48+
curl --proto "=https" --tlsv1.2 --silent --show-error --fail \
49+
https://raw.githubusercontent.com/helm/helm/{{.HELM_VERSION}}/scripts/get-helm-4 \
50+
| bash -s -- --no-sudo --version "{{.HELM_VERSION}}"
51+
52+
# Create an environment file to configure the custom Helm toolchain location.
53+
- |-
54+
cat <<"EOF" > "{{.G_HELM_TOOLCHAIN_ENV_FILE}}"
55+
#!/bin/sh
56+
export PATH="{{.G_HELM_TOOLCHAIN_DIR}}:$PATH"
57+
EOF
58+
1859
rust:
1960
# We use a label to uniquely identify this task and its checksum under `.task/checksums/`.
2061
label: "toolchains-rust"
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+
.bzr/
7+
.bzrignore
8+
.git/
9+
.gitignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.bak
15+
*.orig
16+
*.swp
17+
*.tmp
18+
*~
19+
# Various IDEs
20+
*.tmproj
21+
.idea/
22+
.project
23+
.vscode/
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: "v2"
2+
name: "spider"
3+
description: "A Helm chart for the Spider Huntsman deployment"
4+
type: "application"
5+
version: "0.1.0"
6+
appVersion: "0.1.0"
7+
home: "https://github.com/y-scope/spider"
8+
sources: ["https://github.com/y-scope/spider"]
9+
maintainers: [{name: "y-scope", email: "dev@yscope.com", url: "https://yscope.com"}]
10+
keywords:
11+
- "distributed-scheduler"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)