R/buildsteps_gce.R
cr_buildstep_compute_container.Rd
This build step adds some helpers to cr_buildstep_gcloud for deploying to VMs to GCE that will auto create a container within them and atytach it to the disk
cr_buildstep_compute_container(
vm_name,
container_image = "gcr.io/gcer-public/persistent-rstudio:latest",
disk_name = paste0(vm_name, "-disk"),
disk_mount_path = "/home",
zone = "europe-west1-b",
disk_size = "10GB",
machine_type = "n1-standard-1",
container_env = "",
scopes = "cloud-platform",
network = "default",
gcloud_args = NULL
)
cr_buildstep_compute_rstudio(
rstudio_user,
rstudio_pw,
vm_name = "rstudio",
disk_name = "rstudio-disk",
zone = "europe-west1-b",
disk_size = "10GB",
machine_type = "n1-standard-1",
container_image = "gcr.io/gcer-public/persistent-rstudio:latest",
network = "default"
)
Name of the VM you will create
The Docker image that will be launched in the VM
Name of the disk that will be attached to the VM's container image
Where the disk will be attached to the container in the VM
Which zone the VM will launch within
The size of the disk
The type of VM that will be launched
Environment variables set within the VM's container image
The GCE scopes that the VM will be launched with permission to use
The network the VM will use. The container will bridge into the same network
Other gcloud arguments you send in e.g. c("--boot-disk-device-name=boot-disk1","--boot-disk-size=10GB")
The usename for the RStudio image the VM will launch
The password for the RStudio image the VM will launch
bs <- cr_buildstep_compute_rstudio("mark", "securepassword1234")
build <- cr_build_yaml(bs)
build
#> ==cloudRunnerYaml==
#> steps:
#> - name: gcr.io/google.com/cloudsdktool/cloud-sdk:alpine
#> args:
#> - gcloud
#> - compute
#> - instances
#> - create-with-container
#> - rstudio
#> - --container-env=--container-env=[ROOT=TRUE,USER=mark,PASSWORD=securepassword1234]
#> - --container-image=gcr.io/gcer-public/persistent-rstudio:latest
#> - --container-mount-disk=name=rstudio-disk,mount-path=/home/mark
#> - --create-disk=name=rstudio-disk,size=10GB
#> - --machine-type=n1-standard-1
#> - --scopes=cloud-platform
#> - --zone=europe-west1-b
#> - --network=default
if (FALSE) {
cr_build(build)
}