google-cloud-platformgoogle-cloud-storagegoogle-cloud-runinference

cloud run : should we bundle trained model (having large size 2 GB) in container or should we download it from cloud storage at container start


My use case is: I have trained model which i want to use for infer small messages. Not sure about where should i keep my models in cloud run.

  1. inside container
  2. On cloud storage and download it at the time of container start
  3. Mount cloud storage as local directory and use it

I am able to write and run code successfully for option 1 and 2. Tried option 3 but not lucky there. I am using this link https://cloud.google.com/run/docs/tutorials/network-filesystems-fuse Actually here my entry point is an pub sub event. thats where i am not able to make it working.

But before exploring more into it i would like to know about which approach is better here. or is there any other better solution.


Solution

  • Thanks for valuable comments, it helped a lot.

    If model is static better to club it with container. downloading it from storage bucket or mounting FS will download model again whenever we spin new container.