none
Asynchronous Jobs with Microsoft R Server 9.0 RRS feed

  • Question

  • Hi,

    I've been getting started with Microsoft R Server 9.0 this week.  I've been able to start using the Core Operationalization APIs successfully. 

    But one scenario I see is the need to invoke long-running R code jobs asynchronously, using subsequent API calls to check the status of the job and get results.

    I see that under the previous version of R Server, this support existed in the form of DeployR's Jobs API: https://microsoft.github.io/deployr-api-docs/8.0.5/#jobs

    However, I don't see an equivalent API in R Server 9.0's Operationalization APIs, and I don't see any indiciation that DeployR APIs are still supported in R Server 9.0.

    So - can someone tell me the best way to get Jobs support in 9.0?  Or do I need to "downgrade" to 8.0 and wait for a revised Jobs API to be reintroduced in a future release?

    Thanks,

    Andrew Brown


    • Edited by szAndrew Friday, December 16, 2016 3:18 PM Typo
    Friday, December 16, 2016 3:18 PM

Answers

  • Hi Andrew,

    Microsoft R Server 9.0 Operationalization APIs replaced the jobs APIs with asynchronous batch execution of web services API.

    Please check out this site which shows how to create web services in R Server:

    https://msdn.microsoft.com/en-us/microsoft-r/mrsdeploy/mrsdeploy-websrv-vignette


    For example, if you create a service, you would call it like this:

    POST api/serviceA/v1.0

    But it can also be called like this:

    POST api/serviceA/v1.0/batch

    which will return an id which you can use to query the status/results

    GET api/serviceA/v1.0/batch/{id}

    You can create a client stub library from your service which includes these async execution API stubs to call your service asynchronously:

    https://msdn.microsoft.com/en-us/microsoft-r/operationalize/app-developer-get-started#example-service-consumption-client-library-from-swagger-in-csharp

    Please let me know if that helps. I'll work with our documentation team to add the missing documentation.

    Thanks,
    Daniel


    • Edited by Daniel Hartl Friday, December 16, 2016 11:18 PM
    • Marked as answer by szAndrew Monday, December 19, 2016 5:58 PM
    Friday, December 16, 2016 11:17 PM

All replies

  • Hi Andrew,

    Microsoft R Server 9.0 Operationalization APIs replaced the jobs APIs with asynchronous batch execution of web services API.

    Please check out this site which shows how to create web services in R Server:

    https://msdn.microsoft.com/en-us/microsoft-r/mrsdeploy/mrsdeploy-websrv-vignette


    For example, if you create a service, you would call it like this:

    POST api/serviceA/v1.0

    But it can also be called like this:

    POST api/serviceA/v1.0/batch

    which will return an id which you can use to query the status/results

    GET api/serviceA/v1.0/batch/{id}

    You can create a client stub library from your service which includes these async execution API stubs to call your service asynchronously:

    https://msdn.microsoft.com/en-us/microsoft-r/operationalize/app-developer-get-started#example-service-consumption-client-library-from-swagger-in-csharp

    Please let me know if that helps. I'll work with our documentation team to add the missing documentation.

    Thanks,
    Daniel


    • Edited by Daniel Hartl Friday, December 16, 2016 11:18 PM
    • Marked as answer by szAndrew Monday, December 19, 2016 5:58 PM
    Friday, December 16, 2016 11:17 PM
  • Daniel,

    Thank you!  With the detail you provided, I was able to perform a successful test of batch execution from Postman.  I'll review the corresponding async stubs that AutoRest generates for the batch APIs later this afternoon.

    Kind regards, Andrew

    Monday, December 19, 2016 6:01 PM