Skip to content

Create empty model version

We need to support creating empty model version (without the model archive being available). This is required to publish statistics while the version is building.

We will change the current behaviour, to create "empty" model versions at first, then require an update with size & hashes to validate its upload. the ModelVersion in created state will remain usable by other endpoint (such as CreateMetricValues)

First we would change the ModelVersion django model:

  • size, hash and archive_hash become nullable
  • the db constraint on model + hash must only be applied when hash is not null

Then we change CreateModelVersion to remove the size, archive_hash and hash parameters. The endpoint must still produce the s3_put_url to allow clients to upload at a later stage.

Finally, most of the work will be in UpdateModelVersion:

  • add size, archive_hash and hash and make them required for model versions in created state
    • these parameters are forbidden once the model version reaches the available state, so they cannot be marked as required on the endpoint
    • these parameters must remain usable for a model version in error state (to allow potential re-uploads).
Edited by Bastien Abadie