CI/CD for Plumber APIs

Hi,

I was able to do automatic deployment using Jenkins for Shiny App. Now I am trying to figure it out how can I do the same with the Models using Plumber APIs. Can anyone please direct or give a guidance to do this.

Cheers,

2 Likes

If you don't mind clarifying a bit more about the approach you went through? Are you aware of RStudio Connect's new feature to "watch" a GitHub repository, essentially making Jenkins unnecessary?

It is talked about more here:

https://blog.rstudio.com/2019/06/24/rstudio-connect-1-7-6/

That said, CI deployment (or git-backed deployment) of Plumber APIs is very much the same on RStudio Connect.

  • create content endpoint
  • build manifest
  • upload
  • deploy

The manifest / bundle upload is what determines whether the content is a Plumber API or Shiny App.

This article explains in more detail:

https://solutions.rstudio.com/deploy/overview/

If you have more specific questions or details around what you did, we would be happy to help clarify!

2 Likes

Thanks for the reply.
We are currently evaluating RSConnect, so we are exploring several possibilites.

We have to deploy to Stage/QA (RSConnect Staging Server) first is our plan and have a gated manual approval to Prod (RSConnect). Do you have any insights on better way to do this?

Yup. I am familiar with the new feature in 1.7.6 and in fact I am using rsconnect:writeManifest() to deploy. I just didn't know we can use the same method for Plumber API.

Yep! That's exactly right! The same writeManifest() approach will work for plumber! Let us know if you run into any issues.

As for the gated manual approval to prod. There are lots of ways you could do this.

One approach would be to do everything within git - have a "develop" branch that deploys to staging and a "master" branch that deploys to prod. Things do not deploy to prod until they are merged into master.

Another way that you could do this would be to promote directly from the Staging server to the Prod server.

This and many other similar approaches are discussed here: https://solutions.rstudio.com/deploy/promote/#request-deployment

If you want to take this approach, you would use the RStudio Connect Server API to:

Definitely let us know how the evaluation goes or if you have more questions! We're happy to talk through different strategies that you're thinking about.

Exactly what I am thinking. Thanks.

Last thing, In the Enterprise bundle, does the Staging Server is a exact replica of Prod? or different?

1 Like

From a licensing perspective, the Staging Server differs slightly from the production server, as discussed here: https://support.rstudio.com/hc/en-us/articles/360007833814-RStudio-staging-servers

Basically, its licensed use is for staging / IT needs.

However, from an architecture / system perspective, you are generally best served if you keep Staging an exact replica of Production. (So that tests on staging mirror what the environment would look like on Production).

That's a great question, though!