Installing Shiny Server and RStudio Server on AWS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
good morning my name is Freddy Renan I'm a data optimization engineer with the company called digital first media in Denver I have two very active puppies right behind me so I apologize if they're a little bit loud I'm gonna help you get set up with our studio server and our studio like the shiny server one caveat is that this is come on let's go one caveat is that I'm doing this on Mac and lack and you there's some some extra steps that make it a little bit more complicated to do on windows so it's the case where you actually have to log into the terminal okay I'm gonna throw the bone downstairs and see if they'll just follow it okay all right so let's get started first we're gonna sign in one thing to note is that I believe her name is Kimberly Coffee has created an excellent overview of setting this up there were a couple instances where I need something different and that's gonna be covered here as well okay able to sign in here okay alright sign inside okay we're gonna look for ec2 click on it we're going to launch an instance we're going to select Ubuntu we are this is where we we decide the you know the the CPUs and and memory this is actually editable that's even word later on and I'll show you how to do that when ever get to that point yes we're going to configure the instance details and he prepped the bone upstairs before she did okay the next thing we're going to skip beer at storage you could pick you know 30 gigs or something next add tags skip next configure security group this is important we're gonna add two rules each are going to be anywhere and then this is going to be three eight three eight and this one is going to be eight seven eighty seven these are the ports for shiny server and our studio server respectively alright so we've got our micro instance and we also have 30 gigs here these are our ports and we are good to launch first thing we need to create a key pair this is kind of like the password allowing you to SSH into the terminal we're gonna create a new key pair and we're going I'm just going to call this AWS example you could call it shiny or our studio whatever you want to know it okay next we're going to download this key pair oh I walked through this earlier um AWS or I double-checked everything before I started this okay that one key pair and then launch instance so Amazon is getting everything started but there's a couple things that we're going to do before we can actually get into the server I'm going to open up my terminal here and what you'll notice is that it's probably in your download folder wherever you downloaded this AWS key file we're gonna have to change the modifications the reason being is that you because this secure shell you can't necessarily log into that and it's my best explanation so let's do that we're going to chmod 400 AWS rpm okay and then we see that the modification the permissions have been changed you alright next thing to do it appears that our instance here is now up and running oh it's still initializing so let's just give it a second here I don't think clicking this is going to make any difference a lot of times it takes to spin up it feels good you know stocks are gonna be the death of me hey y'all go downstairs come on and of course you don't listen just waiting until this is set up and good to go skip ahead if you want to receiving changes than backtrack I guess I can't fast forward it really does feel good to hit this hey not crazy we got a new boxer puppy about four months ago and he's just hectic as can be I guess I'll just wait if I pet them they'll stop barking I have to do all this one-handed or something alright let's just see if we connect why not so here's connect and we've already done this step so now we just copy-paste this while in the same directory that our key file is at night oops yes all right so it looks like it's up and running doing this still sis initializing I don't think it's gonna be that big of a deal okay well let's get started first thing to do is go to this website which I'll link in the YouTube video and we've done most of the steps except now we're going to come down here and just do some copy paste so this is to actually install shiney here this is adding one of those sources to that sources list and that's done so then let's just keep copy paste we're not going to copy/paste everything though like we don't need this package fpp unless unless you need it and then we're going to actually install a newer version of shiny studio or shiny server sorry and we'll just I guess hang out here while this gets done listen to my dog's bark just updating everything the been since itself nothing to do with our okay here just hit okay and okay next next one still our base for this in a second whenever we install some of these are packages this is my preferred way of installing our packages here at eight of us whenever I install packages in the terminal in our studio server shiny can't seem to find them so if anyone has any explanation for that cool if not just install them this way and then it'll work for you or should work for you I don't know I can't see that takes few minutes this is just running a little our script from the terminal here to install shiny then we'll do our markdown now my dogs are literally under my feet so I guess have a footrest now till they start biting my toes okay so after shinies installed over here you will solar wash down they really are obnoxious they've been quiet all morning okay until now right our markdown and while our markdown is installing let's not use her commands let's go to SHINee server our studio and we're going to install the newest version download open source should have done everything else except for these commands here so once this is done we'll get it get it installed oh that is so wrong I already done that did that already completed the task should learn English okay all Z no window keys he can see controls he Christ did he do this exit exit okay hold on key command where you could get out of these things okay sorry don't do that okay just like just randomly type in things okay so we're gonna install this now it's kind of like me on stackoverflow feel like good things my job of Stack Overflow didn't exist it's randomly copying and pasting commands written by a third-grader somewhere hoping it works okay yes okay so now that we've done this we should actually be able to go to our instance so which one is this this is a WS r so we could actually copy paste this IP address and if everything is working correctly which we hope it is we type it in : and then 383 8 and you should have our shiny server shiny would be in stock vertically if this works and then our markdown is installed correctly if this works I recently kind of think actually when shiny apps and our markdown which is pretty cool okay so that's done but we're not done yet let's come over here and install shiny server where's it at you know at our studio server it's faster to find things on Google than at the actual website and we're just going to copy paste here oh wait we don't need to do that cuz we've already done that let's do W get then install yes I don't know what you want that yes okay now if we go back we've got : 87 87 yeah I've got our studio but we don't know how to login yet so let's fix that let's go back to the terminal and we are going to run I've got my notes here somewhere okay so we're gonna do sudo add user and then pick your username so I'm just going to say our studio and then pick a password don't forget it I don't need to remind myself of my name or any of that so it's all correct just press ENTER all the way through now we have a user cool but we don't have sued or sued over proven privileges so we're going to do that and this is how I figured out how to do it I don't know if there's a better way I'm sure that there is we're gonna do sudo vim /e TC and then sudo su do ers we're going to open up this file we're gonna scroll down and then right under here which says allowed members of group sudo we're just going to hit I to insert stuff using them we're going to type it in percent our studio all and this is our studios you know whatever username you decided and just copy what is exactly above to get out of them here's a here's a quick lesson because it will take you forever if not we're going to do escape and then hit shift : WQ exclamation port at point enter and now cat EGC o see it it's right there okay cool and now let's try this so we've got our studio and then your password now logged in and we could see a sudo works I don't know see though apt-get install Cal say no things just save in a different location anyways that wouldn't work but what we can do to test it out is let's install ggplot so let's just go back to that original file copy and paste and if it's working correctly then it should open up a script and run and and I've got seat of privileges so technically I mean you could you could access your AWS instance without even going in and doing the SSH stuff you can just log into the newest version of our studio and use the terminal there which is kind of cool so you know most people aren't necessarily gonna be using our studio server you know most of the time we'll be developing lovely and so what I wanted to do was show two ways that you could just get your shiny apps running hopefully this will get done soon maybe I should have waited a minute to do ggplot is it done nope just never done okay now we're going okay so one thing we could do is we could just we could we could you know do shiny up here so we can get any project and then directory shiny web application directory name let's just call this shiny app another thing to know is that you have to put your shiny app in the right spot so this is just create a shiny app let's open up the terminal I'll list everything in there you can see that you've got this hat here but what you need to know is where to put the shiny application so say you did develop a shiny application here you could simply just copy the application to the correct folder so we can do Co CP shiny at /and this is important SRV shiny server shiny - server and then shiny at um oh sorry everyone saw this was that for me right nobody doing wrong no I just did see what is going on here everything works until it doesn't know it's working okay maybe I just need to add the - are for recursive but I don't remember doing that so and maybe it was because I just started a new directory ahead and saved everything that's one of the other okay so now if we looked at this shiny I've here let's copy-paste this key over here type three eight three eight forward slash Shani app now you have your Old Faithful geyser data application running on your brand new Chinese server but let's not click there so this is I wanted to show you guys how I like to install applications so I you know typically we and work you know locally so we can start up our studio and I'm actually no I can just tell you you know you can set up your our studio server right sorry your shiny app you know here in our studio right push it to github and once it's actually on github just go to the repository and then clone or download clone the repository and then either here actually we'll just do here same see the SRP shiny server yes okay so let's remove shiny app and then OH sudo or okay and then sudo get loan yeah well we have our Sonya right there and come over here three eight three eight shiny app actually I don't want close out of this yet so let's copy this copy be shiny and there it is obviously like the name of the folder determines the you know file path up there so let's we can say like shiny app to my app oh maybe it's not a recursive thing so now this won't work shouldn't work but if we typed in my app okay dear okay a couple other I guess maybe housecleaning things just so you are aware this IP address here will change let's see if this is AWS are right here will change if you decide to shut it down so what you can do is you can come in here if you hit instant shape-up sorry instant state and then stop it will stop your AWS instance but then you can come in here to instance settings and you can change the instance type so this is where you would go in and say you know say you wanted like I don't know with AWS it's like I want 4 billion gigabytes and 3 million cores you can come in here and select your supercomputer from the future the other thing is that so like I said if you start stop it then this IP is going to try change and then this file path is going to change that's gonna get really annoying really quickly if you know you have a link to somewhere and then you know this changes and you have to go update everything every single time so come down to elastic IPS I'm already using one that you would either here with allocate new address directions associated address I believe link up a an IP address it should just be like a two-step process here an IP address with your ec2 instance and then it it won't change every time you shut it down so you know say you want to do some like crazy machine learning stuff or whatever and you're gonna use you know our parallel or something then go in increase it you have to pay a little bit extra but then once you're done shut it down then we start and start a smaller instance and it's that easy so I hope this was useful I'm sorry that I had crazy dogs but if you have any questions let me know I love this stuff I love our and you know newbie beacon been beginner questions aren't gonna bother me at all I'll answer them to the best of my ability obviously I don't have everything I'm just a guy so all right well it was good let me know
Info
Channel: Freddy Drennan
Views: 8,206
Rating: 5 out of 5
Keywords: Shiny Server, RStudio Server, R Programming, AWS
Id: hglgkFfRqyQ
Channel Id: undefined
Length: 28min 15sec (1695 seconds)
Published: Sun Nov 05 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.