usnistgov / dioptra

Test Software for the Characterization of AI Technologies
https://pages.nist.gov/dioptra/
Other
210 stars 30 forks source link

Add a workflow for importing a plugin from a git repository or file upload #588

Open keithmanville opened 1 month ago

keithmanville commented 1 month ago

We want to support the importing of plugins from external sources. This allows for:

This will be implemented as a new workflow in the REST API, /workflows/resourcesImport.

Initially, all imported plugins will have a read-only lock applied. We will consider mechanisms for editing and reconciling changes in the future.

Initially, we will support importing from a archive (.zip, or .tar.gz) file upload or a git repository (no authentication support). We will consider other sources in the future.

Tasks:

Definition of Done:

keithmanville commented 3 weeks ago

A workflow for importing resources from a file or git repo. It will handle the importing of the following resources:

POST /workflows/resourcesImport payload:

{
  "groupId": int,  # the group that will own the imported resources
  "sourceType": Enum("upload", "git"),  # the source of the import
  "uri": str | None,  # the uri of the git repository (if sourceType is git)
  "data": bytes | None,  # the uploaded archive file (if sourceType is upload)
  "readOnly": bool,  #  whether imported resources should get a readonly lock
  "resolveNameConflicts", Enun("fail", "overwrite")  # behavior for resolving name conflicts
}