# dspda-script-worker
DSPDA script worker project

The Pluto R Script Wrapper application provides R scripts execution REST API

To Run the app the R-Server is required to be installed.
Fow Windows:
download the R from https://cran.r-project.org/bin/windows/base/
install and run the R application.
In R command prompt run the commands:

install.packages("Rserve");
library(Rserve);
Rserve();

Or execute it directly from (the path just example) "C:\PROGRA~1\R\R-34~1.2\library\Rserve\libs\x64\Rserve.exe" in cmd

Important: the Rserve is not thread safe for Windows, use it ony on development purposes with one script execution at time
If it is required to share the wrapper between clients USE LINUX ONLY !!!

### Distribution

There are two Docker build configurations placed under the `<root>` folder that might be used to distribute the 
service to the final customers. Building the Docker image using the `Dockerfile` from the `<root>/docker` directory 
creates an image that might be used for building an all-in-one Pluto Docker image. The second configuration, 
placed under the `<root>/docker_off_server` directory must be used only for the multi-images distribution (off-server).
Run the following commands to build a necessary docker image (run them from the `<root>` folder):
- `docker build -t dspda-script-worker:latest -f docker/Dockerfile .`
- `docker build -t dspda-script-worker-off-server:latest -f docker_off_server/Dockerfile .`
