class: center, middle, inverse, title-slide # 03
computing infrastructure ## π« with RStudio Cloud!
π
bit.ly/design-ds-eku-web
### dr. mine Γ§etinkaya-rundel ### 9 april 2021 --- class: middle .pull-left[ .huge-text[Why] ] .pull-right[ .larger[ RStudio in the cloud? ] ] --- .pull-left[ ### lots of friction points - Install R - Install RStudio - Install the following packages: - rmarkdown - tidyverse - ... - Load these packages - Install git ] -- .pull-right[ ### much less friction - Go to rstudio.cloud - Log in ```r >hello R! ``` ] --- .pull-left[ ### go from this <img src="img/jonathan-borba-PZBjJ12Xv2s-unsplash.jpg" width="70%" /> ] -- .pull-right[ ### to this easily <img src="img/sincerely-media-o5Key-1HzaY-unsplash.jpg" width="80%" /> ] .footnote[ .tiny[Photos by Jonathan Borba and Sincerely Media on Unsplash.] ] --- class: middle .pull-left[ .huge-text[How] ] .pull-right[ .larger[ RStudio in the cloud? ] ] --- .pull-left[ **RStudio Server Pro** __*__ You have... - sysadmin experience / IT support - hardware / local VM / cloud computing credit - RStudio experience .midi[See [RStudio Academic Pricing](https://rstudio.com/pricing/academic-pricing/), freely licensed for teaching purposes.] ] .pull-right[ **RStudio Cloud** You have... - RStudio experience ] .footnote[ .small[ __*__ Γetinkaya-Rundel, Mine, and Rundel, Colin. "Infrastructure and tools for teaching computing throughout the statistical curriculum." The American Statistician (2018). Part of the Practical Data Science for Stats collection. [[Peer J]](https://peerj.com/preprints/3181/) [[TAS]](https://doi.org/10.1080/00031305.2017.1397549) ] ] --- class: middle .pull-left[ .huge-text[Hello] ] .pull-right[ .larger[ RStudio Cloud ] ] --- ## What is RStudio Cloud? <br> .pull-left-narrow[ <img src="img/cloud.png" width="264" /> ] .pull-right-wide[ .large[We created [**RStudio Cloud**](https://rstudio.cloud/) to make it easy for professionals, hobbyists, trainers, teachers, and students to do, share, teach, and learn data science using R.] ] --- class: middle, center <img src="img/rstudio-ide.png" width="100%" /> --- class: middle, center <img src="img/rstudio-cloud.png" width="100%" /> --- ## Why RStudio Cloud? - Does not require IT support -- - Git works out of the box - Knit to PDF and Word works out of the box -- - Features designed for instructors --- ## Contexts - Shorter workshops: Likely no opportunity to communicate pre-workshop instructions, varied computing background and learning goals - Semester long courses - Intro data science / statistics: little to no background in stats, data science, programming - Upper level data science / statistics: Varied computing background and different computer setups --- ## RStudio Cloud: First look <img src="img/landing-1.png" width="80%" style="display: block; margin: auto;" /> --- ## Workspaces - When you create an account on RStudio Cloud you get a workspace of your own - You can add a new workspace and control its permissions - Projects in either workspace can be public or private --- ## A framework for workspaces <img src="img/landing-2.png" width="90%" style="display: block; margin: auto;" /> --- ## Projects .pull-left[ A new project in RStudio Cloud <img src="img/new-project-cloud.png" width="90%" style="display: block; margin: auto;" /> ] .pull-right[ is a new project in RStudio IDE <img src="img/new-project-local.png" width="90%" style="display: block; margin: auto;" /> ] .alert[ **PSA:** If you use RStudio, use projects! Trust me, you wonβt regret it. Find out more on [R for Data Science](https://r4ds.had.co.nz/workflow-projects.html). ] --- ## Projects from Git .pull-left[ A new project from Git repo in RStudio Cloud <img src="img/new-project-git-cloud.png" width="90%" style="display: block; margin: auto;" /> ] .pull-right[ is the same as a new project from Git in RStudio IDE <img src="img/new-project-git-local.png" width="90%" style="display: block; margin: auto;" /> ] Both options `clone` a Git repo --- ## Sharing options - Option 1: Share a single project - Option 2: Invite users to a workspace (presumably with many projects) --- class: middle # Sharing option .pull-left[ .huge-number[1] ] .pull-right[ .larger[ Single project ] ] --- class: middle .center[ <img src="img/cloud-setup-tweet.png" width="80%" style="display: block; margin: auto;" /> ] --- class: middle .center[ .larger[ π©βπ« teacher ] .larger[ π©βπ» student ] ] --- ## π©βπ« Creating and sharing a single project .center[ <iframe width="896" height="504" src="https://www.youtube.com/embed/81MrMcKZTX8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> ] --- ## π©βπ» Receiving and working on a shared project .center[ <iframe width="896" height="504" src="https://www.youtube.com/embed/_VCYdDQTFG8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> ] --- .your-turn[ .midi[ π©βπ«: Identify one person in the group as **instructor** π©βπ»: Rest of the group are **students** ] #### π©βπ« Instructor: - Create a new project and give it a name - Install a package of your choice - Create a template R Markdown document in the project - Change the access level of the project so others can see it as well - Copy the project URL and share it with the rest of the group #### π©βπ» Students: Access your instructor's project and pick up where they left off ]
10
:
00
--- ## Pros / cons: Sharing a single project .pull-left[ ### Good! - Students land directly in a project upon login - Works well for workshops where all work will be completed in a single project - Also great for sharing code in general, e.g. collaboration, reprexes, etc. ] -- .pull-right[ ### Not so good... - Students need to remember to make a copy of the project (which means you need to remember to remind them!) - You can't keep track which students started their assignment - Students control permissions - You can't easily peek into student projects -- they would need to explicitly share the project with you ] --- class: middle # Sharing option .pull-left[ .huge-number[2] ] .pull-right[ .larger[ Work- space ] ] --- ## π©βπ« Creating a workspace .center[ <iframe width="896" height="504" src="https://www.youtube.com/embed/tqu1m9R1HLw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> ] --- ## π©βπ« Workspace membership <img src="img/workspace-members.png" width="70%" style="display: block; margin: auto;" /> --- ## π©βπ« Role permissions <br> | role | permission | course role | |-------------|--------------------------------------------------|-------------| | admin | manage users, view, edit and manage all projects | instructor | | moderator | view, edit and manage all projects | TA | | contributor | create, edit and manage their own projects | student | | viewer | view projects shared with everyone | auditor | --- ## π©βπ« Other permissions <br> #### Under the Members tab: .pull-left-narrow[ <img src="img/permissions.png" width="100%" /> ] .pull-right-wide[ - By default, all permissions are turned off - Think carefully before checking these boxes ] --- ## π©βπ« Options <br> #### Under the Members tab: .pull-left-narrow[ <img src="img/workspace-access.png" width="100%" /> ] .pull-right-wide[ - Make workspace shared for a short period of time, share link with students, enrol them as contributors. - After initial round of enrolment (e.g. drop/add) switch over to this access level - Use invitations for visitors added mid-semester ] --- ## π©βπ« Inviting a student to a workspace .center[ <img src="img/invite-to-workspace.png" width="70%" style="display: block; margin: auto;" /> ] --- ## Base projects One of the most attractive features of RStudio Cloud! - Packages you want *installed* on all student projects -- - Text documents you want to appear on **all** student projects (e.g. code of conduct, turn-in instructions, etc.) -- - Applies to all projects created **after** base project has been specified, doesn't apply retroactively -- - Can be updated as many times as you like throughout the course (without having to convince your IT!!!) --- ## π©βπ« Setting up your base project .center[ <iframe width="896" height="504" src="https://www.youtube.com/embed/Fz9UR6uxAG4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> ] --- .your-turn[ .midi[ #### π©βπ« Instructor: - Create a new workspace, give it a name, add a short description - Change the settings of your workspace to Shared - Add a base project to your workspace: - Create a new project - Install one or two of your favourite packages - Create an R Markdown document and knit it - Make this project visible to everyone - In the settings menu for the workspace, set it as base project - Create a new assignment: `Homework 01` - Grab the sharing link for your workspace, share with your group #### π©βπ» Students: - Join your instructor's workspace and start the assignment ] ]
15
:
00
--- ## Git integration π Only relevant if teaching with Git & GitHub! -- π Base project template can be used, so new project from Git also has the right packages installed! --- ## Pros / cons: Sharing a workspace .pull-left[ ### Good! - Various permission levels - Base projects with desired packages installed - Assignments -- no more "make a copy of the project before starting work" - Peek into studentsβ projects <img src="img/view-derived-projects.png" width="80%" style="display: block; margin: auto;" /> ] -- .pull-right[ ### Not so good... - Students land in the workspace, may need to provide instructions for the next steps - Git config for each project can get tedious and doesn't reflect realistic practice ] --- ## Common pitfalls - Changes you make after student launches a project under either model (single project or workspace) wonβt propagate to their project -- - Packages in the base project will be **installed** in all projects in the workspace, but not **loaded** - If you need students to run code in the Console that requires a package, your instructions should remind them to load the package first - If using Rmd document, add a `load-package` chunk on top --- ## Feedback / questions / troubleshooting - Check out [status.rstudio.com](https://status.rstudio.com/) - Post on [RStudio Community](https://community.rstudio.com/c/rstudio-cloud) - Email [support@rstudio.cloud](mailto:support@rstudio.cloud) <img src="img/rstudio-cloud-sidebar.png" width="70%" style="display: block; margin: auto;" /> --- class: middle, inverse # Parting remarks --- ## Tips - Each project is allocated 1GB of RAM (but you can increase this!) - Test things out before assignments involving large datasets - What your students see is not always what you see - Create a secondary account and add as a student --- ## More tips Make brief screencasts for getting students oriented with the platform (especially if remote teaching), or use mine! .center[ [Navigating RStudio Cloud on YouTube](https://www.youtube.com/playlist?list=PLNUVZZ6hfXX05Bs80Hg5MjbOPnEFmwiOM) ] <img src="img/youtube-playlist.png" width="50%" style="display: block; margin: auto;" /> --- ## More tips Remind students how to hide the sidebar! <img src="img/rstudio-cloud-hide-sidebar.png" width="70%" style="display: block; margin: auto;" /> --- ## More tips .large[ [RStudio Cloud guide](https://rstudio.cloud/learn/guide) ] <iframe width="900" height="450" src="https://rstudio.cloud/learn/guide" frameborder="0" style="background:white;"></iframe> --- ## π¦ rscloud - You can access RStudio Cloud's API to manage space members programatically using the **rscloud** package: - You will need to create client credentials to use the package. You can create credentials at [login.rstudio.cloud/identity](https://login.rstudio.cloud/identity). ```r # install.packages("rscloud") devtools::install_github("rstudio/rscloud") ``` --- ## Pricing .large[ [rstudio.cloud/plans](https://rstudio.cloud/plans) ] <iframe width="900" height="450" src="https://rstudio.cloud/plans/free/" frameborder="0" style="background:white;"></iframe>