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

Support multiple versions of target dandischema #1571

Open
yarikoptic opened this issue Jan 30, 2025 · 1 comment
Open

Support multiple versions of target dandischema #1571

yarikoptic opened this issue Jan 30, 2025 · 1 comment
Labels
schema Issues relating to metadata schema vendoring

Comments

@yarikoptic
Copy link
Member

Inspired by

by @kabilar , and ongoing work on "vendorization" of DANDI archive codebase to support multiple instances of DANDI.

ATM both dandi-cli and dandi-archive re-use dandischema Python library for manipulating and validating metadata records. As a result, any upgrade of dandischema in server requires upgrade of dandischema in dandi-cli installation which also might require upgrade of dandi-cli itself.

With multiple archive instances in play (already DANDI and LINC and EMBER is coming), synchronizing all of them to align with most recent dandischema would be getting close to infeasible. So I think we should distill a solution which would allow dandi-cli to manipulate different/needed versions of dandischema.

Possible roadmap to achieve that

  • migrate pydantic model to linkml (effort ongoing by @candleindark ) + potentially additional "instance specific" restrictions (TODO: link issues in dandi-schema)
  • export linkml models into https://github.com/dandi/schema/tree/master/releases
  • define dandischema_schema_version -- as long as it is "compatible" in terms of its formulation with dandi-cli. In a similar situation in BIDS we have BIDS_VERSION and its SCHEMA_VERSION, see https://github.com/bids-standard/bids-specification/tree/master/src/schema#version-of-the-schema
  • in dandi-cli implement loading of models from linkml models for the version desired by the server:
    • as long as that linkml model is described in compatible version of schema (based on minimal dandischema_schema_version supported by dandi-cli) , we should be good
    • potentially extend the model with instance specific models where needed for validation (most likely the base model would be sufficient to describe)
    • not yet sure what we should do for currently used pydantic models in Python interfaces, might need to populate classes for different versions. So issue similarish to what we discussed with @rly and other nwb developers about nwb versions.

Also attn @jwodder @satra @bendichter @dandi/dandiarchive to potentially also think about enhancement to above plan or just to suggest alternative approaches.

@yarikoptic yarikoptic added schema Issues relating to metadata schema vendoring labels Jan 30, 2025
@satra
Copy link
Member

satra commented Jan 31, 2025

the cli has to be compatible with not just schemas but also api processes (e.g. upload flows or parameters) across instances. hence there is a more critical notion of compatibility of cli and server that includes both api version and schema version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
schema Issues relating to metadata schema vendoring
Projects
None yet
Development

No branches or pull requests

2 participants