Create (if required), install the necessary prerequisites with all corresponding packages needed to deploy an explainer. Deploy a sample plumber application on a DigitalOcean virtual machine. You may sign up for a Digital Ocean account [here](https://m.do.co/c/add0b50f54c4). This command is idempotent, so feel free to run it on a single server multiple times. This command is a modified version of plumber's do_provision() which installs newer R version and packages needed for deploying an explainer with xai2cloud.

do_setup(droplet, model_package, example = TRUE, ...)

Arguments

droplet

The DigitalOcean droplet that you want to provision (see [analogsea::droplet()]). If empty, a new DigitalOcean server will be created.

model_package

Name of package used to build the model, eg: "randomForest", "gbm".

example

If `TRUE`, will deploy an example API named `hello` to the server on port 8000.

...

Arguments passed into the [analogsea::droplet_create()] function.

Details

Provisions a Ubuntu 16.04-x64 droplet with the following customizations: - A recent version of R installed (3.6.3) - plumber installed globally in the system library - all necesarry packages to ensure correct explainer plumbing - An example plumber API deployed at `/var/plumber` - A systemd definition for the above plumber API which will ensure that the plumber API is started on machine boot and respawned if the R process ever crashes. On the server you can use commands like `systemctl restart plumber` to manage your API, or `journalctl -u plumber` to see the logs associated with your plumber process. - The `nginx`` web server installed to route web traffic from port 80 (HTTP) to your plumber process. - `ufw` installed as a firewall to restrict access on the server. By default it only allows incoming traffic on port 22 (SSH) and port 80 (HTTP). - A 4GB swap file is created to ensure that machines with little RAM (the default) are able to get through the necessary R package compilations.