According to the documentation, https://www.rplumber.io/, it says that if we use plumber$run() it will just run locally localhost:8000. And I want to publish it in a remote. How can I start a remote API using plumber package?
See the host parameter on run(). e.g. $run(host="0.0.0.0")
Related
I am using Mlflow for my project hosting it in an EC2 instance. I was wondering in MlFlow what is the difference between the backend_store_uri we set when we launch the server and the trarcking_uri ?
Thanks,
tracking_uri is the URL of the MLflow server (remote, or built-in in Databricks) that will be used to log metadata & model (see doc). In your case, this will be the URL pointing to your EC2 instance that should be configured in programs that will log parameters into your server.
backend_store_uri - is used by MLflow server to configure where to store this data - on filesystem, in SQL-compatible database, etc. (see doc). If you use SQL database, then you also need to provide the --default-artifact-root option to point where to store generated artifacts (images, model files, etc.)
Trying to follow doc at secure your experiments but after configuring default workspace storage for VNET access, attempts to create integrated notebook VM fails with what looks like a storage access error.
Create Failed:
Failed to clone samples. Error details: Microsoft.WindowsAzure.Storage This request is not authorized to perform this operation.
thanks,
jim
We are working on adding virtual network support to NotebookVM.
Thanks
I'm inexperienced in using opencpu as a server and so I tried to find a answer to this in the documentation but did not found any answers to this question. Never the less this seems quite basic to me in terms of permission and authentication, so I guess this is documented somewhere and I just did not found it....
The question I have is regarding users and permissions when running a request to the OpenCPU server.
I've written a R package which I want to host using the OpenCPU server. So far I managed to install OpenCPU server without any problems and it works fine for most functions in my R pakage. However one function uses Sys.getenv('USERNAME') to determine the user which runs the code. But when the R code is triggered by a client request I have no clue how to figure out the user.
Min Example:
Suppose I have a function "myFun" included in my R package named "MyRPkg" like:
MyRPkg/R/myFun.R:
myFun(v){
return(Sys.getenv('USERNAME'))
}
When I've installed the package (in the "root" R library) and have my OpenCPU server running than I can access the package and call this function by a POST request like:
SERVERNAME/ocpu/library/MyRPkg/R/myFun/json
and get an empty string as an answer.
[""]
How do I figure out what is happen on the server side in terms of which user "runs" the R code and is it possible to configure this?
My initial thought was that the user should be "data-www" which is the default Apache setting on my system. Don't know at what layer the user is set, Apache, rApache or opencpu, but I'm guessing it should be configurable on OpenCPU level?
The System the server runs on is more or less a linux Ubuntu server.
The OpenCPU system runs on top of your system default Apache2 server. Which uid is used to run the apache2 daemon is configured on your system. By default it is www-data on Debian/Ubuntu. You can probably override this somewhere.
We have created RestApi's in R. We are able to run the code by using Plumber. But the thing is we need to host or deploy the R code on web (like web api or web services)
# myfile.R
#' #get /Sample
Sample <- function(samples=10){
print(samples)
}
Note : Please suggest other than Plumber and Shiny
This is for those who wants to have a comparion of API development with R.
Basically concurrent requests are queued by httpuv in plumber so that it is not performant by itself. The author recommends multiple docker containers but it can be complicated as well as response-demanding.
There are other tech eg Rserve and rApache. Rserve forks prosesses and it is possible to configure rApache to pre-fork so as to handle concurrent requests.
See the following posts for comparison
https://www.linkedin.com/pulse/api-development-r-part-i-jaehyeon-kim/
https://www.linkedin.com/pulse/api-development-r-part-ii-jaehyeon-kim/
I have an R package that I would like to host through Amazon Web Services that will be accessible via an API. The script should take a couple of input values and return the R output in json format. Also, the API should be able to handle multiple requests simultaneously.
So for example, call http://sampleapi.com/?location=USA?state=Florida. That would then run the R package and return the output data to the calling application.
Has anyone done this before or know of resources you can point me to that would explain how to do so? Thanks!
Thanks for all the suggestions. I decided to use Ruby for the API with the rinruby and rails-api gems and will host that through AWS Elastic Beanstalk. See this question for how I am setting it up - Ruby API - Accept parameters and execute script