Why mrsdeploy web service call through curl does not return console output? RRS feed

  • Question


    I am trying to provide a R function as a web service using mrsdeploy package in a docker container for which I am using dockerizing r and python web services blog as a reference.. When I execute the api call to this service through curl it returns output as follows

    My R code is as follow:

    library(mrsdeploy) library(jsonlite) cust_func <- function(hp, wt) {

    # sample code begins hp <- jsonlite::fromJSON(hp) wt <- jsonlite::fromJSON(wt) return(,wt))

    #sample code ends } remoteLogin("http://localhost:12800", username = "admin", password = "Microsoft@2018", session = FALSE) api <- publishService("MyService", code = cust_func, inputs = list(hp = "character", wt = "character"), outputs = list(answer = "data.frame"), v = "1.0.0")


    Where as expected output structure is as follows: 

       {"success":true,"errorMessage":"",    "outputParameters":{"answer":{"col1":["test"],"col2":[5.0]}},"outputFiles":{},    "consoleOutput":"[1] \"/opt/microsoft/mlserver/9.3.0/o16n/rserve/workdir/Rserv9.3.0/conn156\"\n[1] \"./Run_log.log\"\n",    "changedFiles":["Run_log.log"] }

    I want to look at the console output in above format.Where am I going wrong.
    I am not changing the current working directory also inside my code. The curl command I used to call is as follows:

    curl -X POST http://localhost:12800/api/Myservice/1.0.0 -H 'authorization: Bearer <access_token>' -H 'cache-control: no-cache' -H 'content-type: application/json' -d @test520.json

    Thursday, February 14, 2019 2:18 AM