meztez / plumberDeploy

Other
51 stars 13 forks source link

Upload ML model to digital ocean droplet #20

Closed MislavSag closed 3 years ago

MislavSag commented 3 years ago

Hi,

I would like to make my ML model available as an endpoint in plumber API.

I am using the digital ocean as a cloud service and already have several functions that work fine.

To use ML model I first have to save it on my droplet. But I am confused about 2 questions: 1) Where should I save the rds file, in which folder. I can see there is a var/plumber folder and 3 folders inside (alphar, hello, plumber.R). Should I save the file in that folder? 2) How to send the file to that specific folder. Is there a function in this package?

meztez commented 3 years ago

The working directory of a plumber router is the location of the plumber.R file, so save your file anywhere and load it relative to plumber.R location. It is easier to just put them in the same location.

If you put them in the same folder, it should upload it with your plumber file when you use do_deploy_api provided you called the function with a path, not a filename.

To upload a file individually to a droplet, you can use :

analogsea::droplet_upload()
MislavSag commented 3 years ago

I just had to save the file in the same folder where plumber.R as you said. Everything else the same. Thanks!