diff --git a/assets/img/huggingface_spaces.png b/assets/img/huggingface_spaces.png new file mode 100755 index 0000000000000000000000000000000000000000..22ea8d22964dd4c0934960522a0410988c234bf9 Binary files /dev/null and b/assets/img/huggingface_spaces.png differ diff --git a/assets/img/huggingface_spaces_docker-shiny.png b/assets/img/huggingface_spaces_docker-shiny.png new file mode 100755 index 0000000000000000000000000000000000000000..c01f738ed4c492ff538c2c164257a72101f5594e Binary files /dev/null and b/assets/img/huggingface_spaces_docker-shiny.png differ diff --git a/assets/img/layouts_2.png b/assets/img/layouts_2.png new file mode 100755 index 0000000000000000000000000000000000000000..7482f06a64ff8850de8f292a01c81f6e3df2d4f6 Binary files /dev/null and b/assets/img/layouts_2.png differ diff --git a/assets/img/mybinder.png b/assets/img/mybinder.png new file mode 100755 index 0000000000000000000000000000000000000000..66616547fcdc2d7e82c4a8c20227930f7e38d113 Binary files /dev/null and b/assets/img/mybinder.png differ diff --git a/index.qmd b/index.qmd index 7e0a6fd8c155a73c9bfa86fc44ab8faea4a818f5..4c8ea2668c5db360e85c53e3faae90d8093a3092 100644 --- a/index.qmd +++ b/index.qmd @@ -176,16 +176,16 @@ shinyApp(ui = ui, server = server) ## Communiquer autour de ses résultats R ? {.smaller} -::: columns -::: {.column width="40%" style="text-align: center;"} +:::: columns +::: {.column style="text-align: center;"} {width=70% height=40%} ::: -::: {.column width="60%" style="text-align: center;"} +::: {.column style="text-align: center;"} {width=100% height=50%} ::: -::: +:::: ::: {style="text-align: center;"} {width=40% height=5% text-align="center"} @@ -646,9 +646,10 @@ fluidPage( **Déploiement local** -- Partage du code avec l’utilisateur. - - via un package R que l’utilisateur installe en local - - via un dépôt GitHub (shiny::runGitHub et shiny::runURL) +::: {.callout-tip title="Partage du code avec l’utilisateur"} +- via un package R que l’utilisateur installe en local +- via un dépôt GitHub (shiny::runGitHub et shiny::runURL) +::: ::: {.callout-warning title="Inconvénient"} Nécessite d’installer R/Rstudio et de gérer l'installation des dépendances @@ -722,36 +723,91 @@ shinyApp(ui = ui, server = server) YouTube video: guide pas à pas pour créer une application Shiny sans serveur +::: {style="text-align: center;"} [](https://www.youtube.com/watch?v=6y2FnAugP8E) +::: ## Partager son application Shiny **[shinyapps.io](https://docs.rstudio.com/shinyapps.io/)** -::: columns +:::: columns ::: {.column width="70%"} ::: {.callout-tip title="Shinyapps.io" .my-callout} -- L’application est hébergée sur les serveurs de RStudio. - - formule gratuite : 5 applications Shiny avec un usage total cumulé de 25h/mois +- L’application est hébergée sur les serveurs de RStudio. + - formule gratuite : 5 applications Shiny avec un usage total cumulé de 25h/mois - - 13$/mois → 25 applications et 100 heures actives -- Déploiement en 1 clic -- Dashboard de suivi convivial + - 13$/mois → 25 applications et 100 heures actives +- Déploiement en 1 clic +- Dashboard de suivi convivial ::: ::: ::: {.column width="30%"} ::: {.callout-important title="Inconvénient" .my-callout} -- Dépendance à RStudio -- Freemium -- Taille de l’appli limité à 1Go (données externes comprises) +- Dépendance à RStudio +- Freemium +- Taille de l’appli limité à 1Go (données externes comprises) +::: +::: +:::: + +## Partager son application Shiny {.smaller} + +**[Binder](https://mybinder.readthedocs.io/en/latest/about/index.html): [read the doc](https://mybinder.readthedocs.io/en/latest/)** + +:::: columns +::: {.column style="font-size: 0.75em"} +Projet communautaire et ouvert qui a permis de créer des environnements reproductibles, partageables et interactifs, tel que BinderHub, que vous pouvez tester sur [mybinder.org](https://mybinder.org). + +Pour déployer une application Shiny sur Binder, `repo2docker` a besoin de 2 choses: +- un code source sur un dépôt Git (github, gitlab, etc.) +- des [fichiers de configuration](https://mybinder.readthedocs.io/en/latest/using/config_files.html#config-files) pour l'environnement, pour R par exemple : + - [`install.R`](https://mybinder.readthedocs.io/en/latest/using/config_files.html#install-r-install-an-r-rstudio-environment): installer les packages R nécessaires + - [`runtime.txt`](https://mybinder.readthedocs.io/en/latest/using/config_files.html#runtime-txt-specifying-runtimes): spécifier la version de R, et la date du snapshot + +::: + +::: {.column style="font-size: 0.75em"} + + +::: {.callout-tip title="Lien utile pour apprendre à déployer son code avec Binder"} +Turing Way maintient également un tutoriel [Zero-to-Binder](https://the-turing-way.netlify.app/communication/binder/zero-to-binder.html) pour les 3 langages de programmation commun (Python, Julia et R). +::: +::: {.callout-note title="exemples R avec binder"} +- [https://github.com/binder-examples/r](https://github.com/binder-examples/r) +::: +::: +:::: + + + +## Partager son application Shiny {.smaller} + +**[Hugging Face](https://huggingface.co/)** + +::: {.callout-tip title="Hugging Face Spaces" .my-callout} +- Spaces are Git repositories that host application code for Machine Learning demos. + - example: [https://huggingface.co/spaces/josephtran/shiny_palmerpenguins](https://huggingface.co/spaces/josephtran/shiny_palmerpenguins) +::: + +::: {.callout-important title="Inconvénient" .my-callout} +Each Spaces environment is limited to 16GB RAM, 2 CPU cores and 50GB of (not persistent) disk space by default, which you can use free of charge. Can [upgrade to a paid plan](https://huggingface.co/docs/hub/spaces-gpus) for more resources. ::: + +:::: columns +::: {.column width="50%"} + ::: + +::: {.column width="50%"} + ::: +:::: ## Partager son application Shiny -**Shiny Server** +**[Shiny Server](https://posit.co/download/shiny-server/)** ::: {.callout-tip title="version free"} - un processus R / application qui peut servir plusieurs utilisateurs @@ -770,6 +826,8 @@ YouTube video: guide pas à pas pour créer une application Shiny sans serveur  + + ## Partager son application Shiny {auto-animate="true"} **Déploiement avec SK8 (version kickflip, 2023)** @@ -792,7 +850,7 @@ Projet porté par **Jean-François Rey** puis porté par le CATI IMOTEP et passa **Déploiement avec SK8 (version kickflip, 2023)** ::: {style="font-size: 0.75em"} -Projet porté par Jean-François Rey puis porté par le CATI IMOTEP et passage en Inter-CATIs (2022). +Projet porté par **Jean-François Rey** puis porté par le CATI IMOTEP et passage en Inter-CATIs (2022). ::: ::: .r-stack @@ -852,7 +910,7 @@ Quelques exemples @INRAE Plus d'information sur le site web [https://sk8.inrae.fr](https://sk8.inrae.fr/) ::: - +{width=80% style="text-align: center;"} ## Take Home Message