analythium / openfaas-rstats-templates

OpenFaaS templates for R
MIT License
19 stars 1 forks source link

ROADMAP #19

Open psolymos opened 3 years ago

psolymos commented 3 years ago

This is the roadmap for revising the R/rstats templates for OpenFaaS.

Base images

We need the following base image options (BASEIMAGE below):

Watchdog version

Existing server frameworks

The following are server frameworks capable of running R based APIs:

Template structure and workflows

I really like how the r-minimal image implements remotes::install_deps() with the _R_SHLIB_STRIP_=true envvar. This behavior should be implemented for other templates through the Dockerfile as added by @mrchypark for the r-minimal template.

psolymos commented 3 years ago

✅ Need to have

Cassic watchdog:

of-watchdog:

Good to have

Rserve and alikes

❗ Rserve branch

Would be nice to have a bare bones solution with Rserve.

❗ RestRserve: issue | branch

Having JSON POST issues.

httpuv and alikes

❌ Rook

Rook serves web apps using R's help server and forces the routes to prepend /custom. There was a hack to overwrite tools:::httpd but we get locked binding of ‘httpd’ cannot be changed. The following starts, but R help says 'Only NEWS and URLs under /doc and /library are allowed':

library(Rook)
s <- Rhttpd$new()
s$add(RhttpdApp$new(system.file('exampleApps/RookTestApp.R',package='Rook'), name='httpd'))
s$start(listen='127.0.0.1', port=5000)

✅ httpuv: issue | branch

✅ beakr: issue | branch

A nice minimalist framework, somewhere between httpuv and fiery in terms of complexity.

✅ fiery: issue | branch

❌ OpenCPU: issue | branch

Use local server, as a microservice. GET works, POST has similar JSON issues as RestRserve.

psolymos commented 3 years ago

Lack of websocket connection can be behind the problems identified (https://github.com/openfaas/of-watchdog/issues/20). Closing this for now.

psolymos commented 1 year ago

As it turns out, Rserve, RestRserve and opencpu works fine. of-watchdog needs http_buffer_req_body="true". See https://docs.openfaas.com/deployment/troubleshooting/#my-function-gets-a-nil-or-empty-body. This causes the HTTP request to be buffered in memory, then sent in one shot to the upstream function.