{"id":497,"date":"2017-08-07T02:07:29","date_gmt":"2017-08-06T16:07:29","guid":{"rendered":"http:\/\/togaware.com\/?p=497"},"modified":"2021-03-05T16:57:06","modified_gmt":"2021-03-05T05:57:06","slug":"the-azure-linux-data-science-virtual-machine","status":"publish","type":"post","link":"https:\/\/togaware.com\/the-azure-linux-data-science-virtual-machine\/","title":{"rendered":"Open Source R on the Azure Ubuntu Data Science Virtual Machine"},"content":{"rendered":"
Data scientists rely on the freedom to innovate that is afforded by open source software. We often deploy an open source software stack based on Ubuntu GNU\/Linux <\/a>and the R Statistical Software.<\/a> This provides a powerful environment for the management, wrangling, analysis, modeling, and presentation of data within a tool that supports machine learning and artificial intelligence, including deep neural networks in R<\/a>.<\/p>\n Whilst the open source software stack is also usually free of licensing fees we do still need to buy hardware on which to carry out our data science activities. Our own desktop and laptop computers will often suffice but as more data becomes available and our algorithms become more complex, having access to a Data Science Super Computer could be handy. The cloud offers cheap access to compute when you need it and the Azure Ubuntu Data Science Virtual Machine<\/a> (DSVM) has become a great platform for my data science when I need it. The Ubuntu DSVM comes pre-installed with an extensive suite of all of the open source software that I need as a data scientist (including Rattle<\/a> and RStudio<\/a>).<\/p>\n <\/p>\n A new data science virtual machine can be deployed with with a few clicks and some minimal information in less than 5 minutes. As our data and compute needs grow it can be resized to suit. Paying for just the compute as required (e.g., at 25 cents per hour) is an attractive proposition and powering down the server when not in use saves me considerably compared to having a departmental server running full time, irrespective of its workload. When not required we can deallocate the server to cost us nothing.\u00a0 There is no need for expensive high-specification hardware sitting on-premise waiting for the high demand loads when they are needed. Simply allocate and resize the virtual machine as and when needed and pay for the hardware you need when you need, not just in case you need it.<\/p>\n The version of R provided with the Linux Data Science Virtual Machine is Microsoft’s R Server (closed source<\/strong>). This is based on the open source version of R but with added support for beyond RAM datasets of any size<\/em> with parallel<\/em> implementations of many of the machine learning algorithms for the data scientist. In the instructions below though please note that we replace Microsoft R Server as the default R with open source R. Both are then concurrently available on the server.<\/p>\n I begin with a link to obtaining a free trial subscription (if you don’t already have an Azure subscription) and then continue to set up the Ubuntu DSVM using the Azure Portal and configuring the new server with various extra Linux packages (that are not yet on the DSVM by default – but stay tuned) as well as an updated version of open source R and Rattle. Note that the deployment and setup of the DSVM can also be completed from R running on our own laptops or desktops using our new AzureDSVM<\/a> R package. This then allows the process to be programmed.<\/p>\n The following looks like a lot of steps, and maybe so, but each is simple and the whole process is really straight forward. If you disagree, please let me know and we’ll work on it.<\/p>\n Obtain an Azure subscription<\/b><\/p>\n Create a Linux Data Science Virtual Machine<\/b><\/p>\n Connect using X2Go on your local desktop (Linux or Windows) Run RStudio Server on the DSVM<\/strong><\/p>\n You may need to start the server: $ sudo rstudio-server start<\/li>\n Install support packages and latest R Desktop R Studio<\/strong><\/p>\n RStudio can be used through the browser from your local machine as we saw above, or else on the remote server’s desktop. For the latter:<\/p>\n Graham @ Microsoft Data scientists rely on the freedom to innovate that is afforded by open source software. We often deploy an open source software stack based on Ubuntu GNU\/Linux and the R Statistical Software. This provides a powerful environment for the management, wrangling, analysis, modeling, and presentation of data within a tool that supports machine learning and […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[48],"tags":[29,36,37,35],"_links":{"self":[{"href":"https:\/\/togaware.com\/wp-json\/wp\/v2\/posts\/497"}],"collection":[{"href":"https:\/\/togaware.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/togaware.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/togaware.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/togaware.com\/wp-json\/wp\/v2\/comments?post=497"}],"version-history":[{"count":74,"href":"https:\/\/togaware.com\/wp-json\/wp\/v2\/posts\/497\/revisions"}],"predecessor-version":[{"id":939,"href":"https:\/\/togaware.com\/wp-json\/wp\/v2\/posts\/497\/revisions\/939"}],"wp:attachment":[{"href":"https:\/\/togaware.com\/wp-json\/wp\/v2\/media?parent=497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/togaware.com\/wp-json\/wp\/v2\/categories?post=497"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/togaware.com\/wp-json\/wp\/v2\/tags?post=497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}\n
\n
\n
\n
\n<\/em><\/li>\n\n
\n
\n
\n
\n<\/em><\/li>\n
\n<\/b><\/p>\n\n
\n
$ wajig install x2goclient<\/pre>\n<\/li>\n
$ wajig addrepo ppa:x2go\/<\/span>stable\r\n$ wajig update\r\n$ wajig install x2goclient<\/pre>\n<\/li>\n<\/ul>\n<\/li>\n
\n
$ ssh xyz@dsvmxyz01.southeastasia.cloudapp.azure.com\r\nWarning: Permanently added the ED25519 host key ...\r\nxyz@dsvmxyz01...'s password:\r\nWelcome to Ubuntu 16.04.2 LTS (GNU\/Linux 4.4...)\r\n\r\n* Documentation: https:\/\/help.ubuntu.com\r\n* Management: https:\/\/landscape.canonical.com\r\n* Support: https:\/\/ubuntu.com\/advantage\r\n\r\nGet cloud support with Ubuntu Advantage Cloud Guest:\r\nhttp:\/\/www.ubuntu.com\/business\/services\/cloud\r\n\r\n178 packages can be updated.\r\n1 update is a security update.\r\n...\r\n$<\/pre>\n<\/li>\n<\/ol>\n
\n
$ wget https:\/\/download2.rstudio.org\/rstudio-server-1.0.153-amd64.deb\r\n$ wajig install rstudio-server-1.0.153-amd64.deb\r\n$ wget https:\/\/download1.rstudio.org\/rstudio-xenial-1.0.153-amd64.deb\r\n$ wajig install rstudio-xenial-1.0.153-amd64.deb<\/pre>\n
Username: xyz\r\nPassword: h%nHs72Gs#jK\r\n<\/pre>\n<\/li>\n<\/ol>\n
\n<\/b><\/p>\n\n
$ sudo apt-get install wajig\r\n$ wajig remove msodbcsql\r\n$ wajig update\r\n$ wajig distupgrade\r\n$ wajig install htop libcanberra-gtk-module\r\n$ sudo locale-gen \"en_AU.UTF-8\"\r\n$ sudo reboot\r\n<\/pre>\n<\/li>\n
$ wajig addrepo ppa:marutter\/rrutter\r\n$ wajig addrepo ppa:marutter\/c2d4u\r\n$ wajig update\r\n$ wajig distupgrade\r\n$ wajig install r-recommended r-cran-rattle r-cran-tidyverse\r\n$ wajig install r-cran-xml r-cran-cairodevice r-cran-rpart.plot\r\n$ sudo Rscript -e 'install.packages(\"rattle\", repos=\"http:\/\/rattle.togaware.com\")'\r\n<\/pre>\n<\/li>\n
$ R\r\n> library(rattle)\r\n> rattle()\r\nClick: Execute; Yes; Model tab; Execute; Draw; Close; Yes\r\n<\/pre>\n<\/li>\n<\/ol>\n
\n
\n<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"