Shiny-K8s, a toolkit to easily and reproducibly deploy your (R)Shiny app thanks to docker and Kubernetes (without mastering them!)
Résumé
Abstract
At the bioinformatics and biostatistics hub of the Institut Pasteur - Paris, we want to help scientists and bioinformaticians to be autonomous to deploy their R shiny [1] application on the web. We want them to do it without having to maintain a shiny server, nor mastering Docker [2] and Kubernetes [3]. To make it possible, we developed toolkit named Shiny-K8s [4] that leverage Docker to containerize the application in a pre-build image, Kubernetes to run it on the web, Helm[5] to specify how it will be deployed to kubernetes cluster, and GitLab-CI/CD [6] to use all this to automatically deploy the application. The toolkit is pre-wired to leverage all this without mastering nor knowing underlying technology. While RShiny is our primary target, we also propose the toolkit to host shiny-python applications.
The toolkit is based on GitLab project for hosting the source code which encourages reproducibility, indeed every change in source code is commited, tracked, and versionized, thus we always know who made what. When it comes to projects hosted in a git repository, using branches is also a good practice for introducing new features, fixing issues, or simply testing data and libraries updates. With every new branch, the toolkit automatically starts a new instance of the application, allowing you to test and share this new version of your application before officially publishing it, thanks to the continuous Integration and continuous deployment (CI/CD).
For end-user and ease of use, the toolkit propose togglable features such as auto scaling to scall up the resources (cpu/ram) associated with your application only when it is needed, no-downtime which start the next version of your application before shutting down the old one, persistent storage if you have results computed by your app, and also the possibility to keep the content of your gitlab project private while exposing the running app publicly.
The toolkit comes with step-by-step documentation guiding the users to use the toolkit, configure the project and how to estimate and ask resources in the Kubernetes clusters.
In terms of security, the app is hosted in a container in read-only, with an applicative user (i.e not root). This means that in case of security issue in the source code of the app or shiny, the source code of the app cannot be changed by malicious attacker. This also means that an application cannot see the private data of another application. The docker image is built by ourselves, reducing the exposition to unmaintained images that have known security issues.
The toolkit is published under an MIT license, allowing every organization with a gitlab instance/account and kubernetes clusters to re-use it. As of today several projects under development are using the Shiny-K8s toolkit at the Institut Pasteur. We aim at migrating every RShiny application maintained by the hub bioinformatics and biostatistics of the Institut Pasteur
References
1. Chang W, Cheng J, Allaire J, Sievert C, Schloerke B, Xie Y, Allen J, McPherson J, Dipert A, Borges B (2024). shiny: Web Application Framework for R. R package version 1.8.1.9000, https://github.com/rstudio/shiny, https://shiny.posit.co/.
2. Merkel D. Docker: lightweight Linux containers for consistent development and deployment. Linux journal. 2014;2014(239):2.
3. Kubernetes is an open-source container orchestration engine for automating deployment, scaling, and management of containerized applications. The open-source project is hosted by the Cloud Native Computing Foundation https://kubernetes.io/
4. shiny-K8s gitlab project available at https://gitlab.pasteur.fr/hub/shiny-k8s
5. Helm, the package manager for kubernetes. Documentation available from https://helm.sh/
6. https://docs.gitlab.com/ee/ci/index.html
Domaines
Bio-informatique [q-bio.QM]Origine | Fichiers produits par l'(les) auteur(s) |
---|---|
Licence |