Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The R in Production Handoff: Building bridges from data science to IT

Fd59f90efdaa9dea8f7d9c2f0c930a2b?s=47 kellobri
September 11, 2019

The R in Production Handoff: Building bridges from data science to IT

EARL London 2019



September 11, 2019


  1. The R in Production Handoff: Building bridges from data science

    to IT RStudio Solutions Engineering Kelly @kellrstats


  4. 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
  5. Everyone’s Production is Different And Evolving at a Different Rate

  6. 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
  7. 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!
  8. Case Study: RStudio Connect & IT Groups

  9. 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!
  10. How does shiny performance tuning and monitoring work in production?

  11. 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.
  12. RStudio Connect - Dashboard View Runtime Settings Shiny Application

  13. • 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!
  14. 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.
  15. None
  16. 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
  17. Benefits of R Markdown over Shiny - Scheduling - History

    - Email Notifications! (For this dashboard project!)
  18. None
  19. Gauge Widget for Tracking Concurrent Sessions Visualize session duration Use

    lubridate to calculate overlapping time intervals for counting session concurrency Custom Email!
  20. None
  21. 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
  22. Production Building Blocks Code Profiling Version Control Testing Deployment/Release Access/Security

    Performance Tuning bit.ly/shiny-prod-book RStudio Conf Keynote 2019