Slide 1

Slide 1 text

The R in Production Handoff: Building bridges from data science to IT RStudio Solutions Engineering Kelly @kellrstats

Slide 2

Slide 2 text

YOUR DOMAIN THE DOMAIN OF OTHERS

Slide 3

Slide 3 text

YOUR DOMAIN THE DOMAIN OF OTHERS Sink or Float??

Slide 4

Slide 4 text

Production is... CUSTOMER/USER FACING - Ready to use - Software that end users are using - An app that is live and available to the end user - Apps on our production server are available to our clients - Client facing Credibility AT SCALE - Scaled to a larger audience - Bulletproof, scalable, fails predictably - Live to 1000 of users with production vehicle data SERVICE LEVEL AGREEMENTS - Required for mission-critical operations; downtime affects the ability to serve customers - Deployed for end users to have continual access without performance issues ENVIRONMENTAL REQUIREMENTS - An area where validated applications are deployed in a locked down environment - The main part of a company that handles all process - Application or system operates effectively without much maintaining effects - A server or environment that runs the “final” applications that your ultimate end-users (often external customers) use to get stuff down DOCUMENTATION - TESTING & MONITORING - Creating apps that can reach a wider audience and are deployed/tested in a consistent manner - Running in a way that is stable to use, documented and monitored

Slide 5

Slide 5 text

Everyone’s Production is Different And Evolving at a Different Rate

Slide 6

Slide 6 text

Start by answering some questions… - What is a Shiny Application? - Who is the audience? - What is your service level agreement definition? (SLA) - What does your analytic architecture look like today? - What are your goals for evolving this architecture? - How will monitoring be handled? - Who is responsible for maintenance? Make work visible, Define shared goals, Build a checklist, Iterate Empathetic Communication is Challenging Code Profiling Version Control Testing Deployment/Release Access/Security Performance Tuning

Slide 7

Slide 7 text

What happens when... Industrial Research Business Management Human Resources Government Work Regulated Environments Big Data Applications Cloud Infrastructure R in Production What is there to learn? What are the needs? What can we build? The R for Data Science Workflow Drops in Solutions Engineers!

Slide 8

Slide 8 text

Case Study: RStudio Connect & IT Groups

Slide 9

Slide 9 text

Building Bridges with Existing Solutions Push-button Deployment Alternatives: - Content Management API - Bundle Promotion API - Git-Backed Deploys - CI/CD Visit solutions.rstudio.com for more information!

Slide 10

Slide 10 text

How does shiny performance tuning and monitoring work in production?

Slide 11

Slide 11 text

Scaling and Performance Tuning in RStudio Connect RStudio Connect is built to scale content. Publishers and administrators have access to runtime settings to help tune and scale their applications and APIs. The scheduling parameters tell RStudio Connect to act somewhere in between Scenario A and Scenario B, to maximize the trade-off between app responsiveness and memory consumption/load time. Max processes - Determines the maximum number of processes that will be created. Max connections per process - The maximum number of connections per process.

Slide 12

Slide 12 text

RStudio Connect - Dashboard View Runtime Settings Shiny Application

Slide 13

Slide 13 text

● IT/Ops doesn’t want to interact with a GUI to manage scaling and performance tuning. ● Applications silently refusing requested connections makes IT/Ops nervous!

Slide 14

Slide 14 text

Instrumentation API RStudio Connect records different types of user activity for different types of content. 1. Shiny applications - records information about each visit and the length of that visit. 2. Static and rendered content - records information about each visit. github.com/sol-eng/connect-usage Code examples showing how to access the instrumentation data are in the User Activity recipes within the RStudio Connect API Cookbook.

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Drill Down on Shiny Sessions Over Time for a Single Shiny Application of Interest Goal: Build the ultimate dashboard for your IT hand-off gift basket Building Bridges with Custom Solutions

Slide 17

Slide 17 text

Benefits of R Markdown over Shiny - Scheduling - History - Email Notifications! (For this dashboard project!)

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Gauge Widget for Tracking Concurrent Sessions Visualize session duration Use lubridate to calculate overlapping time intervals for counting session concurrency Custom Email!

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

Suppress Email Send only if concurrent connections exceeds your warning buffer threshold Icing on the Cake: Update the runtime settings programmatically RStudio Connect Content Management API

Slide 22

Slide 22 text

Production Building Blocks Code Profiling Version Control Testing Deployment/Release Access/Security Performance Tuning bit.ly/shiny-prod-book RStudio Conf Keynote 2019