Skip to content

Check the model version's hash after downloading

https://redmine.teklia.com/issues/11341

Requires #1936 (closed), #1938 (closed)

arkindex.ponos.tasks.download_model_version should, while writing chunks of the file returned by requests, also provide them to a hashlib.md5 hash through .update(). This will build an MD5 hash of the file while downloading it. The MD5 hash should then be compared against task.worker_run.model_version.archive_hash. If the hashes don't match, an error should be raised and the task should switch to the error state with an explicit error message in the task logs.