Skip to content

Validation of adapter configuration files #64

Description

@MakisH

Today, we had a discussion on Matrix about how to validate the adapter config file and how to distribute the schema for this validation.

@IshaanDesai asked the questions for the FEniCSx adapter (related PR: precice/fenicsx-adapter#59 (review)). @uekerman @Logende @fsimonis and myself participated in the discussion.

In general, one can get the schema from this repository, using a (versioned) direct link to the schema file.

Who checks

  • One could validate the file in the adapter (or other tool) itself, potentially with an option to enable/disable this check.
    • Pro: fine-grained checks in the adapter, support for additional parameters.
    • Contra: every adapter needs to implement this, libraries are not available for all languages we need.
  • An alternative would be to use the preCICE CLI
    • Pro: one central tool to maintain (already used for the config check)
    • Contra: additional tool (even if very common), no direct knowledge of additional fields (potentially: schema extensions for each adapter?)

Side condition: we are only talking about the schema here. The actual file might be in any language (#32), so the preCICE CLI would need to support different languages.

Maybe one could have both: an offline check (manually run the preCICE CLI) and an optional online check (every adapter checks at runtime). "Online" here means "when the simulation starts".

See also: #62

How to distribute

While fetching from the URL would be possible for a checker, this should, of course, not be required for running a simulation. All tools should generally be available offline.

One option would be to copy the schema file into each repository -> we want to avoid this to reduce maintenance work.

Another option would be installing the file when installing the adapter package (using the installation procedures of the adapter, or using the preCICE CLI).

@fsimonis suggested wrapping the schema into a mini Python package, which can then be distributed on PyPI, which he has already applied as a solution in the case-generate. Depending on the answer of "who checks", if that is "every adapter", then the question is how do we handle non-Python-based adapters?

Metadata

Metadata

Assignees

No one assigned

    Labels

    schemaRelated to the adapter config schema

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions