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/workflowsfolder 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 a 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