Slide 1

Slide 1 text

DevOps Toolkit for R Getting Acquainted with the Cloud

Slide 2

Slide 2 text

Evolution of the Data Scientist Statisticians - Subject Matter Expertise - Classical Statistics Learned to Code - R/python Data Scientists - Charts - Modeling - Bigger Data - Reproducibility Learned to Build Data Products - Visualizations - Animations - Shiny Applications - Dashboards - Packages - APIs New Skills! New Skills! New Jobs!

Slide 3

Slide 3 text

Evolution of the Data Scientist Who Inherits Data Product Stewardship? - Access Control - Infrastructure Management - Maintenance - Scheduling

Slide 4

Slide 4 text

Evolution of the Data Scientist Data Product Stewards - Access Control - Infrastructure Management - Maintenance - Scheduling Who Becomes the Analytic Administrator? - Invest time in learning best practices around data-ops - Spend less time doing data science Support / Resources R in Production Material Webinars for the Analytic Admin Communication with IT

Slide 5

Slide 5 text

When developers begin to think of infrastructure as part of their application, stability and performance become normative. - Jeff Geerling “Ansible for DevOps”

Slide 6

Slide 6 text

Infrastructure Your Data Lab - Start Here!

Slide 7

Slide 7 text

Resources for a Data Lab with RStudio Products github.com/sol-eng/data-science-lab ● A modern Linux operating system ● An internet connection ● Sudo access Step-by Guide: Instance + RStudio + Integration Sean Kross

Slide 8

Slide 8 text

Orchestrate and Burn Down Proof of Concepts take time and energy - but most of the time it’s best not to get too attached. When it comes time for the real deal, use what you learned to start fresh. The cleansing power of BURNING IT DOWN

Slide 9

Slide 9 text

Configuration Management Automation for Everyone. Simple, powerful, agentless automation language to describe your complete IT infrastructure. Design your perfect playbook, or one that’s easily customizable

Slide 10

Slide 10 text

Ansible Resources Webinars available on demand Good Community on Twitter Use in combination with other tools! Boto3 library for AWS Vagrant + VirtualBox for local VM quick launch Modules available for tons of other integrations!

Slide 11

Slide 11 text

Ideally... You’re no longer new to Linux You’ve practiced setting up Data Lab Infrastructure You can customize, stand up and burn down infrastructure On Demand

Slide 12

Slide 12 text

Driven by Practical Need or Interest Tinkering! A totally valid way to learn “this stuff”

Slide 13

Slide 13 text

Google App Engine Fully managed serverless application platform Bring your code, have GCP manage all the infrastructure, Pay for what you use Famously (Infamously?) used by Snapchat 2008 2018 Now with Custom Runtimes!!

Slide 14

Slide 14 text

Google App Engine - R not Included Can it be used to deploy docker + R + plumber? “Popular Crowd”

Slide 15

Slide 15 text

Plumber REST API NGINX Serving Static Rendered Rmarkdown

Slide 16

Slide 16 text

You don’t always need to Docker all the things But in this particular instance we do.

Slide 17

Slide 17 text

Create a Google Cloud Project

Slide 18

Slide 18 text

Two Custom App Engine Projects Two Directories: - Dockerfile - App.yaml - Assets runtime: custom env: flex

Slide 19

Slide 19 text

Docker Prep - Plumber FROM trestletech/plumber RUN R -e 'install.packages(c("ggplot2"))' COPY [".", "./"] EXPOSE 8080 ENTRYPOINT ["R", "-e", "pr <- plumber::plumb(commandArgs()[4]); pr$run(host='0.0.0.0', port=8080)"] CMD ["plumber.R"] Jeff Allen is giving an RStudio Webinar on Plumber - July 25th - Catch the recording later if you’re in this timezone

Slide 20

Slide 20 text

Docker Prep - NGINX FROM nginx COPY nginx.conf /etc/nginx/nginx.conf RUN mkdir -p /var/log/app_engine # Add the static content ADD www/ /usr/share/nginx/www/ RUN chmod -R a+r /usr/share/nginx/www The NGINX website has introductory webinars available on demand + loads of documentation

Slide 21

Slide 21 text

Run App Engine! 1. Prep your Dockerfile 2. Create an app.yaml file 3. Gather any asset files $ gcloud app create $ gcloud app deploy

Slide 22

Slide 22 text

$300 Free GCP Credits console.developers.google.com/billing/

Slide 23

Slide 23 text

*Not an instantaneous deployment process Leave yourself at least 15 minutes for gcloud app deploy to run. (App Links - Now Defunct) If you need something with fast push button deploy... (I Work for RStudio)

Slide 24

Slide 24 text

Settings and Utilities > Project Settings > Shutdown

Slide 25

Slide 25 text

Kelly O’Briant RStudio Solutions Engineer [email protected] @kellrstats on Twitter