gce_vm_template: Create a template container VM

Description Usage Arguments Details Value Examples

Description

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

Usage

1
2
3
4
gce_vm_template(template = c("rstudio", "shiny", "opencpu", "r-base",
  "dynamic", "rstudio-gpu", "rstudio-shiny"), username = NULL,
  password = NULL, dynamic_image = NULL, image_family = "cos-stable",
  wait = TRUE, ...)

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 for the template

image_family

An image-family. It must come from the cos-cloud family.

wait

Whether to wait for the VM to launch before returning. Default TRUE.

...

Arguments passed on to gce_vm_container

file

file location of a valid cloud-init or shell_script file. One of file or cloud_init or shell_script must be supplied

cloud_init

contents of a cloud-init file, for example read via readChar(file, nchars = 32768)

shell_script

contents of a shell_script file, for example read via readChar(file, nchars = 32768)

image_family

An image-family. It must come from the image_project family.

image_project

An image-project, where the image-family resides.

Details

Templates available are:

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.

Value

The VM object, or the VM startup operation if wait=FALSE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## 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)

googleComputeEngineR documentation built on May 6, 2019, 1:01 a.m.