Learn R Programming

googleComputeEngineR (version 0.1.0)

gce_vm_template: Create a template container VM

Description

This lets you specify templates for the VM you wnat to launch It passes the template on to gce_vm_container

Usage

gce_vm_template(template = c("rstudio", "shiny", "opencpu", "r-base", "example", "rstudio-hadleyverse", "dynamic"), username = NULL, password = NULL, dynamic_image = NULL, image_family = "gci-stable", name, ...)

Arguments

template
The template available
username
username if needed (RStudio)
password
password if needed (RStudio)
dynamic_image
Supply an alternative to the default Docker image here to download
image_family
An image-family. It must come from the google-containers family.
name
The name of the resource, provided by the client when initially creating the resource
...
Other arguments passed to gce_vm_create

Value

The VM object

Details

Templates available are:

  • rstudio An RStudio server docker image
  • rstudio-hadleyverse RStudio with the tidyverse installed
  • shiny A Shiny docker image
  • opencpu An OpenCPU docker image
  • r_base Latest version of R stable
  • example A non-R test container running busybox
  • dynamic Supply your own docker image to download such as rocker/verse

For dynamic templates you will need to launch the docker image with any ports you want opened, other settings etc. via docker_run.

Use dynamic_image to override the default rocker images e.g. rocker/shiny for shiny, etc.

Examples

Run this code

## Not run: 
# 
#  library(googleComputeEngineR)
#  
#  ## make instance using R-base
#  vm <- gce_vm_template("r-base", predefined_type = "f1-micro", name = "rbase")
#  
#  ## run an R function on the instance within the R-base docker image
#  docker_run(vm, "rocker/r-base", c("Rscript", "-e", "1+1"), user = "mark")
#  #> [1] 2
#  
# 
# ## End(Not run)


Run the code above in your browser using DataLab