Categories: ProgrammingNews

MLOPS with R and GitHub Actions from Revolutions

2 min read

With thanks to the kind folks at Lander Analytics, video from my New York R Conference talk earlier this month is now available to view. The slides are also available for download in PDF format.

In my talk, I described how I automated the deployment of a Shiny app using GitHub Actions. If you’re new to GitHub Actions, it’s pretty simple to set up a continuous deployment process:

  • Define jobs as YAML files in the .github/workflows folder of your GitHub repository
  • Search the GitHub Actions Marketplace for templates of tasks you’d like to perform
  • Push changes to your workflow to trigger Actions according to the rules you specify

In my case, I used Actions to create an on-demand cluster of VMs in Azure Machine Learning service, to train R models on the cluster with the azuremlsdk package, to deploy the trained model as an HTTP endpoint in Azure Container Instances, and to update the Shiny app which calls out to that endpoint.

In the talk, I demonstrate the process in action (the demo starts at the 14:30 mark in the video below). I used Visual Studio Code to edit the app.R file in repository, and then pushed the changes to GitHub. That immediately triggered the action to deploy the updated file via SSH to the Shiny Server, running in a remote VM. Similarly, changes to the data file or to the R script files implementing the logistic regression model would trigger the model to be retrained in the cluster, and re-deploy the endpoint to deliver new predictions from the updated model.

I’ve provided the complete GitHub repository implementing the app, the models, and the Actions at github.com/revodavid/mlops-r-gha. If you want to try it out yourself, all you need to do is clone the repo, follow the instructions to add secrets to your repository and set up the Shiny VM, and then trigger the Actions to build everything. The repository also includes links to references and other resources, including how to create free Azure subscription with credits you can use to test everything out. If you have any questions you suggestions, please feel free to add an issue to the repository!

GitHub (revodavid): MLOPS with R: An end-to-end process for building machine learning applications

Matthew Emerick and Oli Huggins

Share
Published by
Matthew Emerick and Oli Huggins
Tags: R

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago