Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
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
2 changes: 2 additions & 0 deletions .github/workflows/code-linting-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:

- run: "task lint:yml-check"

- run: "task lint:helm-check"

lint-cpp:
needs: "filter-relevant-changes"
if: >-
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ gersemi>=0.16.2
mypy>=1.12.0
ruff>=0.4.4
tombi>=0.4.35
yamale>=6.1.0
yamllint>=1.35.1

# Test dependencies
Expand Down
2 changes: 2 additions & 0 deletions taskfile.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version: "3"

set: ["pipefail"]

includes:
build: "taskfiles/build.yaml"
deps: "taskfiles/deps.yaml"
Expand Down
19 changes: 19 additions & 0 deletions taskfiles/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ tasks:

- task: "cmake-check"
- task: "cpp-check"
- task: "helm-check"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. xxx-check is an obsolete convention. The latest convention is to use check-xxx. For example check-rust. I am ok with both in this PR. @LinZhihao-723 Shall we create a cleanup PR after this one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, thanks for the catch, good to know

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually prefer check-xxx, as we should always use the latest convention when both exist.
fyi, Rust linting is called fix-rust and check-rust.

Comment thread
20001020ycx marked this conversation as resolved.
Resolved
- task: "py-check"
- task: "toml-check"
- task: "yml-check"
Expand All @@ -25,6 +26,7 @@ tasks:

- task: "cmake-fix"
- task: "cpp-fix"
- task: "helm-fix"
- task: "py-fix"
- task: "toml-fix"
- task: "yml-fix"
Expand Down Expand Up @@ -122,6 +124,23 @@ tasks:
- "{{.G_EXAMPLES_WOLF_DIR}}"
VENV_DIR: "{{.G_LINT_VENV_DIR}}"

helm:
aliases:
- "helm-check"
- "helm-fix"
deps:
- "toolchains:helm"
- "venv"
cmds:
- |-
. "{{.G_LINT_VENV_DIR}}/bin/activate"
. "{{.G_HELM_TOOLCHAIN_ENV_FILE}}"
ct lint \
--all \
--chart-dirs="tools/deployment" \
--chart-yaml-schema="{{.G_HELM_TOOLCHAIN_DIR}}/etc/chart_schema.yaml" \
--lint-conf="tools/yscope-dev-utils/exports/lint-configs/.yamllint.yml"

py-check:
cmds:
- task: "spider-py-check"
Expand Down
41 changes: 41 additions & 0 deletions taskfiles/toolchains.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
version: "3"

includes:
remote: "../tools/yscope-dev-utils/exports/taskfiles/utils/remote.yaml"
utils: "../tools/yscope-dev-utils/exports/taskfiles/utils/utils.yaml"

vars:
G_HELM_TOOLCHAIN_DIR: "{{.G_BUILD_DIR}}/toolchains/helm"
G_HELM_TOOLCHAIN_ENV_FILE: "{{.G_HELM_TOOLCHAIN_DIR}}/env"
G_RUST_TOOLCHAIN_DIR: "{{.G_BUILD_DIR}}/toolchains/rust"
G_RUST_TOOLCHAIN_ENV_FILE: "{{.G_RUST_TOOLCHAIN_DIR}}/env"

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

tasks:
helm:
vars:
CHART_TESTING_VERSION: "3.14.0"
HELM_VERSION: "v4.2.3"
run: "once"
cmds:
- "mkdir -p '{{.G_HELM_TOOLCHAIN_DIR}}'"
- task: "remote:download-and-extract-tar"
vars:
OUTPUT_DIR: "{{.G_HELM_TOOLCHAIN_DIR}}"
URL: "https://github.com/helm/chart-testing/releases/download/v{{.CHART_TESTING_VERSION}}\
/chart-testing_{{.CHART_TESTING_VERSION}}_{{OS}}_{{ARCH}}.tar.gz"
FILE_SHA256: >-
{{- if and (eq OS "linux") (eq ARCH "amd64") -}}
d16f0583616885423826241164ce1f6589c6fe5332fa74f374ebd2bd3cb3fe1f
{{- else if and (eq OS "linux") (eq ARCH "arm64") -}}
7b035bbbd0768fba33983e81c15445e33e9c8281d329100852a342ecfd0b16b7
{{- else if and (eq OS "darwin") (eq ARCH "arm64") -}}
db10dbbb42b110c7a5da5a3202908f32ad2ca6ad600d423426dc7886d09aad07
{{- else -}}
unsupported
{{- end }}
INCLUDE_PATTERNS: ["ct", "etc/chart_schema.yaml"]
NUM_COMPONENTS_TO_STRIP: "0"
- |-
export PATH="{{.G_HELM_TOOLCHAIN_DIR}}:$PATH"
export HELM_INSTALL_DIR="{{.G_HELM_TOOLCHAIN_DIR}}"
curl --proto "=https" --tlsv1.2 --silent --show-error --fail \
https://raw.githubusercontent.com/helm/helm/{{.HELM_VERSION}}/scripts/get-helm-4 \
| bash -s -- --no-sudo --version "{{.HELM_VERSION}}"

# Create an environment file to configure the custom Helm toolchain location.
- |-
cat <<"EOF" > "{{.G_HELM_TOOLCHAIN_ENV_FILE}}"
#!/bin/sh
export PATH="{{.G_HELM_TOOLCHAIN_DIR}}:$PATH"
EOF

rust:
# We use a label to uniquely identify this task and its checksum under `.task/checksums/`.
label: "toolchains-rust"
Expand Down
23 changes: 23 additions & 0 deletions tools/deployment/spider-helm/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.bzr/
.bzrignore
.git/
.gitignore
.hg/
.hgignore
.svn/
# Common backup files
*.bak
*.orig
*.swp
*.tmp
*~
# Various IDEs
*.tmproj
.idea/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For RustRover, we probably need to ignore target/.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, just dived a bit more on the .helmignore: this ignore file is controlling what files are put into the .tgz during helm package, the .tgz file is the artifact distributed to k8s user.

So, helm package only reads the chart directory and re-bundles its own files into a tarball — it compiles nothing and creates no target/ and no build/. So target/ is not, and never will be, a product of helm package.

I will just use the version inherited from the CLP package for consistency then.

.project
.vscode/
11 changes: 11 additions & 0 deletions tools/deployment/spider-helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: "v2"
name: "spider"
description: "A Helm chart for the Spider Huntsman deployment"
type: "application"
version: "0.1.0"
appVersion: "0.1.0"
home: "https://github.com/y-scope/spider"
sources: ["https://github.com/y-scope/spider"]
maintainers: [{name: "y-scope", email: "dev@yscope.com", url: "https://yscope.com"}]
keywords:
- "distributed-scheduler"
1 change: 1 addition & 0 deletions tools/deployment/spider-helm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading