Adding doc about RTVS daemon installation.

This commit is contained in:
Karthik Nadig 2017-10-23 11:11:10 -07:00
Родитель 44498badf3
Коммит 8c7cdfa7a5
2 изменённых файлов: 134 добавлений и 0 удалений

4
.gitignore поставляемый
Просмотреть файл

@ -103,3 +103,7 @@ TestFiles/
*.ide
*.ide-journal
*.lock
/src/.vs/R/v15/sqlite3/storage.ide-wal
/src/.vs/R/v15/sqlite3/storage.ide-shm
/src/.vs/R/v15/Server/sqlite3/storage.ide-wal
/src/.vs/R/v15/Server/sqlite3/storage.ide-shm

Просмотреть файл

@ -0,0 +1,130 @@
# Remote R Service for Linux
Remote R Service for Linux is currently packaged as rtvs-daemon. The daemon is supported and tested on Ubuntu 16.04, 16.10 LTS desktop, server, and Windows Subsystem for Linux running Ubuntu.
## Setting up Remote R Service
### On physical Ubuntu machine
After starting up follow these steps:
1. Log on to the machine and download rtvs-daemon tarball:
`wget -O rtvs-daemon.tar.gz https://aka.ms/r-remote-services-linux-binary-current`
`tar -xvzf rtvs-daemon.tar.gz`
2. Run the preinstall script:
`sudo ./rtvs-install`
3. Enable and start the service:
`sudo systemctl enable rtvsd`
4. [required for production] Configure SSL certificate:
By default, `rtvs-daemon` uses the `ssl-cert-snakeoil.pem` and `ssl-cert-snakeoil.pem` generated by `ssl-cert` pacakge. During installation we combine them into `ssl-cert-snakeoil.pfx`. For production purposes use the SSL certificate provided by your admin. SSL certificate can be configured by providing a PFX file and optional import password, in: `/etc/rtvs/rtvsd.config.json`
5. [optional] Check service is running:
`ps -A -f | grep rtvsd`
If you dont see a process running under the user name `rtvssvc`. Start it using the following command:
`sudo systemctl start rtvsd`
### On Ubuntu Server VM on Azure
You will need Putty for windows, or other SSH client.
1. Log into https://portal.azure.com
2. Go to Virtual Machines and click on Add.
3. This should bring up available VM images. Search for `Ubuntu Server 16.04 LTS`
4. Select it and set the deployment model as `Resource manager` and hit create.
5. Choose a name for the VM, type in username and password (password is required, we dont support SSH public key login). Make changes as needed to the VM configuration.
6. In the next tab choose a VM size. Verify the configuration and hit create. It will take a while to build the VM.
7. Once it is done, in the Networking tab for the VM add `5444` as an allowed inbound port. If you want to use a different port, you can configure that in config file for rtvs daemon which can be found here: `/etc/rtvs/rtvsd.config.json`.
8. [optional] Set a DNS name, you can also use the IP address.
9. Connect to the VM using SSH client, and download the rtvs daemon tarball.
`wget -O rtvs-daemon.tar.gz https://aka.ms/r-remote-services-linux-binary-current`
`tar -xvzf rtvs-daemon.tar.gz`
10. Run the preinstall script:
`sudo ./rtvs-install`
11. Enable and start the service:
`sudo systemctl enable rtvsd`
12. [required for production] Configure SSL certificate:
By default, `rtvs-daemon` uses the `ssl-cert-snakeoil.pem` and `ssl-cert-snakeoil.pem` generated by `ssl-cert` pacakge. During installation we combine them into `ssl-cert-snakeoil.pfx`. For production purposes use the SSL certificate provided by your admin. SSL certificate can be configured by providing a PFX file and optional import password, in: `/etc/rtvs/rtvsd.config.json`
13. [optional] Check service is running:
`ps -A -f | grep rtvsd`
If you dont see a process running under the user name rtvssvc. Start it using the following command:
`sudo systemctl start rtvsd`
### On Ubuntu DSVM on Azure
You will need Putty for windows, or other SSH client.
1. Log into https://portal.azure.com
2. Go to Virtual Machines and click on Add.
3. This should bring up available VM images. Search for `Linux Data Science`.
4. Select the linux DSVM iamge and set the deployment model as `Resource manager` and hit create.
5. Choose a name for the VM, type in username and password (password is required, we dont support SSH public key login). Make changes as needed to the VM configuration.
6. In the next tab choose a VM size. Verify the configuration and hit create. It will take a while to build the VM.
7. Once it is done, in the Networking tab for the VM add `5444` as an allowed inbound port. If you want to use a different port, you can configure that in config file for rtvs daemon which can be found here: `/etc/rtvs/rtvsd.config.json`.
8. [optional] Set a DNS name, you can also use the IP address.
9. Connect to the VM using SSH client, and download the rtvs daemon tarball:
`wget -O rtvs-daemon.tar.gz https://aka.ms/r-remote-services-linux-binary-current`
`tar -xvzf rtvs-daemon.tar.gz`
10. Run the preinstall script:
`sudo ./rtvs-install`
11. Enable and start the service:
`sudo systemctl enable rtvsd`
12. [required for production] Configure SSL certificate:
By default, `rtvs-daemon` uses the `ssl-cert-snakeoil.pem` and `ssl-cert-snakeoil.pem` generated by `ssl-cert` pacakge. During installation we combine them into `ssl-cert-snakeoil.pfx`. For production purposes use the SSL certificate provided by your admin. SSL certificate can be configured by providing a PFX file and optional import password, in: `/etc/rtvs/rtvsd.config.json`
13. [optional] Check service is running:
`ps -A -f | grep rtvsd`
If you dont see a process running under the user name rtvssvc. Start it using the following command:
`sudo systemctl start rtvsd`
### On Windows Subsystem for Linux (WSL)
1. Instructions to setup WSL.
https://msdn.microsoft.com/en-us/commandline/wsl/install_guide
2. Start bash on Windows and download rtvs daemon tarball:
`wget -O rtvs-daemon.tar.gz https://aka.ms/r-remote-services-linux-binary-current`
`tar -xvzf rtvs-daemon.tar.gz`
3. Run the install script:
`sudo ./rtvs-install`
4. [required for production] Configure SSL certificate:
By default, `rtvs-daemon` uses the `ssl-cert-snakeoil.pem` and `ssl-cert-snakeoil.pem` generated by `ssl-cert` pacakge. During installation we combine them into `ssl-cert-snakeoil.pfx`. For production purposes use the SSL certificate provided by your admin. SSL certificate can be configured by providing a PFX file and optional import password, in: `/etc/rtvs/rtvsd.config.json`
5. Start rtvs daemon, execute the following command:
`rtvsd`
Note: WSL currently does not support systemd/systemctl interfaces.
### In a local Docker container (clean build)
1. Dockerfile contents:
```
FROM ubuntu:16.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y software-properties-common python-software-properties \
&& apt-get install -y apt-transport-https \
&& rm -rf /var/lib/apt/lists/*
RUN sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list' \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893 \
&& sh -c 'echo "deb https://cran.revolutionanalytics.com/bin/linux/ubuntu xenial/" > /etc/apt/sources.list.d/cran-r.list' \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9 \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
RUN apt-get update --fix-missing && apt-get update \
&& apt-get install -y dotnet-dev-1.0.4 libexplain51 libzip4 libc6 git lshw ssl-cert wget \
&& rm -rf /var/lib/apt/lists/*
# install R
RUN apt-get update && apt-get install -y r-base-dev
RUN apt upgrade -y
# install rtvs-daemon
RUN wget -O rtvs-daemon.tar.gz https://aka.ms/r-remote-services-linux-binary-current && tar -xvzf rtvs-daemon.tar.gz && ./rtvs-install -s
RUN useradd --create-home ruser1
RUN echo "ruser1:foobar" | chpasswd
EXPOSE 5444
```
This will install Remote R service daemon and the latest version of R. Note the **username** and **password**, you will need this to connect to the container.
2. Build and run the above docker file:
`docker build -t myrimage .`
`docker run -p 5444:5444 myrimage rtvsd`
3. You can connect to this container from RTVS. Use `https://localhost:5444` as the path, username `ruser1`, and password `foobar`.