Fix model artifact upload form type bug
What does this MR do and why?
Fix model artifact upload bug
- When uploading a file, the PUT endpoint expects a single body with a single file as content.
- The UI model file uploads sends a multiform data; which is wrong. This will be so, in the future but creates a problem.
Model registry feature is in beta testing; and we shall communicate the current beta users.
Followup: Add a feature and/or QA spec for ML model file ... (#477841)
Buggy behavior
When we upload a file called file.txt
with contents
Foo
We download it and we get:
------WebKitFormBoundarya3lu19v6obLLbaq9
Content-Disposition: form-data; name="file"; filename="file.txt"
Content-Type: text/plain
Foo
------WebKitFormBoundarya3lu19v6obLLbaq9--
When running your branch on GDK and repeating the same steps I am able to download the file with the original content.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Upload and download a file to see all works fine.
How to set up and validate locally
- Go to a project URL in your browser
- Open the "Deploy" and "Model registry" under it.
- Create a model and a version.
- Upload some files
- Download them and see if all works fine.
Edited by Alper Akgun