-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Helm): Add JSON schema for values.yaml
validation
#3588
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Ah damn, looks like this sort of composing is actually not supported: helm/helm#10481 That's a shame. |
I like how currently the docs are split into sections: https://loculus.org/reference/helm-chart-config/ and I thought I could replicate that with using multiple files as sources - I guess I can't. |
Does the schema JSON schema support arbitrary additional properties in some way? If so we could add "docs_category" or something ? |
A quick search showed that it should be possible! That's a great idea! |
The schema should include that the pipeline version starts at v1: #3534 (comment) (thanks Cornelius!) |
Maybe it would also be nice to have a few example yamls of stuff that users might want to configure, and then we can also lint/validate those? |
In an effort to maybe extract examples and look further into which properties are required, I'm going to look into untangling our huge values.yaml into a minimal set of sensible defaults, and a more "example"-specific part that can be applied on top of the actual defaults. |
I think one can make a case for making the |
True! I think there should be as many defaults as possible, and all switches etc should have a sensible default state. But exactly the actual "content" (i.e. organisms) and other instance specific defaults I think should be in there. Example:
These default values are also currently undocumented - I think rather than documenting them, it'd make sense to not have them, since they are instance specific and do not make sense in the user context. I also think this isn't great (from a
By default I would expect the Chart to not contain data (going back to your PSQL example, the defaults don't create any schema or data by default). IMO we're using these defaults because it's convenient to us, but from an outside perspective it isn't super obvious what I have to un-set to get a "clean" install. Of course one could argue that looking into this isn't in the scope of the issue being adressed here, and I can also drop it, but since I've spend so much time looking at the Chart now, I felt like it'd be sensible to tackle this. I.e.:
gives me a clean install, and if I want the example organisms or the ebola organism etc I can do:
(which will just layer the other yaml on top of the |
a4efcb7
to
6070442
Compare
totally agree
I think these are broadly reasonable defaults (placeholders) - one could make it more sophisticated but it seems ok given where we are atm
This is probably a reason to put these within the organism as per #3603
So we have considered this, and decided that we wanted to allow people to have a working copy of loculus where they could actually see working organisms with a single command without needing to provide any additional configuration, just by deploying a bare helm chart. We can of course rethink that decision, but it is one we considered: it was considered around external users not just around us, and our tutorials are structured around it. |
Ok! If that was intentional (it looked to me like it was just out of convenience for us) then I'll just not do anything to change the values.yaml for now! |
I guess the thought process is that there are lots of times when you would want to deploy an empty postgres DB instance and then populate it (without touching helm again), whereas there are no circumstances where you'd want to want to run loculus without any organisms. |
I'll add something like this to the schema: {
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"organism": {
"type": "object",
"properties": {
"property1": { "type": "string" },
"property2": { "type": "number" }
},
"required": ["property1", "property2"]
}
},
"type": "object",
"properties": {
"organisms": { "$ref": "#/definitions/organism" },
"defaultOrganisms": { "$ref": "#/definitions/organism" }
}
}
for the default organisms, so they are also covered by the schema, even though we won't surface them in the docs EDIT: Now there are more schema errors, will need to refine that! |
481f43d
to
f04f25a
Compare
resolves #2796, resolves #2798
preview URL for the new docs: https://docs-values-yaml-schema.loculus.org/reference/helm-chart-config/
Summary
The main change in this PR is the addition of the
values.schema.json
file to the Helm Chart, which Helm will by default use to validatevalues.yaml
(You can do this withhelm lint .
).The Helm Chart reference is now completely generated from the schema (it was written by hand before).
The new schema has extra keys in the properties (
groups
,placeholder
,docsIncludePrefix
) to facilitate generating the documentation in individual chunks.A new github action was added to lint the existing values.yaml and make sure that we add all the new things we add to the
values.yaml
also to the schema.TODO
values.schema.json
isn't available in the Dockerimage of the docs - needs to be added. To consider: hwo to have it at a sensible path in the Image but also use the 'live' version from the repo at dev time.additionalProperties
to false revealed some more settings that aren't in the schema yet, I need to add those.Screenshot
n/A
PR Checklist