Skip to content
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

Config file validation #2798

Open
chaoran-chen opened this issue Sep 15, 2024 · 5 comments · May be fixed by #3588
Open

Config file validation #2798

chaoran-chen opened this issue Sep 15, 2024 · 5 comments · May be fixed by #3588
Labels
config Configuration related issues, i.e. helm processing feature Feature proposal v1.0 Tasks that are crucial for a Loculus 1.0 release

Comments

@chaoran-chen
Copy link
Member

After #2796, we should add validation of the configuration files that gives useful feedback to an admin setting up an instance.

@chaoran-chen chaoran-chen added config Configuration related issues, i.e. helm processing feature Feature proposal labels Sep 15, 2024
@chaoran-chen chaoran-chen added this to the Release v1.0 milestone Sep 15, 2024
@chaoran-chen chaoran-chen added the v1.0 Tasks that are crucial for a Loculus 1.0 release label Oct 1, 2024
@chaoran-chen chaoran-chen modified the milestones: Release v1.0, Priority 1 (highest) Oct 1, 2024
@fhennig
Copy link
Contributor

fhennig commented Dec 6, 2024

#3346

@fhennig
Copy link
Contributor

fhennig commented Jan 27, 2025

From #3346:

Helm supports an optional JSON schema for the values.yaml. We could write one, and then possibly also generate docs for the helm chart from the schema, with a tool like this. Our Helm Chart is quite large and complex, and documentation synced by hand. This could help us keep the docs in sync, and get a validation layer for the values.yaml.

We could also use something like Pydantic to define the structure in Python code first, and then generate the schema file from that! Maybe easier than maintaining a JSON schema by hand.

Edit: More options: generate it with cdk8s or use additional tooling to extract a schema from an exisiting values.yaml. I still prefer a more minimal approach without those things, but wanted to add them here as options.


How to generate the schema.values.json?

Writing a JSON schema by hand is cumbersome, and so I think we should write it in a different way. I found out that zod schemas can be converted into json schemas (zod-to-json-schema). We already use zod in the frontend, so I think it'd be good to reuse this; I'd make a new small package though to generate this schema. and then we can use the native Helm support to validate with this schema.

@fhennig
Copy link
Contributor

fhennig commented Jan 27, 2025

Slack thread discussing this: https://loculus.slack.com/archives/C05G172HL6L/p1737971382738259

@fhennig fhennig linked a pull request Jan 29, 2025 that will close this issue
2 tasks
@fhennig
Copy link
Contributor

fhennig commented Feb 3, 2025

@chaoran-chen @theosanderson @corneliusroemer What about validation that can't be expressed within the schema?

A recent example would be #3534 (comment)

But also for example the metadataTemplate should only contain existing fields.

I believe this sort of validation cannot e done inside a JSON schema - Is this sort of validation just out of scope for now - and we revisit it in the future?

@chaoran-chen
Copy link
Member Author

Yes, I think that it is out of scope for the moment but it would be very valuable to create a ticket and collect possible but missing validation steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Configuration related issues, i.e. helm processing feature Feature proposal v1.0 Tasks that are crucial for a Loculus 1.0 release
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants