as.cluster.gce_instance: Create a future cluster for GCE objects

Description Usage Arguments Details Value Examples

View source: R/future.R

Description

S3 method for as.cluster() in the future package.

Usage

1
2
3
4
5
6
7
8
9
## S3 method for class 'gce_instance'
as.cluster(
  x,
  project = gce_get_global_project(),
  zone = gce_get_global_zone(),
  rshopts = ssh_options(x),
  ...,
  recursive = FALSE
)

Arguments

x

The instance to make a future cluster

project

The GCE project

zone

The GCE zone

rshopts

Options for the SSH

...

Other arguments passed to makeDockerClusterPSOCK

recursive

Not used.

Details

Only works for r-base containers created via gce_vm_template("r-base") or for docker containers created using the --net=host argument flag

Value

A cluster object.

Examples

1
2
3
4
5
6
7
## Not run: 
vm <- gce_vm("r-base", name = "future", predefined_type = "f1-micro")
plan(cluster, workers = vm)  ## equivalent to workers = as.cluster(vm)
x %<-% { Sys.getinfo() }
print(x)

## End(Not run)

cloudyr/googleComputeEngineR documentation built on Jan. 23, 2022, 8:30 a.m.