ai4os / DEEPaaS

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

Improve `deepaas-cli` for OSCAR integration #158

Closed IgnacioHeredia closed 4 months ago

IgnacioHeredia commented 6 months 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 6 months 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 6 months 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 4 months ago

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud