Closed muschellij2 closed 3 years ago
This package was the last I ever used missing()
within as it caused a lot of issues like this. I'd be happy to remove all references to it.
I hit this today, creating my first VM with googleComputeEngineR.
In my case, I was using code I copied from the docs (pkgdown site and examples).
vm <- gce_vm(
template = "rstudio",
name = "gargle-gce-rstudio-server",
username = "jenny", password = "1234"
)
#> 2021-11-04 15:14:35> Creating template VM
#> Error in (function (name, predefined_type = "f1-micro", image_project = "debian-cloud", :
#> Must supply one of 'predefined_type', or both 'cpus' and 'memory' arguments.
I got unstuck, but it would be good to handle this with a default and/or make it clear that it's a required argument.
I hit another, related bug with dynamic_image
, which I'll open an issue about.
If not specified, the gce_vm()
and gce_vm_template()
will use predefined_type="n1-standard-1". A message will say so to give you a chance to specify your own
Starting template VM with type n1-standard-1 - see gce_list_machinetype() for other options and specify via argument 'predefined_type'
Describe the bug In
gce_vm_create
we have https://github.com/cloudyr/googleComputeEngineR/blob/d62f8989571cfe9cfbeb97250808aee6e29f9cb4/R/vms.R#L278, ifpredefined_type
is not set, it moves toNULL
, but the default isf1-micro
https://github.com/cloudyr/googleComputeEngineR/blob/d62f8989571cfe9cfbeb97250808aee6e29f9cb4/R/vms.R#L248. It seems as though this always needs to be specified (orcpus
andmemory
).So
gce_vm
callsgce_vm_template
at https://github.com/cloudyr/googleComputeEngineR/blob/d62f8989571cfe9cfbeb97250808aee6e29f9cb4/R/vms.R#L98, which then callsgce_vm_container
https://github.com/cloudyr/googleComputeEngineR/blob/d62f8989571cfe9cfbeb97250808aee6e29f9cb4/R/template.R#L120, which then callsgce_vm_create
https://github.com/cloudyr/googleComputeEngineR/blob/d62f8989571cfe9cfbeb97250808aee6e29f9cb4/R/container.R#L78. Now ifpredefined_type
is not set ingce_vm
then it will fail as you can see belowExpected behavior Use the default of
f1-micro
. So I'd probably take out themissing(predefined_type)
?To Reproduce
Created on 2021-07-30 by the reprex package (v2.0.0)
Session info
``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.1.0 (2021-05-18) #> os Debian GNU/Linux 10 (buster) #> system x86_64, linux-gnu #> ui X11 #> language (EN) #> collate C.UTF-8 #> ctype C.UTF-8 #> tz Etc/UTC #> date 2021-07-30 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> askpass 1.1 2019-01-13 [2] CRAN (R 4.1.0) #> assertthat 0.2.1 2019-03-21 [2] CRAN (R 4.1.0) #> cachem 1.0.5 2021-05-15 [2] CRAN (R 4.1.0) #> cli 2.5.0 2021-04-26 [2] CRAN (R 4.1.0) #> codetools 0.2-18 2020-11-04 [4] CRAN (R 4.0.4) #> crayon 1.4.1 2021-02-08 [2] CRAN (R 4.1.0) #> curl 4.3.1 2021-04-30 [2] CRAN (R 4.1.0) #> DBI 1.1.1 2021-01-15 [2] CRAN (R 4.1.0) #> digest 0.6.27 2020-10-24 [2] CRAN (R 4.1.0) #> dplyr 1.0.7 2021-06-18 [2] CRAN (R 4.1.0) #> ellipsis 0.3.2 2021-04-29 [2] CRAN (R 4.1.0) #> evaluate 0.14 2019-05-28 [2] CRAN (R 4.1.0) #> fansi 0.5.0 2021-05-25 [2] CRAN (R 4.1.0) #> fastmap 1.1.0 2021-01-25 [2] CRAN (R 4.1.0) #> fs 1.5.0 2020-07-31 [2] CRAN (R 4.1.0) #> future 1.21.0 2020-12-10 [2] CRAN (R 4.1.0) #> gargle 1.1.0 2021-04-02 [2] CRAN (R 4.1.0) #> gcloud * 0.3.0 2021-07-30 [1] local #> generics 0.1.0 2020-10-31 [2] CRAN (R 4.1.0) #> globals 0.14.0 2020-11-22 [2] CRAN (R 4.1.0) #> glue 1.4.2 2020-08-27 [2] CRAN (R 4.1.0) #> googleAuthR 1.4.0 2021-04-02 [2] CRAN (R 4.1.0) #> googleComputeEngineR * 0.3.0.9000 2021-07-28 [1] local #> highr 0.9 2021-04-16 [2] CRAN (R 4.1.0) #> htmltools 0.5.1.1 2021-01-22 [2] CRAN (R 4.1.0) #> httr 1.4.2 2020-07-20 [2] CRAN (R 4.1.0) #> jsonlite 1.7.2 2020-12-09 [2] CRAN (R 4.1.0) #> knitr 1.33 2021-04-24 [2] CRAN (R 4.1.0) #> lifecycle 1.0.0 2021-02-15 [2] CRAN (R 4.1.0) #> listenv 0.8.0 2019-12-05 [2] CRAN (R 4.1.0) #> magrittr 2.0.1 2020-11-17 [2] CRAN (R 4.1.0) #> memoise 2.0.0 2021-01-26 [2] CRAN (R 4.1.0) #> openssl 1.4.4 2021-04-30 [2] CRAN (R 4.1.0) #> parallelly 1.26.0 2021-06-09 [2] CRAN (R 4.1.0) #> pillar 1.6.1 2021-05-16 [2] CRAN (R 4.1.0) #> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.1.0) #> processx 3.5.2 2021-04-30 [2] CRAN (R 4.1.0) #> ps 1.6.0 2021-02-28 [2] CRAN (R 4.1.0) #> purrr 0.3.4 2020-04-17 [2] CRAN (R 4.1.0) #> R6 2.5.0 2020-10-28 [2] CRAN (R 4.1.0) #> reprex 2.0.0 2021-04-02 [2] CRAN (R 4.1.0) #> rlang 0.4.11 2021-04-30 [2] CRAN (R 4.1.0) #> rmarkdown 2.9 2021-06-15 [2] CRAN (R 4.1.0) #> rstudioapi 0.13 2020-11-12 [2] CRAN (R 4.1.0) #> sessioninfo 1.1.1 2018-11-05 [2] CRAN (R 4.1.0) #> stringi 1.6.2 2021-05-17 [2] CRAN (R 4.1.0) #> stringr 1.4.0 2019-02-10 [2] CRAN (R 4.1.0) #> tibble 3.1.2 2021-05-16 [2] CRAN (R 4.1.0) #> tidyselect 1.1.1 2021-04-30 [2] CRAN (R 4.1.0) #> utf8 1.2.1 2021-03-12 [2] CRAN (R 4.1.0) #> vctrs 0.3.8 2021-04-29 [2] CRAN (R 4.1.0) #> withr 2.4.2 2021-04-18 [2] CRAN (R 4.1.0) #> xfun 0.24 2021-06-15 [2] CRAN (R 4.1.0) #> yaml 2.2.1 2020-02-01 [2] CRAN (R 4.1.0) #> #> [1] /home/jupyter/.R/library #> [2] /usr/local/lib/R/site-library #> [3] /usr/lib/R/site-library #> [4] /usr/lib/R/library ```