Custom mar downloader
Is your feature request related to a problem? Please describe.
At present, only mar files from public urls can be fetched. This imposes unnecessary restrictions for users to keep their model on public URL or on the local disk. It can also result in a security risk however the same can be reduced to some extent using #468 .
Describe the solution
Make mar download component of torchserve extendable or customizable so that users can override or create custom downloader. Custom downloader could be used to support the following -
- Support for secure private URIs
- Authorization etc..
Describe alternatives solution
None
A provisional workaround we implemented on AWS: we create a public S3 website, but we restrict access only to IPs range we own / VPC where the application is deployed.
What would it take to get the ball rolling on this one? Happy to support the effort if desired. Resolving this is required to unblock my team, for more details on the exact use-case refer to #691 .
A provisional workaround we implemented on AWS: we create a public S3 website, but we restrict access only to IPs range we own / VPC where the application is deployed.
It is indeed a solution, but, in case you got object KMS encrypted, you might get into trouble.
In the same order of idea- each object has a download link. You generate a pre-signed URL for the object, keep bucket ACL updated with whitelisted IPs - and object can be donwloaded via link. Yet, KMS encryption still and issue.
And finally, if you can play around the bash script which is launching torchserve, and add some lines for model loading. Solves KMS issue/public download link/whitelisting... but requires awscli installed on torchserve. And, obviously, you cannot dynamically load models without shutting down the torchserve.
As a trick, if you have EFS and a ECS/EKS cluster, you can launch a container which the sole and only role to move models from S3 to EFS. It solves most of the above issues.
Ideally - yes, a custom model loader depending on framework. But, also, ideally, keeping it as separate container, dedicated only for model loading to EFS.
If anyone comes across this issue, this merged PR should help https://github.com/pytorch/serve/pull/1027
fixed in v0.4.0
fixed in v0.4.0
That does not fix this issue. This issue is about implementing a custom downloader, not supporting SSE specifically.