July 5, 2021

Open Analytics

  • data science consultancy
  • strong track record with R
  • open source products for using R in enterprise environments
  • based in Belgium




https://openanalytics.eu

ShinyProxy

  • web application to deploy Shiny apps in an enterprise context
  • every app is a self-contained Docker image
  • \(\Rightarrow\) Dash, Jupyter notebooks, RStudio, Streamlit, Zeppelin notebooks …
  • run apps on Docker (Swarm) & Kubernetes
  • scalable
  • several authentication options




https://shinyproxy.io

ShinyProxy

ShinyProxy

ShinyProxy Operator

What is Kubernetes?

''Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications.'' - https://kubernetes.io/

\(\Rightarrow\) ideal platform for running ShinyProxy

What is a Kubernetes Operator?

A small piece of software that extends the Kubernetes API in order to fully automate
the operation of a complex application.

Why does ShinyProxy need an Operator?

1) Update configuration of ShinyProxy without affecting the session of a user

  • the Operator manages the lifecycle of ShinyProxy servers
  • it creates a new server when the configuration is updated
  • it retains the old server as long as users are using it

\(\Rightarrow\) users can keep using their running apps, on the old server

Why does ShinyProxy need an Operator?

1) Update configuration of ShinyProxy without affecting the session of a user

… what if existing users want to start using an app from ShinyProxy B?
\(\Rightarrow\) users get an update notification and can choose to switch to the new server.

Why does ShinyProxy need an Operator?

2) Seamless updates of ShinyProxy server

Why does ShinyProxy need an Operator?

3) Enables multi-tenant hosting of ShinyProxy

  • run multiple ShinyProxy servers along each other
  • each server has their own configuration:

Why does ShinyProxy need an Operator?

4) Allows app developers to easily add or update apps

  • users only have to edit the ShinyProxy resource (CRD) and apply the resource
  • errors in the configuration do not cause downtime: the operator will never route users to an unreachable instance

How?

  • ShinyProxy Operator: Kotlin application packaged into a Docker Container
  • Skipper Ingress controller for routing of users to the correct ShinyProxy server
  • Redis for session persistence


Demo time

ShinyProxy as a first class k8s citizen

  • kubernetes-pod-patches and kubernetes-additional-manifests: allows to modify
    the pods created by ShinyProxy
    • create persistent workspaces for users (e.g. in RStudio, Jupyter notebooks)
    • use custom ServiceAccount for each user and/or app
    • use custom Namespace for each user and/or app
    • \(\Rightarrow\) use your creativity!
  • readiness + liveness probes: indicates to Kubernetes when ShinyProxy is ready to accept traffic
    \(\Rightarrow\) important for Operator (preventing downtime when updating ShinyProxy)

ShinyProxy Observability

  • export Prometheus metrics
  • containers contain additional metadata (useful for aggregating logs)

Running multiple instances of an app

Reconnecting websockets

App Recovery

Thank you