ai4os / DEEPaaS

A REST API to serve machine learning and deep learning models
https://deepaas.readthedocs.io
Apache License 2.0
34 stars 14 forks source link

Improve `deepaas-cli` for OSCAR integration #158

Open IgnacioHeredia opened 1 month ago

IgnacioHeredia commented 1 month ago

Hi @vykozlov ,

I have modified the deepaas-cli to prepare it to support OSCAR calls in the services deployed with PAPI. Main changes:

All these changes have been thoroughly tested with the demo_app which is using a wide variety of inputs.

This PR won't be merged right away (few tests still need to be done from OSCAR side), but it's mainly in a final shape.

Do the changes look good to you?

vykozlov commented 1 month ago

Hi @IgnacioHeredia thanks for updating, I will have a look, though need some time to refresh my memory :-) One quick comment: if I recon correctly, "fields.Field" is a general class and we can't assume by default that every "fields.Field" is a file (function _get_file_args())

IgnacioHeredia commented 1 month ago

Hi @vykozlov ,

I agree, but there does not seem to be a field specific for files.

>>> dir(marshmallow.fields)
['And', 'AwareDateTime', 'Bool', 'Boolean', 'Constant', 'Date', 'DateTime', 'Decimal', 'Dict', 'Email', 'Enum', 'EnumType', 'Field', 'FieldABC', 'FieldInstanceResolutionError', 'Float', 'Function', 'IP', 'IPInterface', 'IPv4', 'IPv4Interface', 'IPv6', 'IPv6Interface', 'Inferred', 'Int', 'Integer', 'Length', 'List', 'Mapping', 'Method', 'NaiveDateTime', 'Nested', 'Number', 'Pluck', 'Raw', 'RemovedInMarshmallow4Warning', 'SchemaABC', 'Str', 'String', 'StringNotCollectionError', 'Time', 'TimeDelta', 'Tuple', 'URL', 'UUID', 'Url', 'ValidationError', '_Mapping', '_T', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'annotations', 'class_registry', 'collections', 'copy', 'decimal', 'dt', 'ipaddress', 'is_aware', 'is_collection', 'math', 'missing_', 'numbers', 'resolve_field_instance', 'types', 'typing', 'utils', 'uuid', 'validate', 'warnings']

Given that every other data type has it's own field type, I think it's fair to asume that we reserve fields.Field() for files. In fact that's already the default behaviour for deepaas: fields.Field arg is translated to a browse-file button in the Swagger UI.

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud