[helm] Restructure helm chart of Fluss#2871
Conversation
|
@affo Can you review for me? |
|
@swuferhong can you review for me? |
# Conflicts: # helm/values.yaml # Conflicts: # helm/templates/sts-coordinator.yaml # helm/templates/sts-tablet.yaml # helm/values.yaml
affo
left a comment
There was a problem hiding this comment.
I left some punctual comments 🤝
I think this PR tries to do 2 tasks:
- refactor values
- enforce schema on values.
I suggest to now let #2870 land before refactoring the values, and later address any remaining change that you want to address.
I think this PR should be only dedicated to task 2 🤝
About that, I don't exactly get why we have the Python script, as I think helm should directly pickup the values.schema.json for validation.
Maintaining the schema itself will be very hard, hence I suggest to lean for an helm plugin such as https://github.com/dadav/helm-schema for auto-generating the schema.
We can add a CI step such as:
- name: Check schema is up to date
run: |
helm schema --dry-run > /tmp/generated-schema.json
diff helm/values.schema.json /tmp/generated-schema.jsonto verify that the schema is up-to-date.
At this point, values should be turned into something like this for helm-schema to work:
# @schema
# type: integer
# minimum: 1
# @schema
# Number of coordinator replicas
coordinatorServer:
replicas: 1
# @schema
# type: object
# additionalProperties: false
# @schema
persistence:
# @schema
# type: boolean
# @schema
enabled: false
# @schema
# type: string
# pattern: ^[0-9]+(Gi|Ti)$
# @schema
size: 8Gi
# @schema
# type: string
# @schema
storageClass: ""For the x-docsSection property and to enforce all properties are active, we can just create a plain python script to validate they exist:
# Instead of a meta-schema, just validate the rules explicitly
for prop, schema in values_schema["properties"].items():
assert "description" in schema, f"{prop} missing description"
assert "default" in schema, f"{prop} missing default"
assert "x-docsSection" in schema, f"{prop} missing x-docsSection"No dependency, just validating the schema and easier to reason about than a schema validating a schema 🤝
In any case, I would bootstrap this without x-docsSection.
I would separate that into another PR to address automatic documentation generation 🤝
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" |
There was a problem hiding this comment.
| python-version: "3.11" | |
| python-version: "3.12" |
Just better to point to that one if we don't break anything
There was a problem hiding this comment.
I want to unify the Python version with .github/workflows/unstable-test-reporter.yaml
.github/workflows/helm-chart.yaml
Outdated
| python-version: "3.11" | ||
|
|
||
| - name: Install dependencies | ||
| run: pip install jsonschema==4.26.0 PyYAML==6.0.3 |
There was a problem hiding this comment.
I would favor a requirements.txt under tools/ci/helm_ci.
It would make it easier to validate locally.
The command would become pip install -r tools/ci/helm_ci/requirements.txt
.github/workflows/helm-chart.yaml
Outdated
| - name: Install dependencies | ||
| run: pip install jsonschema==4.26.0 PyYAML==6.0.3 | ||
|
|
||
| - name: Run unstable test reporter |
There was a problem hiding this comment.
| - name: Run unstable test reporter | |
| - name: Validate values |
| @@ -0,0 +1,89 @@ | |||
| # Licensed to the Apache Software Foundation (ASF) under one | |||
There was a problem hiding this comment.
Why do we need this script ?
Isn't helm lint already picking values.schema.json for validation?
Is this only for the meta schema?
There was a problem hiding this comment.
@affo, from my side, when everyone updated helm. Could they please explain why it needs to be updated and describe the changes in the schema?
For example:

|
@nhuantho by the way, thanks for the contribution and to light the spotlight on this defect 🤝 |
|
@nhuantho as a side note, one can already structure schema annotations by adding comments prefixed with |
|
@affo, I will answer some confusion:
Focus pr:
|
Purpose
Linked issue: close #2865
Brief change log
values.yamlvalues.schema.json: schema ofvalues.yamland standard to validvalue.yaml.values.schema.schema.json: schema ofvalues.schema.jsonand standard to validvalues.schema.json.tools/ci/helm_ci/validate_helm.pyto validate helm..gitignoreTests
API and Format
Documentation