Binary files /tmp/tmpG3QDy4/SIjUCR5sHw/analogsea-0.8.0/build/vignette.rds and /tmp/tmpG3QDy4/WJlvWzjQAh/analogsea-0.9.0/build/vignette.rds differ diff -Nru analogsea-0.8.0/debian/changelog analogsea-0.9.0/debian/changelog --- analogsea-0.8.0/debian/changelog 2020-10-11 01:08:14.000000000 +0000 +++ analogsea-0.9.0/debian/changelog 2020-10-11 01:06:34.000000000 +0000 @@ -1,15 +1,22 @@ -analogsea (0.8.0-1cran1ppabionic0) bionic; urgency=medium +analogsea (0.9.0-1cran1.1804.0) bionic; urgency=medium - * Compilation for Ubuntu 18.04.3 LTS + * Compilation for Ubuntu 18.04.5 LTS * Build for c2d4u for R 3.5.0 - -- Michael Rutter Sun, 02 Feb 2020 02:34:28 +0000 + -- Michael Rutter Sun, 11 Oct 2020 01:06:34 +0000 + +analogsea (0.9.0-1cran1) testing; urgency=low + + * cran2deb svn: 362M with DB version 1. + + -- cran2deb4ubuntu Sat, 10 Oct 2020 16:57:04 -0400 + analogsea (0.8.0-1cran1) testing; urgency=low * cran2deb svn: 362M with DB version 1. - -- cran2deb4ubuntu Sat, 01 Feb 2020 19:26:55 -0500 + -- cran2deb4ubuntu Sat, 01 Feb 2020 19:27:05 -0500 analogsea (0.7.2-1cran1) testing; urgency=low diff -Nru analogsea-0.8.0/debian/compat analogsea-0.9.0/debian/compat --- analogsea-0.8.0/debian/compat 2020-10-11 01:08:14.000000000 +0000 +++ analogsea-0.9.0/debian/compat 2020-10-10 20:57:04.000000000 +0000 @@ -1 +1 @@ -7 \ No newline at end of file +9 \ No newline at end of file diff -Nru analogsea-0.8.0/debian/control analogsea-0.9.0/debian/control --- analogsea-0.8.0/debian/control 2020-10-11 01:08:14.000000000 +0000 +++ analogsea-0.9.0/debian/control 2020-10-10 20:57:04.000000000 +0000 @@ -5,8 +5,9 @@ Build-Depends: r-base-dev, r-cran-httr, r-cran-jsonlite, r-cran-magrittr, r-cran-yaml, xvfb, xauth, xfonts-base, r-base-core, debhelper (>> 4.1.0), cdbs -Standards-Version: 3.9.1 -Homepage: https://github.com/sckott/analogsea +Standards-Version: 4.1.4 +Homepage: https://github.com/sckott/analogsea (devel) + https://analogsea.icu/ (docs) Package: r-cran-analogsea Architecture: all @@ -15,9 +16,9 @@ Description: GNU R package "Interface to 'Digital Ocean'" . Provides a set of functions for interacting with the 'Digital Ocean' - API at , - including creating images, destroying them, rebooting, getting details - on regions, and available images. + API , including creating images, + destroying them, rebooting, getting details on regions, and available + images. . Author: Scott Chamberlain [aut, cre] (), Hadley Wickham [aut], diff -Nru analogsea-0.8.0/debian/source/format analogsea-0.9.0/debian/source/format --- analogsea-0.8.0/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ analogsea-0.9.0/debian/source/format 2020-10-10 20:57:04.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) \ No newline at end of file diff -Nru analogsea-0.8.0/DESCRIPTION analogsea-0.9.0/DESCRIPTION --- analogsea-0.8.0/DESCRIPTION 2020-01-30 09:00:17.000000000 +0000 +++ analogsea-0.9.0/DESCRIPTION 2020-10-08 17:00:02.000000000 +0000 @@ -1,10 +1,10 @@ Package: analogsea Title: Interface to 'Digital Ocean' Description: Provides a set of functions for interacting with the 'Digital - Ocean' API at , including + Ocean' API , including creating images, destroying them, rebooting, getting details on regions, and available images. -Version: 0.8.0 +Version: 0.9.0 Authors@R: c( person("Scott", "Chamberlain", role = c("aut", "cre"), email = "myrmecocystus@gmail.com", @@ -17,18 +17,18 @@ person("RStudio", role = "cph") ) License: MIT + file LICENSE -URL: https://github.com/sckott/analogsea +URL: https://github.com/sckott/analogsea (devel) https://analogsea.icu/ + (docs) BugReports: https://github.com/sckott/analogsea/issues LazyData: yes -VignetteBuilder: knitr Encoding: UTF-8 Language: en-US Imports: stats, utils, httr (>= 1.2.0), jsonlite (>= 1.1), magrittr, yaml Suggests: testthat, knitr, ssh (>= 0.6), aws.s3 -RoxygenNote: 7.0.2 +RoxygenNote: 7.1.1 NeedsCompilation: no -Packaged: 2020-01-29 22:51:58 UTC; sckott +Packaged: 2020-10-08 16:16:02 UTC; sckott Author: Scott Chamberlain [aut, cre] (), Hadley Wickham [aut], Winston Chang [aut], @@ -37,4 +37,4 @@ RStudio [cph] Maintainer: Scott Chamberlain Repository: CRAN -Date/Publication: 2020-01-30 09:00:17 UTC +Date/Publication: 2020-10-08 17:00:02 UTC diff -Nru analogsea-0.8.0/inst/doc/analogsea.html analogsea-0.9.0/inst/doc/analogsea.html --- analogsea-0.8.0/inst/doc/analogsea.html 2020-01-29 22:51:57.000000000 +0000 +++ analogsea-0.9.0/inst/doc/analogsea.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,701 +0,0 @@ - - - - - -Working with the Digital Ocean API - - - - - - - - - - - - - - - - - - - - -

Working with the Digital Ocean API

- -

Create a DO account

- -

If you don't already have one, create a DO account. -By using this link, you'll start with $10 in credits (enough for >600 hours of -computing on a 1 gb machine), and if you become a digital ocean customer we'll -get some DO credits for us to offset our costs for testing. Thanks :)

- -

Authenticate

- -

The best way to authenticate is to generate a personal access token -(https://cloud.digitalocean.com/settings/tokens/new) and save it in an -environment variable called DO_PAT. If you don't do this, you'll be prompted -to authenticate in your browser the first time you use analogsea.

- -

SSH keys

- -

analogsea allows you to interact with your droplet(s) from R via SSH. To do -this you need to setup SSH keys with Digital Ocean. Make sure you provide Digitial -Ocean your public key at https://cloud.digitalocean.com/ssh_keys. GitHub has -some good advice on creating a new public key if you don't already have one: -https://help.github.com/articles/generating-ssh-keys/.

- -

Note that when using ssh, you'll likely get warnings like

- -
-

The authenticity of host can't be established …

-
- -

This is normal, don't be worried about this.

- -

Note that if you want to connect over SSH to a droplet you have to -create the droplet with an SSH key with the ssh_keys parameter. If you -don't you can still interact with the droplet via the Digital Ocean API, -but you can't access the droplet over SSH.

- -

Create a droplet

- -

droplet_create() will create a droplet on your account. You can run it as -below without any inputs, and it will use sensible defaults:

- -
    -
  • The smallest memory size of 512mb
  • -
  • Ubuntu 14.04 box
  • -
  • Region sfo1
  • -
  • Uses your ssh key
  • -
  • Don't use ipv6
  • -
  • Don't allow backups
  • -
  • Don't allow private networking
  • -
- -

You can set all of these options in your .Rprofile file like -options(do_size = "8gb") for a default of 8 GB.

- -

The name given to the droplet is picked at random from a list of 1000 random names.

- -

You can of course set any of these parameters.

- -
droplet_create()
-
- -

You can also create many droplets at once:

- -
droplets_create()
-
- -

Get a droplet or droplets

- -

Listing droplets can be done in singular or plural fashion. droplet() accepts -a droplet ID, while droplets() list all droplets.

- -

If you don't have any droplets yet, you will get an empty list running -droplets(), and you of course can't pass in a droplet ID number to droplet() -if you don't have any droplets yet.

- -
library("analogsea")
-
- -
droplets()
-#> named list()
-
- -

Create a droplet

- -
droplet_create()
-
- -
#> Waiting for create .................
-
- -
#> <droplet>ErodedPosterity (31860257)
-#>   IP:        162.243.139.148
-#>   Status:    new
-#>   Region:    San Francisco 1
-#>   Image:     14.04.5 x64
-#>   Size:      512mb
-#>   Volumes:
-
- -

After creating a droplet and running droplets() again, we see a list of -our droplet(s)

- -
(drops <- droplets())
-
- -

Or we can pass in a droplet id to droplet(). There is a print.droplet() method -that is used to print a brief summary of each droplet.

- -
droplet(drops[[1]]$id)
-
- -
#> <droplet>droppy (31859471)
-#>   IP:        159.203.214.8
-#>   Status:    active
-#>   Region:    San Francisco 1
-#>   Image:     14.04.5 x64
-#>   Size:      512mb
-#>   Volumes:
-
- -

Get more detailed information on your droplet with summary(). This is a -summary.droplet() method, that is just a little more verbose than the -print.droplet() method

- -
droplet(drops[[1]]$id) %>% summary
-
- -
#> <droplet_detail>droppy (31859471)
-#>   Status: active
-#>   Region: San Francisco 1
-#>   Image: 14.04.5 x64
-#>   Size: 512mb ($0.00744 / hr)
-#>   Estimated cost ($): 0.002
-#>   Locked: FALSE
-#>   Created at: 2016-11-11T18:50:51Z UTC
-#>   Networks:
-#>      v4: ip_address (159.203.214.8), netmask (255.255.240.0), gateway (159.203.208.1), type (public)
-#>      v6: none
-#>   Kernel:
-#>   Snapshots:
-#>   Backups:
-#>   Tags:
-
- -

Actions on droplets

- -

Delete

- -

You can delete a droplet with droplet_delete(). Be careful, as this completely -removes your droplet. Backup your droplet or make an image if you want to use -the droplet later.

- -
droplet_create() %>%
-  droplet_delete()
-
- -
#> Waiting for create ..............................
-
- -

Actions

- -

List actions on a droplet, newer ones at the top. Here, list actions

- -
drops[[1]] %>% droplet_actions()
-
- -
#> [[1]]
-#> <action> rename (166715389)
-#>   Status: completed
-#>   Resource: droplet 31859471
-#>
-#> [[2]]
-#> <action> create (166715005)
-#>   Status: completed
-#>   Resource: droplet 31859471
-
- -

Then rename and list actions again

- -
drops[[1]] %>%
-  droplet_rename(name = "droppy") %>%
-  droplet_wait() %>%
-  droplet_actions()
-#> Waiting for rename ...
-#> [[1]]
-#> <action> rename (166715389)
-#>   Status: completed
-#>   Resource: droplet 31859471
-#>
-#> [[2]]
-#> <action> create (166715005)
-#>   Status: completed
-#>   Resource: droplet 31859471
-
- -

Snapshot

- -

Making a snapshot of a droplet can be done with droplet_snapshot(). This -action requires that you turn off the droplet first, then take the snapshot. -First, create a droplet

- -
d <- droplet_create(size = "2gb")
-
- -

Then power off, and take a snapshot, which gives an action object describing -that the snapshot is in progress.

- -
d %>%
-  droplet_power_off() %>%
-  droplet_wait() %>%
-  droplet_snapshot(name = "mynewsnap")
-#> Waiting for power_off ...................................................
-#> <action> snapshot (166715834)
-#>   Status: in-progress
-#>   Resource: droplet 31859617
-
- -

Regions

- -

The regions() function lists region slug names, full names, available sizes, -whether the region is available at all, and features.

- -

This helps you get an overview of region details, which you can select from -when creating droplets

- -
regions()
-
- -
#>    slug            name
-#> 1  nyc1      New York 1
-#> 2  sfo1 San Francisco 1
-#> 3  nyc2      New York 2
-#> 4  ams2     Amsterdam 2
-#> 5  sgp1     Singapore 1
-#> 6  lon1        London 1
-#> 7  nyc3      New York 3
-#> 8  ams3     Amsterdam 3
-#> 9  fra1     Frankfurt 1
-#> 10 tor1       Toronto 1
-#> 11 sfo2 San Francisco 2
-#> 12 blr1     Bangalore 1
-#>                                                                                          sizes
-#> 1  512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb
-#> 2                                            512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb
-#> 3                                            512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb
-#> 4                                            512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb
-#> 5                                            512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb
-#> 6  512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb
-#> 7  512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb
-#> 8                                            512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb
-#> 9  512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb
-#> 10 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb
-#> 11 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb
-#> 12 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb
-#>    available                                             features
-#> 1       TRUE private_networking, backups, ipv6, metadata, storage
-#> 2       TRUE          private_networking, backups, ipv6, metadata
-#> 3       TRUE          private_networking, backups, ipv6, metadata
-#> 4       TRUE          private_networking, backups, ipv6, metadata
-#> 5       TRUE          private_networking, backups, ipv6, metadata
-#> 6       TRUE          private_networking, backups, ipv6, metadata
-#> 7       TRUE          private_networking, backups, ipv6, metadata
-#> 8       TRUE          private_networking, backups, ipv6, metadata
-#> 9       TRUE private_networking, backups, ipv6, metadata, storage
-#> 10      TRUE          private_networking, backups, ipv6, metadata
-#> 11      TRUE private_networking, backups, ipv6, metadata, storage
-#> 12      TRUE          private_networking, backups, ipv6, metadata
-
- -

Sizes

- -

The sizes() function lists size slug names, associated memory, vcpus, disk -size, prices, and regions where the size is available.

- -

This helps you get an overview of sizes, which you can select from -when creating droplets

- -
sizes()
-
- -
#>       slug memory vcpus disk transfer price_monthly price_hourly available
-#> 1    512mb    512     1   20        1             5      0.00744      TRUE
-#> 2      1gb   1024     1   30        2            10      0.01488      TRUE
-#> 3      2gb   2048     2   40        3            20      0.02976      TRUE
-#> 4      4gb   4096     2   60        4            40      0.05952      TRUE
-#> 5      8gb   8192     4   80        5            80      0.11905      TRUE
-#> 6     16gb  16384     8  160        6           160      0.23810      TRUE
-#> 7   m-16gb  16384     2   30        6           120      0.17857      TRUE
-#> 8     32gb  32768    12  320        7           320      0.47619      TRUE
-#> 9   m-32gb  32768     4   90        7           240      0.35714      TRUE
-#> 10    48gb  49152    16  480        8           480      0.71429      TRUE
-#> 11  m-64gb  65536     8  200        8           480      0.71429      TRUE
-#> 12    64gb  65536    20  640        9           640      0.95238      TRUE
-#> 13 m-128gb 131072    16  340        9           960      1.42857      TRUE
-#> 14 m-224gb 229376    32  500       10          1680      2.50000      TRUE
-#>                                                                          region
-#> 1  ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1
-#> 2  ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1
-#> 3  ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1
-#> 4  ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1
-#> 5  ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1
-#> 6  ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1
-#> 7                                      blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1
-#> 8        ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1
-#> 9                                      blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1
-#> 10       ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1
-#> 11                                     blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1
-#> 12       ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1
-#> 13                                     blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1
-#> 14                                     blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1
-
- -

Keys

- -

We suggest you use SSH keys to interact with Digital Ocean from analogsea. -There are a variety of functions for working with SSH keys.

- -

List your keys

- -
keys()
-
- -
#> $`Scott Chamberlain`
-#> <key> Scott Chamberlain (89103)
-#>   Fingerprint: 6b:2e:f6:be:e7:b4:58:0e:2a:a0:23:7e:16:ac:fc:17
-#>
-#> $`Scott Chamberlain`
-#> <key> Scott Chamberlain (700950)
-#>   Fingerprint: ba:5e:64:f4:c7:53:d1:5c:22:24:f0:84:12:f4:7b:03
-
- -

Get a key by id

- -
key(keys()[[1]]$id)
-
- -
#> <key> Scott Chamberlain (89103)
-#>   Fingerprint: 6b:2e:f6:be:e7:b4:58:0e:2a:a0:23:7e:16:ac:fc:17
-
- -

You can also create a key, rename a key, and delete a key

- -
k <- key_create("key", readLines("~/.ssh/id_rsa.pub"))
-k <- key_rename(k, "new_name")
-key_delete(k)
-
- -

Note that if you're on Windows you may experience some problems connecting -over SSH. We hope to resolve these problems as soon as possible.

- -

Images

- -

The images() function can list both your own private images, and public images. -If public=FALSE only your private images are listed, while if public=TRUE, -your private images are listed along with publicly avaialble images.

- -
images(page = 4, per_page = 5)
-
- -
#> $`24 x64`
-#> <image> 24 x64 (18027532)
-#>   Slug:    fedora-24-x64 [public]
-#>   Distro:  Fedora
-#>   Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1
-#>
-#> $`GitLab 8.9.4 CE on 14.04`
-#> <image> GitLab 8.9.4 CE on 14.04 (18285322)
-#>   Slug:    gitlab [public]
-#>   Distro:  Ubuntu
-#>   Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1
-#>
-#> $`7.11 x32`
-#> <image> 7.11 x32 (18290419)
-#>   Slug:     [public]
-#>   Distro:  Debian
-#>   Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1
-#>
-#> $`7.2 x64`
-#> <image> 7.2 x64 (18325354)
-#>   Slug:     [public]
-#>   Distro:  CentOS
-#>   Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1
-#>
-#> $`10.3 zfs`
-#> <image> 10.3 zfs (18818640)
-#>   Slug:    freebsd-10-3-x64-zfs [public]
-#>   Distro:  FreeBSD
-#>   Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1
-
- -

You can also do various actions on images. First, you can pass in an image ID to -the image() function to get an image object.

- -
img <- images(per_page = 1)[[1]]
-image(img$id)
-
- -
#> <image> 1192.2.0 (beta) (20666772)
-#>   Slug:    coreos-beta [public]
-#>   Distro:  CoreOS
-#>   Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1
-
- -

You can rename an image

- -
img %>% image_rename(name = "analog")
-
- -

You can transfer an image to another region

- -
image(img$id) %>% image_transfer(region = "sfo2")
-
- -

Domains

- -

You can use domain names for your droplets on Digital Ocean. analogsea has -a variety of functions to work with domain names.

- -

List domain names

- -
domains()
-
- -
#> $fishbaseapi.info
-#> <domain> fishbaseapi.info
-#>   ttl: 1800
-
- -

Create a new domain name

- -
dom <- paste0(sample(words, 1), ".info")
-domain_create(name = dom, ip_address = "127.0.0.1")
-
- -
#> <domain> leptometer.info
-#>   ttl:
-
- -

Get a single domain by domain name

- -
domain(dom)
-
- -
#> <domain> leptometer.info
-#>   ttl: 1800
-
- -

Create a domain record, list records and delete the one just created

- -
domain(dom) %>%
-  domain_record_create(type = "TXT", name = "hello", data = "world")
-
- -
#> <domain_record> 19285352
-#>   TXT world
-
- -
records <- domain(dom) %>% domain_records()
-domain_record_delete(records[[length(records)]])
-
- -

List records

- -
domain(dom) %>% domain_records()
-
- -
#> [[1]]
-#> <domain_record> 19285348
-#>   NS ns1.digitalocean.com
-#>
-#> [[2]]
-#> <domain_record> 19285349
-#>   NS ns2.digitalocean.com
-#>
-#> [[3]]
-#> <domain_record> 19285350
-#>   NS ns3.digitalocean.com
-#>
-#> [[4]]
-#> <domain_record> 19285351
-#>   A 127.0.0.1
-
- -

Delete a domain name, returns nothing if delete is successful

- -
domain(dom) %>% domain_delete()
-
- - - - diff -Nru analogsea-0.8.0/inst/doc/analogsea.Rmd analogsea-0.9.0/inst/doc/analogsea.Rmd --- analogsea-0.8.0/inst/doc/analogsea.Rmd 2019-06-25 16:48:29.000000000 +0000 +++ analogsea-0.9.0/inst/doc/analogsea.Rmd 1970-01-01 00:00:00.000000000 +0000 @@ -1,569 +0,0 @@ - - - -Working with the Digital Ocean API -====== - -## Create a DO account - -If you don't already have one, [create a DO account](https://www.digitalocean.com/?refcode=0740f5169634). -By using this link, you'll start with $10 in credits (enough for >600 hours of -computing on a 1 gb machine), and if you become a digital ocean customer we'll -get some DO credits for us to offset our costs for testing. Thanks :) - -## Authenticate - -The best way to authenticate is to generate a personal access token -() and save it in an -environment variable called `DO_PAT`. If you don't do this, you'll be prompted -to authenticate in your browser the first time you use analogsea. - -## SSH keys - -`analogsea` allows you to interact with your droplet(s) from R via SSH. To do -this you need to setup SSH keys with Digital Ocean. Make sure you provide Digitial -Ocean your public key at . GitHub has -some good advice on creating a new public key if you don't already have one: -. - -Note that when using ssh, you'll likely get warnings like - -> The authenticity of host can't be established ... - -This is normal, don't be worried about this. - -Note that if you want to connect over SSH to a droplet you have to -create the droplet with an SSH key with the `ssh_keys` parameter. If you -don't you can still interact with the droplet via the Digital Ocean API, -but you can't access the droplet over SSH. - -## Create a droplet - -`droplet_create()` will create a droplet on your account. You can run it as -below without any inputs, and it will use sensible defaults: - -* The smallest memory size of 512mb -* Ubuntu 14.04 box -* Region sfo1 -* Uses your ssh key -* Don't use ipv6 -* Don't allow backups -* Don't allow private networking - -You can set all of these options in your `.Rprofile` file like -`options(do_size = "8gb")` for a default of 8 GB. - -The name given to the droplet is picked at random from a list of 1000 random names. - -You can of course set any of these parameters. - - -```r -droplet_create() -``` - -You can also create many droplets at once: - - -```r -droplets_create() -``` - -## Get a droplet or droplets - -Listing droplets can be done in singular or plural fashion. `droplet()` accepts -a droplet ID, while `droplets()` list all droplets. - -If you don't have any droplets yet, you will get an empty list running -`droplets()`, and you of course can't pass in a droplet ID number to `droplet()` -if you don't have any droplets yet. - - -```r -library("analogsea") -``` - - -```r -droplets() -#> named list() -``` - -Create a droplet - - -```r -droplet_create() -``` - -``` -#> Waiting for create ................. -``` - -``` -#> ErodedPosterity (31860257) -#> IP: 162.243.139.148 -#> Status: new -#> Region: San Francisco 1 -#> Image: 14.04.5 x64 -#> Size: 512mb -#> Volumes: -``` - -After creating a droplet and running `droplets()` again, we see a list of -our droplet(s) - - - - -```r -(drops <- droplets()) -``` - -Or we can pass in a droplet id to `droplet()`. There is a `print.droplet()` method -that is used to print a brief summary of each droplet. - - -```r -droplet(drops[[1]]$id) -``` - -``` -#> droppy (31859471) -#> IP: 159.203.214.8 -#> Status: active -#> Region: San Francisco 1 -#> Image: 14.04.5 x64 -#> Size: 512mb -#> Volumes: -``` - -Get more detailed information on your droplet with `summary()`. This is a -`summary.droplet()` method, that is just a little more verbose than the -`print.droplet()` method - - -```r -droplet(drops[[1]]$id) %>% summary -``` - -``` -#> droppy (31859471) -#> Status: active -#> Region: San Francisco 1 -#> Image: 14.04.5 x64 -#> Size: 512mb ($0.00744 / hr) -#> Estimated cost ($): 0.002 -#> Locked: FALSE -#> Created at: 2016-11-11T18:50:51Z UTC -#> Networks: -#> v4: ip_address (159.203.214.8), netmask (255.255.240.0), gateway (159.203.208.1), type (public) -#> v6: none -#> Kernel: -#> Snapshots: -#> Backups: -#> Tags: -``` - - -## Actions on droplets - -### Delete - -You can delete a droplet with `droplet_delete()`. Be careful, as this completely -removes your droplet. Backup your droplet or make an image if you want to use -the droplet later. - - -```r -droplet_create() %>% - droplet_delete() -``` - -``` -#> Waiting for create .............................. -``` - -### Actions - -List actions on a droplet, newer ones at the top. Here, list actions - - -```r -drops[[1]] %>% droplet_actions() -``` - -``` -#> [[1]] -#> rename (166715389) -#> Status: completed -#> Resource: droplet 31859471 -#> -#> [[2]] -#> create (166715005) -#> Status: completed -#> Resource: droplet 31859471 -``` - -Then rename and list actions again - - -```r -drops[[1]] %>% - droplet_rename(name = "droppy") %>% - droplet_wait() %>% - droplet_actions() -#> Waiting for rename ... -#> [[1]] -#> rename (166715389) -#> Status: completed -#> Resource: droplet 31859471 -#> -#> [[2]] -#> create (166715005) -#> Status: completed -#> Resource: droplet 31859471 -``` - -### Snapshot - -Making a snapshot of a droplet can be done with `droplet_snapshot()`. This -action requires that you turn off the droplet first, then take the snapshot. -First, create a droplet - - -```r -d <- droplet_create(size = "2gb") -``` - -Then power off, and take a snapshot, which gives an action object describing -that the snapshot is in progress. - - -```r -d %>% - droplet_power_off() %>% - droplet_wait() %>% - droplet_snapshot(name = "mynewsnap") -#> Waiting for power_off ................................................... -#> snapshot (166715834) -#> Status: in-progress -#> Resource: droplet 31859617 -``` - -## Regions - -The `regions()` function lists region slug names, full names, available sizes, -whether the region is available at all, and features. - -This helps you get an overview of region details, which you can select from -when creating droplets - - -```r -regions() -``` - -``` -#> slug name -#> 1 nyc1 New York 1 -#> 2 sfo1 San Francisco 1 -#> 3 nyc2 New York 2 -#> 4 ams2 Amsterdam 2 -#> 5 sgp1 Singapore 1 -#> 6 lon1 London 1 -#> 7 nyc3 New York 3 -#> 8 ams3 Amsterdam 3 -#> 9 fra1 Frankfurt 1 -#> 10 tor1 Toronto 1 -#> 11 sfo2 San Francisco 2 -#> 12 blr1 Bangalore 1 -#> sizes -#> 1 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb -#> 2 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb -#> 3 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb -#> 4 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb -#> 5 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb -#> 6 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb -#> 7 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb -#> 8 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb -#> 9 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb -#> 10 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb -#> 11 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb -#> 12 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb -#> available features -#> 1 TRUE private_networking, backups, ipv6, metadata, storage -#> 2 TRUE private_networking, backups, ipv6, metadata -#> 3 TRUE private_networking, backups, ipv6, metadata -#> 4 TRUE private_networking, backups, ipv6, metadata -#> 5 TRUE private_networking, backups, ipv6, metadata -#> 6 TRUE private_networking, backups, ipv6, metadata -#> 7 TRUE private_networking, backups, ipv6, metadata -#> 8 TRUE private_networking, backups, ipv6, metadata -#> 9 TRUE private_networking, backups, ipv6, metadata, storage -#> 10 TRUE private_networking, backups, ipv6, metadata -#> 11 TRUE private_networking, backups, ipv6, metadata, storage -#> 12 TRUE private_networking, backups, ipv6, metadata -``` - -## Sizes - -The `sizes()` function lists size slug names, associated memory, vcpus, disk -size, prices, and regions where the size is available. - -This helps you get an overview of sizes, which you can select from -when creating droplets - - -```r -sizes() -``` - -``` -#> slug memory vcpus disk transfer price_monthly price_hourly available -#> 1 512mb 512 1 20 1 5 0.00744 TRUE -#> 2 1gb 1024 1 30 2 10 0.01488 TRUE -#> 3 2gb 2048 2 40 3 20 0.02976 TRUE -#> 4 4gb 4096 2 60 4 40 0.05952 TRUE -#> 5 8gb 8192 4 80 5 80 0.11905 TRUE -#> 6 16gb 16384 8 160 6 160 0.23810 TRUE -#> 7 m-16gb 16384 2 30 6 120 0.17857 TRUE -#> 8 32gb 32768 12 320 7 320 0.47619 TRUE -#> 9 m-32gb 32768 4 90 7 240 0.35714 TRUE -#> 10 48gb 49152 16 480 8 480 0.71429 TRUE -#> 11 m-64gb 65536 8 200 8 480 0.71429 TRUE -#> 12 64gb 65536 20 640 9 640 0.95238 TRUE -#> 13 m-128gb 131072 16 340 9 960 1.42857 TRUE -#> 14 m-224gb 229376 32 500 10 1680 2.50000 TRUE -#> region -#> 1 ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 2 ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 3 ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 4 ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 5 ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 6 ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 7 blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1 -#> 8 ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 9 blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1 -#> 10 ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 11 blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1 -#> 12 ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 13 blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1 -#> 14 blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1 -``` - -## Keys - -We suggest you use SSH keys to interact with Digital Ocean from `analogsea`. -There are a variety of functions for working with SSH keys. - -List your keys - - -```r -keys() -``` - -``` -#> $`Scott Chamberlain` -#> Scott Chamberlain (89103) -#> Fingerprint: 6b:2e:f6:be:e7:b4:58:0e:2a:a0:23:7e:16:ac:fc:17 -#> -#> $`Scott Chamberlain` -#> Scott Chamberlain (700950) -#> Fingerprint: ba:5e:64:f4:c7:53:d1:5c:22:24:f0:84:12:f4:7b:03 -``` - -Get a key by id - - -```r -key(keys()[[1]]$id) -``` - -``` -#> Scott Chamberlain (89103) -#> Fingerprint: 6b:2e:f6:be:e7:b4:58:0e:2a:a0:23:7e:16:ac:fc:17 -``` - -You can also create a key, rename a key, and delete a key - - -```r -k <- key_create("key", readLines("~/.ssh/id_rsa.pub")) -k <- key_rename(k, "new_name") -key_delete(k) -``` - -Note that if you're on Windows you may experience some problems connecting -over SSH. We hope to resolve these problems as soon as possible. - -## Images - -The `images()` function can list both your own private images, and public images. -If `public=FALSE` only your private images are listed, while if `public=TRUE`, -your private images are listed along with publicly avaialble images. - - -```r -images(page = 4, per_page = 5) -``` - -``` -#> $`24 x64` -#> 24 x64 (18027532) -#> Slug: fedora-24-x64 [public] -#> Distro: Fedora -#> Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1 -#> -#> $`GitLab 8.9.4 CE on 14.04` -#> GitLab 8.9.4 CE on 14.04 (18285322) -#> Slug: gitlab [public] -#> Distro: Ubuntu -#> Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1 -#> -#> $`7.11 x32` -#> 7.11 x32 (18290419) -#> Slug: [public] -#> Distro: Debian -#> Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1 -#> -#> $`7.2 x64` -#> 7.2 x64 (18325354) -#> Slug: [public] -#> Distro: CentOS -#> Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1 -#> -#> $`10.3 zfs` -#> 10.3 zfs (18818640) -#> Slug: freebsd-10-3-x64-zfs [public] -#> Distro: FreeBSD -#> Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1 -``` - -You can also do various actions on images. First, you can pass in an image ID to -the `image()` function to get an image object. - - -```r -img <- images(per_page = 1)[[1]] -image(img$id) -``` - -``` -#> 1192.2.0 (beta) (20666772) -#> Slug: coreos-beta [public] -#> Distro: CoreOS -#> Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1 -``` - -You can rename an image - - -```r -img %>% image_rename(name = "analog") -``` - -You can transfer an image to another region - - -```r -image(img$id) %>% image_transfer(region = "sfo2") -``` - -## Domains - -You can use domain names for your droplets on Digital Ocean. `analogsea` has -a variety of functions to work with domain names. - -List domain names - - -```r -domains() -``` - -``` -#> $fishbaseapi.info -#> fishbaseapi.info -#> ttl: 1800 -``` - -Create a new domain name - - -```r -dom <- paste0(sample(words, 1), ".info") -domain_create(name = dom, ip_address = "127.0.0.1") -``` - -``` -#> leptometer.info -#> ttl: -``` - -Get a single domain by domain name - - -```r -domain(dom) -``` - -``` -#> leptometer.info -#> ttl: 1800 -``` - -Create a domain record, list records and delete the one just created - - -```r -domain(dom) %>% - domain_record_create(type = "TXT", name = "hello", data = "world") -``` - -``` -#> 19285352 -#> TXT world -``` - -```r -records <- domain(dom) %>% domain_records() -domain_record_delete(records[[length(records)]]) -``` - -List records - - -```r -domain(dom) %>% domain_records() -``` - -``` -#> [[1]] -#> 19285348 -#> NS ns1.digitalocean.com -#> -#> [[2]] -#> 19285349 -#> NS ns2.digitalocean.com -#> -#> [[3]] -#> 19285350 -#> NS ns3.digitalocean.com -#> -#> [[4]] -#> 19285351 -#> A 127.0.0.1 -``` - -Delete a domain name, returns nothing if delete is successful - - -```r -domain(dom) %>% domain_delete() -``` diff -Nru analogsea-0.8.0/LICENSE analogsea-0.9.0/LICENSE --- analogsea-0.8.0/LICENSE 2020-01-15 19:33:18.000000000 +0000 +++ analogsea-0.9.0/LICENSE 2020-10-07 22:37:02.000000000 +0000 @@ -1,2 +1,2 @@ YEAR: 2020 -COPYRIGHT HOLDER: Scott Chamberlain; RStudio +COPYRIGHT HOLDER: Scott Chamberlain diff -Nru analogsea-0.8.0/man/adjectives.Rd analogsea-0.9.0/man/adjectives.Rd --- analogsea-0.8.0/man/adjectives.Rd 2017-05-06 16:17:27.000000000 +0000 +++ analogsea-0.9.0/man/adjectives.Rd 2020-10-07 22:20:22.000000000 +0000 @@ -11,6 +11,6 @@ } \details{ A vector of 999 adjectives. From the GitHub repo -\url{https://github.com/dariusk/corpora} - the data is licensed CC0. +https://github.com/dariusk/corpora - the data is licensed CC0. } \keyword{data} diff -Nru analogsea-0.8.0/man/analogsea-defunct.Rd analogsea-0.9.0/man/analogsea-defunct.Rd --- analogsea-0.8.0/man/analogsea-defunct.Rd 2019-05-31 00:31:32.000000000 +0000 +++ analogsea-0.9.0/man/analogsea-defunct.Rd 2020-10-07 22:20:22.000000000 +0000 @@ -8,9 +8,9 @@ } \details{ \itemize{ -\item \code{\link{tag_rename}}: DigitalOcean removed this functionality -from their API. See -\url{https://developers.digitalocean.com/documentation/changelog/api-v2/deprecating-update-tag/} +\item \code{tag_rename()}: DigitalOcean removed this functionality from their API. +See +https://developers.digitalocean.com/documentation/changelog/api-v2/deprecating-update-tag/ for details. } } diff -Nru analogsea-0.8.0/man/analogsea-package.Rd analogsea-0.9.0/man/analogsea-package.Rd --- analogsea-0.8.0/man/analogsea-package.Rd 2019-06-05 18:36:30.000000000 +0000 +++ analogsea-0.9.0/man/analogsea-package.Rd 2020-10-07 22:20:22.000000000 +0000 @@ -24,9 +24,9 @@ \pkg{analogsea} allows you to interact with your droplet(s) from R via SSH. To do this you need to setup SSH keys with Digital Ocean. Make sure you provide Digitial Ocean your public key at -\url{https://cloud.digitalocean.com/ssh_keys}. GitHub has some good advice +https://cloud.digitalocean.com/ssh_keys - GitHub has some good advice on creating a new public key if you don't already have one: -\url{https://help.github.com/articles/generating-ssh-keys}. +https://help.github.com/articles/generating-ssh-keys Note that when using ssh, you'll likely get warnings like "The authenticity of host can't be established ...". This is normal, don't be worried about @@ -39,14 +39,14 @@ } \author{ -Scott Chamberlain \email{myrmecocystus@gmail.com} +Scott Chamberlain -Hadley Wickham \email{hadley@rstudio.com} +Hadley Wickham -Winston Chang \email{winston@stdout.org} +Winston Chang -Bob Rudis \email{bob@rudis.net} +Bob Rudis -Bryce Mecum \email{brycemecum@gmail.com} +Bryce Mecum } \keyword{package} diff -Nru analogsea-0.8.0/man/debian.Rd analogsea-0.9.0/man/debian.Rd --- analogsea-0.8.0/man/debian.Rd 2019-12-21 00:57:52.000000000 +0000 +++ analogsea-0.9.0/man/debian.Rd 2020-02-13 23:38:49.000000000 +0000 @@ -9,6 +9,7 @@ \alias{debian_apt_get_update} \alias{debian_apt_get_install} \alias{install_r_package} +\alias{install_github_r_package} \title{Helpers for managing a debian droplets.} \usage{ debian_add_swap(droplet) @@ -28,7 +29,13 @@ debian_apt_get_install(droplet, ...) -install_r_package(droplet, package, repo = "http://cran.rstudio.com") +install_r_package(droplet, package, repo = "https://cloud.r-project.org/") + +install_github_r_package( + droplet, + package, + repo = "https://cloud.r-project.org/" +) } \arguments{ \item{droplet}{A droplet, or object that can be coerced to a droplet diff -Nru analogsea-0.8.0/man/droplet_functions.Rd analogsea-0.9.0/man/droplet_functions.Rd --- analogsea-0.8.0/man/droplet_functions.Rd 2019-05-31 00:31:32.000000000 +0000 +++ analogsea-0.9.0/man/droplet_functions.Rd 2020-10-07 22:20:22.000000000 +0000 @@ -11,9 +11,9 @@ \itemize{ \item DigitalOcean docs overview: -\url{https://developers.digitalocean.com/documentation/} +https://developers.digitalocean.com/documentation/ \item DigitalOcean API docs: -\url{https://developers.digitalocean.com/documentation/v2/} +https://developers.digitalocean.com/documentation/v2/ } } @@ -119,10 +119,10 @@ Install RStudio things: \itemize{ \item \code{\link[=docklet_rstudio]{docklet_rstudio()}}: install RStudio on your docklet using -Rocker images (\url{https://hub.docker.com/u/rocker}) +Rocker images (https://hub.docker.com/u/rocker) \item \code{\link[=docklet_rstudio_addusers]{docklet_rstudio_addusers()}}: add users to an RStudio docker image \item \code{\link[=docklet_shinyserver]{docklet_shinyserver()}}: install Shiny server on your docklet using -Rocker images (\url{https://hub.docker.com/u/rocker}) +Rocker images (https://hub.docker.com/u/rocker) \item \code{\link[=docklet_shinyapp]{docklet_shinyapp()}}: install a Shiny app on your Shiny server docker container } diff -Nru analogsea-0.8.0/man/nouns.Rd analogsea-0.9.0/man/nouns.Rd --- analogsea-0.8.0/man/nouns.Rd 2017-05-06 16:17:27.000000000 +0000 +++ analogsea-0.9.0/man/nouns.Rd 2020-10-07 22:20:22.000000000 +0000 @@ -11,6 +11,6 @@ } \details{ A vector of 1000 nouns From the GitHub repo -\url{https://github.com/dariusk/corpora} - the data is licensed CC0. +https://github.com/dariusk/corpora - the data is licensed CC0. } \keyword{data} diff -Nru analogsea-0.8.0/MD5 analogsea-0.9.0/MD5 --- analogsea-0.8.0/MD5 2020-01-30 09:00:17.000000000 +0000 +++ analogsea-0.9.0/MD5 2020-10-08 17:00:02.000000000 +0000 @@ -1,15 +1,15 @@ -f77bbe35cda9b586c2b41de4c09d19c1 *DESCRIPTION -8cbe8c11c4eac0975cb88db8045ef5ae *LICENSE -3c63abd28d27562101720aa11335105a *NAMESPACE -f7b343fa3cbe87183d6eafedad770f5d *NEWS.md +41655a8cf6986e186bd04507cc89e0d1 *DESCRIPTION +35bd8606c71dfbfad3ad27387e177ad4 *LICENSE +959c7f74df50a87d7495507eb0e0b551 *NAMESPACE +cb2b10104b2cad34c2a97dc0e2cde21d *NEWS.md 219c0f2580c208fbf64695cf87a44edb *R/account.R c1be78ff40e4283bf44aa726e5f5c15d *R/actions.R -8875cca41fbd68fb884a7d91924eb475 *R/analogsea-package.R +e613a0399269f42e3140eeb2ccbf7f42 *R/analogsea-package.R 9d64b31abd31c49fb2a84541869da16b *R/certificates.R 46c303f0dac7bbe373e306863d4f1680 *R/cloud_config.R 2fcc05fbba14b0d04814c9b7615f8579 *R/data.R -e9c5904dc46124aefba8aa7e79677b01 *R/debian.R -c537fd30601cdaef2874e6408cfb1ded *R/deprecated_defunct.R +5332ebc5e5582a710a2cd9a3199dcffc *R/debian.R +34cb3f40aa8a65e77af1c922ce8423df *R/deprecated_defunct.R 96e9bee18af7d94051ed402795172d17 *R/do_oauth.R 47925977575ad1c7bef7dae7223d7bb0 *R/do_options.R cf11ed57ec0162a3c8766f24af9cf2d6 *R/docklet.R @@ -17,10 +17,10 @@ 79cf94adfdadf51396acfd8cb877156f *R/docklets_create.R 22ce7645f9cb24b35c1262f32648719b *R/domain-records.R fb6a0714350e507378f96a72a00e4694 *R/domains.R -4decf1bde9462515eb9c26b8d98f6278 *R/droplet-actions.R -f5d9bd369c87a818eebbab5ef7efaddc *R/droplet-ssh.R +56af9e39a2206a2c3ed19d99c28daab5 *R/droplet-actions.R +d0c462e9aa7b55f108a55f683d9401a2 *R/droplet-ssh.R 2d59bfafb73820ad2b8cf102920b63c0 *R/droplet.R -3c06a0bb0b26c6671413bddc5fecfa42 *R/droplet_execute.R +5cfdaa8a063aa8cd703f00f0ecb8fa81 *R/droplet_execute.R a8ce25ff4ce62b79a68190e7c253b9a4 *R/droplet_freeze.R 9ff1e9667653119522e277008bdc29df *R/droplet_reuse.R b23788684d60bc437ccba70ed2f544d4 *R/droplets.R @@ -30,7 +30,7 @@ c815482f8f6f9dbc92ed093cab03c8b7 *R/globals.R 7a0f924fc25508b2d11cada4fa4f1f44 *R/httr.R b27fd89cd4d0cc10e58d516b9518c8b0 *R/images.R -6341c20948acf14eaea29014b05fc61a *R/info.R +806fb57b02c6182388a4644d90d69c2d *R/info.R d416b32d207f7634dc8f66d6b5a5558c *R/is_port_open.R 46c5b5cac07689084c38da8e3ed4aaef *R/keys.R 2149e7704da6898a64e0799596ea0c2f *R/onload.R @@ -47,11 +47,8 @@ a0d11466e0725e38b24fdcf97945e7b8 *R/volume-actions.R c6a54bf76f91ab5ca8ec4ba1bffd05d7 *R/volumes.R 47dd709733d386e4d29adaca161125e2 *R/zzz.R -f4c6820184411f2ca996a55ada4cc877 *README.md -fffafd4fd7662d364f780bb3c43fabaa *build/vignette.rds +d2a3ded5cd88ec6d7bdd7f03db08b65d *README.md 1e39b866f3805b1b298ad9a7d8a5b3c5 *inst/cloudconfig/ubuntu.yaml -2b3bcbddb9ee13878614ffc39f152af6 *inst/doc/analogsea.Rmd -0d7071d8ba276f6b226ee067834bb9ee *inst/doc/analogsea.html 00a88b6c31a74461d091e7c924e02710 *inst/examples/mpg/DESCRIPTION 9ecc57ace7f7c6e7616740bf06cce2d8 *inst/examples/mpg/Readme.md 3fdd0f2956c252bb440a8baec021366e *inst/examples/mpg/server.R @@ -66,15 +63,15 @@ b67752eee9843c279ca21d9a56f2621b *man/account.Rd 611cf3af361c86910b4f7e7dd25504dc *man/action.Rd d994a0b351482eaafa42012cccebf75c *man/actions.Rd -e49fd995fd5e4f7917a94b8044f6ef39 *man/adjectives.Rd -272455c7da86c57b6d6c3c3c63f729a4 *man/analogsea-defunct.Rd +c96a25c1c303721f0622bd774128d33f *man/adjectives.Rd +60f839725cdd17a8f75a4dbfd27c5ebf *man/analogsea-defunct.Rd 2bd6c1ee32a23d84268247a57ee6e264 *man/analogsea-deprecated.Rd -5248dfb2746512a50928e1db9aa46e4f *man/analogsea-package.Rd +5bd3b0a00aa89467371aaa03e247dfff *man/analogsea-package.Rd e1df8622dc1c922185b4595c38c595e7 *man/as.space.Rd abf717d77780fd591915e97608ecd24a *man/certificate_delete.Rd decc2609c4af19996fec2f80fb59cad0 *man/certificates.Rd b3153211a2e369bad30f9603fa6f3119 *man/cloud_config.Rd -38c626e9f78abbfd3cf4a8b699ae6341 *man/debian.Rd +407daade67c1825e8a6ea2d717755231 *man/debian.Rd 9148be6e7f0ebe29de855d15f196375d *man/do_oauth.Rd 73f2f253e4a1f6b2ec0da4a457a3c9a5 *man/do_options.Rd 0fd24ee458781310348b14355b73c80a *man/docklet_create.Rd @@ -90,7 +87,7 @@ 937567335d47e4b0808f4081a86e0180 *man/droplet_do_actions.Rd cc88e503a2a27b3795a19b9b44d374e0 *man/droplet_execute.Rd 31e8392cb40a8e954f4335031f231fac *man/droplet_freeze.Rd -f7e975da73826ef2e8f794c55b30404d *man/droplet_functions.Rd +ecafe28d0d8314df41a800603cc4aa70 *man/droplet_functions.Rd f320feb20de459e5501f5fe03745e188 *man/droplet_kernels_list.Rd 6988b82390e6f1ae49ddcc94372ad4a2 *man/droplet_modify.Rd cc46e83d576c3d7b8b2a80d16fa7b5ae *man/droplet_reuse.Rd @@ -114,7 +111,7 @@ c72092cfa54f07cc9bd44a362d893ba1 *man/key-crud.Rd 593a10868b7b03202df6a072243d774e *man/keys.Rd 45c247e32fd9f7234daa2e2663fa5653 *man/neighbors.Rd -eb2c9e7f9d40633fd7d4c9611170e101 *man/nouns.Rd +8a750226ae1b76f502c00764ee25817e *man/nouns.Rd a64a7ea44fcaa33c2d3ad0f7909cbc3e *man/pipe.Rd 716e1cb0ecfd6160e7b8e3ed2284e6ba *man/project_create.Rd 9a5ebe115c69c9de7b15eed4e2e70a8b *man/project_delete.Rd @@ -149,7 +146,6 @@ 7815cd61ae7a8b3cc6338f3b22ff0b4d *tests/testthat/test-droplets.R f01495bd563dff25c0134765010935d2 *tests/testthat/test-events.R 7b07b15b0773210b00ce89bce85bb4b6 *tests/testthat/test-image.R -953c85e282eeed8ea79be3529848f45e *tests/testthat/test-images.R +e8d3e3f1d177a9ab4d5b23dc7d47885b *tests/testthat/test-images.R fd212c51cca6e8fbe6d346f4196fd6b6 *tests/testthat/test-regions.R fa7e6f7824e68a5e835b3e53207fa721 *tests/testthat/test-sizes.R -2b3bcbddb9ee13878614ffc39f152af6 *vignettes/analogsea.Rmd diff -Nru analogsea-0.8.0/NAMESPACE analogsea-0.9.0/NAMESPACE --- analogsea-0.8.0/NAMESPACE 2020-01-29 22:50:59.000000000 +0000 +++ analogsea-0.9.0/NAMESPACE 2020-10-07 23:00:51.000000000 +0000 @@ -184,6 +184,7 @@ export(image_rename) export(image_transfer) export(images) +export(install_github_r_package) export(install_r_package) export(key) export(key_create) diff -Nru analogsea-0.8.0/NEWS.md analogsea-0.9.0/NEWS.md --- analogsea-0.8.0/NEWS.md 2020-01-29 22:18:13.000000000 +0000 +++ analogsea-0.9.0/NEWS.md 2020-10-08 15:45:44.000000000 +0000 @@ -1,3 +1,21 @@ +analogsea 0.9.0 +=============== + +### NEW FEATURES + +* gains function `install_github_r_package()` for installing R packages from github on your droplet (#191) thanks @muschellij2 + +### MINOR IMPROVEMENTS + +* `neighbors()` fxn fix: DigitalOcean updated the route used for neighbors information, and the returned named element in the response body (#186) + +### BUG FIXES + +* fix for `droplet_execute()` for running R on a droplet (#193) (#195) thanks @pieterprovoost +* fixed `droplet_action()` internal function - explicitly state the content type for each request - should affect many exported functions (#192) +* fix for internal function `droplet_ip()`: we were sometimes extracting the private IP instead of the public IP address (#198) thanks @muschellij2 + + analogsea 0.8.0 =============== @@ -101,8 +119,7 @@ * New function `docklets_create()` to create many docklets at once (similar to `droplets_create()`) (#120) -* New volumes methods for the new block storage (aka volumes) -: `volume`, `volume_action`, +* New volumes methods for the new block storage (aka volumes): `volume`, `volume_action`, `volume_actions`, `volume_attach`, `volume_create`, `volume_delete`, `volume_detach`, `volume_resize`, `volume_snapshot_create`, `volume_snapshots`, `volumes`, `as.volume` (#121) @@ -153,7 +170,6 @@ Previously we pinged every second, meaning you could hit your API rate limit fastish. Now you can set an option `do.wait_time` to tweak time bewtween pings to check for droplet creation (or other actions). -See for example of doing droplet creation in parallel. (#108) thanks @simecek ! * Fixed parsing bug in `sizes()` (#119) diff -Nru analogsea-0.8.0/R/analogsea-package.R analogsea-0.9.0/R/analogsea-package.R --- analogsea-0.8.0/R/analogsea-package.R 2019-06-05 18:36:11.000000000 +0000 +++ analogsea-0.9.0/R/analogsea-package.R 2020-10-07 22:18:53.000000000 +0000 @@ -17,9 +17,9 @@ #' \pkg{analogsea} allows you to interact with your droplet(s) from R via SSH. #' To do this you need to setup SSH keys with Digital Ocean. Make sure you #' provide Digitial Ocean your public key at -#' \url{https://cloud.digitalocean.com/ssh_keys}. GitHub has some good advice +#' https://cloud.digitalocean.com/ssh_keys - GitHub has some good advice #' on creating a new public key if you don't already have one: -#' \url{https://help.github.com/articles/generating-ssh-keys}. +#' https://help.github.com/articles/generating-ssh-keys #' #' Note that when using ssh, you'll likely get warnings like "The authenticity #' of host can't be established ...". This is normal, don't be worried about @@ -38,11 +38,11 @@ #' @importFrom yaml yaml.load_file as.yaml #' @name analogsea-package #' @aliases analogsea -#' @author Scott Chamberlain \email{myrmecocystus@@gmail.com} -#' @author Hadley Wickham \email{hadley@@rstudio.com} -#' @author Winston Chang \email{winston@@stdout.org} -#' @author Bob Rudis \email{bob@@rudis.net} -#' @author Bryce Mecum \email{brycemecum@@gmail.com} +#' @author Scott Chamberlain +#' @author Hadley Wickham +#' @author Winston Chang +#' @author Bob Rudis +#' @author Bryce Mecum #' @docType package #' @keywords package NULL @@ -58,7 +58,7 @@ #' for a droplet #' #' @details A vector of 999 adjectives. From the GitHub repo -#' \url{https://github.com/dariusk/corpora} - the data is licensed CC0. +#' https://github.com/dariusk/corpora - the data is licensed CC0. #' @name adjectives #' @docType data #' @keywords data @@ -68,7 +68,7 @@ #' for a droplet #' #' @details A vector of 1000 nouns From the GitHub repo -#' \url{https://github.com/dariusk/corpora} - the data is licensed CC0. +#' https://github.com/dariusk/corpora - the data is licensed CC0. #' @name nouns #' @docType data #' @keywords data diff -Nru analogsea-0.8.0/R/debian.R analogsea-0.9.0/R/debian.R --- analogsea-0.8.0/R/debian.R 2019-05-31 00:31:32.000000000 +0000 +++ analogsea-0.9.0/R/debian.R 2020-02-13 23:38:49.000000000 +0000 @@ -23,11 +23,11 @@ #' @export debian_add_swap <- function(droplet) { droplet_ssh(droplet, - "fallocate -l 4G /swapfile", - "chmod 600 /swapfile", - "mkswap /swapfile", - "sudo swapon /swapfile", - "sudo echo \"/swapfile none swap sw 0 0\" >> /etc/fstab" + "fallocate -l 4G /swapfile", + "chmod 600 /swapfile", + "mkswap /swapfile", + "sudo swapon /swapfile", + "sudo echo \"/swapfile none swap sw 0 0\" >> /etc/fstab" ) } @@ -86,8 +86,8 @@ #' @export debian_apt_get_update <- function(droplet) { droplet_ssh(droplet, - "sudo apt-get update -qq", - "sudo apt-get upgrade -y" + "sudo apt-get update -qq", + "sudo apt-get upgrade -y" ) } @@ -96,7 +96,7 @@ #' @param ... Arguments to apt-get install. debian_apt_get_install <- function(droplet, ...) { droplet_ssh(droplet, - paste0("sudo apt-get install -y --force-yes ", paste(..., collapse = " ")) + paste0("sudo apt-get install -y --force-yes ", paste(..., collapse = " ")) ) } @@ -106,8 +106,50 @@ #' @export #' @param package Name of R package to install. #' @param repo CRAN mirror to use. -install_r_package <- function(droplet, package, repo = "http://cran.rstudio.com") { +install_r_package <- function(droplet, package, repo = "https://cloud.r-project.org/") { droplet_ssh(droplet, - sprintf("Rscript -e \"install.packages(\'%s\', repos=\'%s/\')\"", package, repo) + sprintf("Rscript -e \"install.packages(\'%s\', repos=\'%s/\')\"", package, repo) ) } + +#' @rdname debian +#' @export +#' @param package Name of R package to install. +#' @param repo CRAN mirror to use. +install_github_r_package <- function(droplet, package, repo = "https://cloud.r-project.org/") { + tf <- tempdir() + randName <- paste(sample(c(letters, LETTERS), size = 10, + replace = TRUE), collapse = "") + tff <- file.path(tf, randName) + on.exit({ + if (file.exists(tff)) { + file.remove(tff) + } + }) + command = "Rscript -e \"cat(requireNamespace('remotes', quietly = TRUE))\"" + droplet_ssh(droplet, paste0(command, " > /tmp/", + randName), verbose = FALSE) + droplet_download(droplet, paste0("/tmp/", randName), + tf, verbose = FALSE) + droplet_ssh(droplet, paste0("rm /tmp/", randName), + verbose = FALSE) + + have_remotes <- readLines(tff, warn = FALSE) + if (length(have_remotes) == 1) { + if (have_remotes %in% c("TRUE", "FALSE")) { + have_remotes = as.logical(have_remotes) + } else { + have_remotes = FALSE + } + } else { + have_remotes = FALSE + } + if (!have_remotes) { + install_r_package(droplet, "remotes", repo = repo) + } + + droplet_ssh( + droplet, + sprintf("Rscript -e \"remotes::install_github('%s')\"", + package)) +} diff -Nru analogsea-0.8.0/R/deprecated_defunct.R analogsea-0.9.0/R/deprecated_defunct.R --- analogsea-0.8.0/R/deprecated_defunct.R 2017-05-07 16:46:58.000000000 +0000 +++ analogsea-0.9.0/R/deprecated_defunct.R 2020-10-07 22:19:39.000000000 +0000 @@ -9,12 +9,10 @@ #' #' These functions are gone, no longer available. #' -#' \itemize{ -#' \item \code{\link{tag_rename}}: DigitalOcean removed this functionality -#' from their API. See -#' \url{https://developers.digitalocean.com/documentation/changelog/api-v2/deprecating-update-tag/} +#' - `tag_rename()`: DigitalOcean removed this functionality from their API. +#' See +#' https://developers.digitalocean.com/documentation/changelog/api-v2/deprecating-update-tag/ #' for details. -#' } #' #' @name analogsea-defunct NULL diff -Nru analogsea-0.8.0/R/droplet-actions.R analogsea-0.9.0/R/droplet-actions.R --- analogsea-0.8.0/R/droplet-actions.R 2019-06-25 16:48:29.000000000 +0000 +++ analogsea-0.9.0/R/droplet-actions.R 2020-04-15 00:42:52.000000000 +0000 @@ -326,10 +326,9 @@ droplet_action <- function(action, droplet, ...) { droplet <- as.droplet(droplet) - res <- do_POST(sprintf('droplets/%s/actions', droplet$id), query = list( - type = jsonlite::unbox(action), - ...) - ) + res <- do_POST(sprintf('droplets/%s/actions', droplet$id), + httr::content_type_json(), + body = list(type = jsonlite::unbox(action), ...)) as.action(res) } @@ -508,8 +507,8 @@ #' neighbors() #' } neighbors <- function(...) { - res <- do_GET('reports/droplet_neighbors', ...) - res$droplets + res <- do_GET('reports/droplet_neighbors_ids', ...) + res$neighbor_ids } #' @export diff -Nru analogsea-0.8.0/R/droplet_execute.R analogsea-0.9.0/R/droplet_execute.R --- analogsea-0.8.0/R/droplet_execute.R 2019-06-05 15:57:57.000000000 +0000 +++ analogsea-0.9.0/R/droplet_execute.R 2020-09-01 20:56:38.000000000 +0000 @@ -42,11 +42,11 @@ droplet_ssh(droplet, "Rscript --save remote.R") mssg(verbose, "Downloading results...") - tmp <- tempfile() + tmp <- tempdir() droplet_download(droplet, ".RData", tmp) e <- new.env(parent = emptyenv()) - load(tmp, envir = e) + load(file.path(tmp, ".RData"), envir = e) as.list(e) } diff -Nru analogsea-0.8.0/R/droplet-ssh.R analogsea-0.9.0/R/droplet-ssh.R --- analogsea-0.8.0/R/droplet-ssh.R 2019-06-05 18:40:04.000000000 +0000 +++ analogsea-0.9.0/R/droplet-ssh.R 2020-10-07 19:52:19.000000000 +0000 @@ -78,25 +78,27 @@ #' @export #' @rdname droplet_ssh -droplet_upload <- function(droplet, local, remote, user = "root", keyfile = NULL, - ssh_passwd = NULL, verbose = FALSE) { - +droplet_upload <- function(droplet, local, remote, user = "root", keyfile = NULL, + ssh_passwd = NULL, verbose = FALSE) { check_for_a_pkg("ssh") droplet <- as.droplet(droplet) - do_scp(droplet, local, remote, user, - keyfile = keyfile, ssh_passwd = ssh_passwd, - verbose = verbose) + do_scp(droplet, local, remote, user, + keyfile = keyfile, ssh_passwd = ssh_passwd, + verbose = verbose + ) } + #' @export #' @rdname droplet_ssh droplet_download <- function(droplet, remote, local, user = "root", - keyfile = NULL, ssh_passwd = NULL, verbose = FALSE, overwrite = FALSE) { - + keyfile = NULL, ssh_passwd = NULL, verbose = FALSE, overwrite = FALSE) { check_for_a_pkg("ssh") droplet <- as.droplet(droplet) - do_scp(droplet, local, remote, user, scp = "download", - keyfile, ssh_passwd, verbose = verbose) + do_scp(droplet, local, remote, user, + scp = "download", + keyfile, ssh_passwd, verbose = verbose + ) } @@ -105,15 +107,22 @@ v4 <- x$network$v4 if (length(v4) == 0) { stop("No network interface registered for this droplet\n Try refreshing like: droplet(d$id)", - call. = FALSE) + call. = FALSE + ) } - - v4[[1]]$ip_address + ips <- do.call("rbind", lapply(v4, as.data.frame)) + public_ip <- ips$type == "public" + if (!any(public_ip)) { + ip <- v4[[1]]$ip_address + } else { + ip <- ips$ip_address[public_ip][[1]] + } + ip } droplet_ip_safe <- function(x) { res <- tryCatch(droplet_ip(x), error = function(e) e) - if (inherits(res, "simpleError")) 'droplet likely not up yet' else res + if (inherits(res, "simpleError")) "droplet likely not up yet" else res } do_ssh <- function(droplet, cmd, user, keyfile = NULL, ssh_passwd = NULL, verbose = FALSE) { @@ -121,7 +130,7 @@ user_ip <- sprintf("%s@%s", user, droplet_ip_safe(droplet)) if (user_ip %in% ls(envir = analogsea_sessions)) { session <- get(user_ip, envir = analogsea_sessions) - if (!ssh::ssh_info(session=session)$connected) { + if (!ssh::ssh_info(session = session)$connected) { session <- if (is.null(ssh_passwd)) { ssh::ssh_connect(user_ip, keyfile) } else { @@ -146,8 +155,7 @@ } do_scp <- function(droplet, local, remote, user, - scp = "upload", keyfile = NULL, ssh_passwd = NULL, verbose = FALSE) { - + scp = "upload", keyfile = NULL, ssh_passwd = NULL, verbose = FALSE) { user_ip <- sprintf("%s@%s", user, droplet_ip_safe(droplet)) if (user_ip %in% ls(envir = analogsea_sessions)) { session <- get(user_ip, envir = analogsea_sessions) @@ -159,9 +167,17 @@ } assign(user_ip, session, envir = analogsea_sessions) } - if (scp == "upload") cat(ssh::scp_upload(session = session, - files = local, to = remote, verbose = TRUE), sep = "\n") - if (scp == "download") cat(ssh::scp_download(session = session, - files = remote, to = local, verbose = TRUE), sep = "\n") + if (scp == "upload") { + cat(ssh::scp_upload( + session = session, + files = local, to = remote, verbose = TRUE + ), sep = "\n") + } + if (scp == "download") { + cat(ssh::scp_download( + session = session, + files = remote, to = local, verbose = TRUE + ), sep = "\n") + } invisible(droplet) } diff -Nru analogsea-0.8.0/R/info.R analogsea-0.9.0/R/info.R --- analogsea-0.8.0/R/info.R 2019-05-31 00:31:32.000000000 +0000 +++ analogsea-0.9.0/R/info.R 2020-10-07 22:20:09.000000000 +0000 @@ -7,9 +7,9 @@ #' @section Documentation: #' #' - DigitalOcean docs overview: -#' +#' https://developers.digitalocean.com/documentation/ #' - DigitalOcean API docs: -#' +#' https://developers.digitalocean.com/documentation/v2/ #' #' @section Functions: #' @@ -102,10 +102,10 @@ #' Install RStudio things: #' #' - [docklet_rstudio()]: install RStudio on your docklet using -#' Rocker images () +#' Rocker images (https://hub.docker.com/u/rocker) #' - [docklet_rstudio_addusers()]: add users to an RStudio docker image #' - [docklet_shinyserver()]: install Shiny server on your docklet using -#' Rocker images () +#' Rocker images (https://hub.docker.com/u/rocker) #' - [docklet_shinyapp()]: install a Shiny app on your Shiny server docker #' container NULL diff -Nru analogsea-0.8.0/README.md analogsea-0.9.0/README.md --- analogsea-0.8.0/README.md 2020-01-29 19:38:47.000000000 +0000 +++ analogsea-0.9.0/README.md 2020-10-08 15:46:04.000000000 +0000 @@ -4,10 +4,10 @@ [![Build Status](https://api.travis-ci.org/sckott/analogsea.png?branch=master)](https://travis-ci.org/sckott/analogsea) [![Build status](https://ci.appveyor.com/api/projects/status/ll9lcqafuw338q0h/branch/master)](https://ci.appveyor.com/project/sckott/analogsea/branch/master) [![codecov.io](https://codecov.io/github/sckott/analogsea/coverage.svg?branch=master)](https://codecov.io/github/sckott/analogsea?branch=master) -[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/analogsea)](https://github.com/metacran/cranlogs.app) +[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/analogsea)](https://github.com/r-hub/cranlogs.app) [![cran version](https://www.r-pkg.org/badges/version/analogsea)](https://cran.r-project.org/package=analogsea) -`analogsea` is an R client for version 2 of the [Digital Ocean API](https://developers.digitalocean.com/v2/). See `?droplet_functions` after loading analogsea. It allows you to programatically create and destroy droplets (remote computers), and install various R related tools: (these are still a work in progress): +`analogsea` is an R client for version 2 of the Digital Ocean API. See `?droplet_functions` after loading analogsea. It allows you to programatically create and destroy droplets (remote computers), and install various R related tools: (these are still a work in progress): * R (done) * RStudio Server (done) @@ -15,6 +15,8 @@ * OpenCPU (not yet) * Use packrat to move a project to a droplet (not yet) +Docs: https://analogsea.icu/ + ## Install Stable version from CRAN diff -Nru analogsea-0.8.0/tests/testthat/test-images.R analogsea-0.9.0/tests/testthat/test-images.R --- analogsea-0.8.0/tests/testthat/test-images.R 2016-06-21 16:36:12.000000000 +0000 +++ analogsea-0.9.0/tests/testthat/test-images.R 2020-10-07 22:36:02.000000000 +0000 @@ -28,8 +28,8 @@ expect_is(imgs_dist, "list") expect_is(imgs_appl, "list") - expect_false(any(grepl("Docker", names(imgs_dist)))) - expect_true(any(grepl("Docker", names(imgs_appl)))) + expect_false(any(grepl("MySQL", names(imgs_dist)))) + expect_true(any(grepl("MySQL", names(imgs_appl)))) }) test_that("public parameter is defunct", { diff -Nru analogsea-0.8.0/vignettes/analogsea.Rmd analogsea-0.9.0/vignettes/analogsea.Rmd --- analogsea-0.8.0/vignettes/analogsea.Rmd 2019-06-25 16:48:29.000000000 +0000 +++ analogsea-0.9.0/vignettes/analogsea.Rmd 1970-01-01 00:00:00.000000000 +0000 @@ -1,569 +0,0 @@ - - - -Working with the Digital Ocean API -====== - -## Create a DO account - -If you don't already have one, [create a DO account](https://www.digitalocean.com/?refcode=0740f5169634). -By using this link, you'll start with $10 in credits (enough for >600 hours of -computing on a 1 gb machine), and if you become a digital ocean customer we'll -get some DO credits for us to offset our costs for testing. Thanks :) - -## Authenticate - -The best way to authenticate is to generate a personal access token -() and save it in an -environment variable called `DO_PAT`. If you don't do this, you'll be prompted -to authenticate in your browser the first time you use analogsea. - -## SSH keys - -`analogsea` allows you to interact with your droplet(s) from R via SSH. To do -this you need to setup SSH keys with Digital Ocean. Make sure you provide Digitial -Ocean your public key at . GitHub has -some good advice on creating a new public key if you don't already have one: -. - -Note that when using ssh, you'll likely get warnings like - -> The authenticity of host can't be established ... - -This is normal, don't be worried about this. - -Note that if you want to connect over SSH to a droplet you have to -create the droplet with an SSH key with the `ssh_keys` parameter. If you -don't you can still interact with the droplet via the Digital Ocean API, -but you can't access the droplet over SSH. - -## Create a droplet - -`droplet_create()` will create a droplet on your account. You can run it as -below without any inputs, and it will use sensible defaults: - -* The smallest memory size of 512mb -* Ubuntu 14.04 box -* Region sfo1 -* Uses your ssh key -* Don't use ipv6 -* Don't allow backups -* Don't allow private networking - -You can set all of these options in your `.Rprofile` file like -`options(do_size = "8gb")` for a default of 8 GB. - -The name given to the droplet is picked at random from a list of 1000 random names. - -You can of course set any of these parameters. - - -```r -droplet_create() -``` - -You can also create many droplets at once: - - -```r -droplets_create() -``` - -## Get a droplet or droplets - -Listing droplets can be done in singular or plural fashion. `droplet()` accepts -a droplet ID, while `droplets()` list all droplets. - -If you don't have any droplets yet, you will get an empty list running -`droplets()`, and you of course can't pass in a droplet ID number to `droplet()` -if you don't have any droplets yet. - - -```r -library("analogsea") -``` - - -```r -droplets() -#> named list() -``` - -Create a droplet - - -```r -droplet_create() -``` - -``` -#> Waiting for create ................. -``` - -``` -#> ErodedPosterity (31860257) -#> IP: 162.243.139.148 -#> Status: new -#> Region: San Francisco 1 -#> Image: 14.04.5 x64 -#> Size: 512mb -#> Volumes: -``` - -After creating a droplet and running `droplets()` again, we see a list of -our droplet(s) - - - - -```r -(drops <- droplets()) -``` - -Or we can pass in a droplet id to `droplet()`. There is a `print.droplet()` method -that is used to print a brief summary of each droplet. - - -```r -droplet(drops[[1]]$id) -``` - -``` -#> droppy (31859471) -#> IP: 159.203.214.8 -#> Status: active -#> Region: San Francisco 1 -#> Image: 14.04.5 x64 -#> Size: 512mb -#> Volumes: -``` - -Get more detailed information on your droplet with `summary()`. This is a -`summary.droplet()` method, that is just a little more verbose than the -`print.droplet()` method - - -```r -droplet(drops[[1]]$id) %>% summary -``` - -``` -#> droppy (31859471) -#> Status: active -#> Region: San Francisco 1 -#> Image: 14.04.5 x64 -#> Size: 512mb ($0.00744 / hr) -#> Estimated cost ($): 0.002 -#> Locked: FALSE -#> Created at: 2016-11-11T18:50:51Z UTC -#> Networks: -#> v4: ip_address (159.203.214.8), netmask (255.255.240.0), gateway (159.203.208.1), type (public) -#> v6: none -#> Kernel: -#> Snapshots: -#> Backups: -#> Tags: -``` - - -## Actions on droplets - -### Delete - -You can delete a droplet with `droplet_delete()`. Be careful, as this completely -removes your droplet. Backup your droplet or make an image if you want to use -the droplet later. - - -```r -droplet_create() %>% - droplet_delete() -``` - -``` -#> Waiting for create .............................. -``` - -### Actions - -List actions on a droplet, newer ones at the top. Here, list actions - - -```r -drops[[1]] %>% droplet_actions() -``` - -``` -#> [[1]] -#> rename (166715389) -#> Status: completed -#> Resource: droplet 31859471 -#> -#> [[2]] -#> create (166715005) -#> Status: completed -#> Resource: droplet 31859471 -``` - -Then rename and list actions again - - -```r -drops[[1]] %>% - droplet_rename(name = "droppy") %>% - droplet_wait() %>% - droplet_actions() -#> Waiting for rename ... -#> [[1]] -#> rename (166715389) -#> Status: completed -#> Resource: droplet 31859471 -#> -#> [[2]] -#> create (166715005) -#> Status: completed -#> Resource: droplet 31859471 -``` - -### Snapshot - -Making a snapshot of a droplet can be done with `droplet_snapshot()`. This -action requires that you turn off the droplet first, then take the snapshot. -First, create a droplet - - -```r -d <- droplet_create(size = "2gb") -``` - -Then power off, and take a snapshot, which gives an action object describing -that the snapshot is in progress. - - -```r -d %>% - droplet_power_off() %>% - droplet_wait() %>% - droplet_snapshot(name = "mynewsnap") -#> Waiting for power_off ................................................... -#> snapshot (166715834) -#> Status: in-progress -#> Resource: droplet 31859617 -``` - -## Regions - -The `regions()` function lists region slug names, full names, available sizes, -whether the region is available at all, and features. - -This helps you get an overview of region details, which you can select from -when creating droplets - - -```r -regions() -``` - -``` -#> slug name -#> 1 nyc1 New York 1 -#> 2 sfo1 San Francisco 1 -#> 3 nyc2 New York 2 -#> 4 ams2 Amsterdam 2 -#> 5 sgp1 Singapore 1 -#> 6 lon1 London 1 -#> 7 nyc3 New York 3 -#> 8 ams3 Amsterdam 3 -#> 9 fra1 Frankfurt 1 -#> 10 tor1 Toronto 1 -#> 11 sfo2 San Francisco 2 -#> 12 blr1 Bangalore 1 -#> sizes -#> 1 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb -#> 2 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb -#> 3 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb -#> 4 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb -#> 5 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb -#> 6 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb -#> 7 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb -#> 8 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb, 48gb, 64gb -#> 9 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb -#> 10 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb -#> 11 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb -#> 12 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, m-16gb, 32gb, m-32gb, 48gb, m-64gb, 64gb, m-128gb, m-224gb -#> available features -#> 1 TRUE private_networking, backups, ipv6, metadata, storage -#> 2 TRUE private_networking, backups, ipv6, metadata -#> 3 TRUE private_networking, backups, ipv6, metadata -#> 4 TRUE private_networking, backups, ipv6, metadata -#> 5 TRUE private_networking, backups, ipv6, metadata -#> 6 TRUE private_networking, backups, ipv6, metadata -#> 7 TRUE private_networking, backups, ipv6, metadata -#> 8 TRUE private_networking, backups, ipv6, metadata -#> 9 TRUE private_networking, backups, ipv6, metadata, storage -#> 10 TRUE private_networking, backups, ipv6, metadata -#> 11 TRUE private_networking, backups, ipv6, metadata, storage -#> 12 TRUE private_networking, backups, ipv6, metadata -``` - -## Sizes - -The `sizes()` function lists size slug names, associated memory, vcpus, disk -size, prices, and regions where the size is available. - -This helps you get an overview of sizes, which you can select from -when creating droplets - - -```r -sizes() -``` - -``` -#> slug memory vcpus disk transfer price_monthly price_hourly available -#> 1 512mb 512 1 20 1 5 0.00744 TRUE -#> 2 1gb 1024 1 30 2 10 0.01488 TRUE -#> 3 2gb 2048 2 40 3 20 0.02976 TRUE -#> 4 4gb 4096 2 60 4 40 0.05952 TRUE -#> 5 8gb 8192 4 80 5 80 0.11905 TRUE -#> 6 16gb 16384 8 160 6 160 0.23810 TRUE -#> 7 m-16gb 16384 2 30 6 120 0.17857 TRUE -#> 8 32gb 32768 12 320 7 320 0.47619 TRUE -#> 9 m-32gb 32768 4 90 7 240 0.35714 TRUE -#> 10 48gb 49152 16 480 8 480 0.71429 TRUE -#> 11 m-64gb 65536 8 200 8 480 0.71429 TRUE -#> 12 64gb 65536 20 640 9 640 0.95238 TRUE -#> 13 m-128gb 131072 16 340 9 960 1.42857 TRUE -#> 14 m-224gb 229376 32 500 10 1680 2.50000 TRUE -#> region -#> 1 ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 2 ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 3 ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 4 ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 5 ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 6 ams1, ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 7 blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1 -#> 8 ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 9 blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1 -#> 10 ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 11 blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1 -#> 12 ams2, ams3, blr1, fra1, lon1, nyc1, nyc2, nyc3, sfo1, sfo2, sgp1, tor1 -#> 13 blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1 -#> 14 blr1, fra1, lon1, nyc1, nyc3, sfo2, tor1 -``` - -## Keys - -We suggest you use SSH keys to interact with Digital Ocean from `analogsea`. -There are a variety of functions for working with SSH keys. - -List your keys - - -```r -keys() -``` - -``` -#> $`Scott Chamberlain` -#> Scott Chamberlain (89103) -#> Fingerprint: 6b:2e:f6:be:e7:b4:58:0e:2a:a0:23:7e:16:ac:fc:17 -#> -#> $`Scott Chamberlain` -#> Scott Chamberlain (700950) -#> Fingerprint: ba:5e:64:f4:c7:53:d1:5c:22:24:f0:84:12:f4:7b:03 -``` - -Get a key by id - - -```r -key(keys()[[1]]$id) -``` - -``` -#> Scott Chamberlain (89103) -#> Fingerprint: 6b:2e:f6:be:e7:b4:58:0e:2a:a0:23:7e:16:ac:fc:17 -``` - -You can also create a key, rename a key, and delete a key - - -```r -k <- key_create("key", readLines("~/.ssh/id_rsa.pub")) -k <- key_rename(k, "new_name") -key_delete(k) -``` - -Note that if you're on Windows you may experience some problems connecting -over SSH. We hope to resolve these problems as soon as possible. - -## Images - -The `images()` function can list both your own private images, and public images. -If `public=FALSE` only your private images are listed, while if `public=TRUE`, -your private images are listed along with publicly avaialble images. - - -```r -images(page = 4, per_page = 5) -``` - -``` -#> $`24 x64` -#> 24 x64 (18027532) -#> Slug: fedora-24-x64 [public] -#> Distro: Fedora -#> Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1 -#> -#> $`GitLab 8.9.4 CE on 14.04` -#> GitLab 8.9.4 CE on 14.04 (18285322) -#> Slug: gitlab [public] -#> Distro: Ubuntu -#> Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1 -#> -#> $`7.11 x32` -#> 7.11 x32 (18290419) -#> Slug: [public] -#> Distro: Debian -#> Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1 -#> -#> $`7.2 x64` -#> 7.2 x64 (18325354) -#> Slug: [public] -#> Distro: CentOS -#> Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1 -#> -#> $`10.3 zfs` -#> 10.3 zfs (18818640) -#> Slug: freebsd-10-3-x64-zfs [public] -#> Distro: FreeBSD -#> Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1 -``` - -You can also do various actions on images. First, you can pass in an image ID to -the `image()` function to get an image object. - - -```r -img <- images(per_page = 1)[[1]] -image(img$id) -``` - -``` -#> 1192.2.0 (beta) (20666772) -#> Slug: coreos-beta [public] -#> Distro: CoreOS -#> Regions: nyc1, sfo1, nyc2, ams2, sgp1, lon1, nyc3, ams3, fra1, tor1, sfo2, blr1 -``` - -You can rename an image - - -```r -img %>% image_rename(name = "analog") -``` - -You can transfer an image to another region - - -```r -image(img$id) %>% image_transfer(region = "sfo2") -``` - -## Domains - -You can use domain names for your droplets on Digital Ocean. `analogsea` has -a variety of functions to work with domain names. - -List domain names - - -```r -domains() -``` - -``` -#> $fishbaseapi.info -#> fishbaseapi.info -#> ttl: 1800 -``` - -Create a new domain name - - -```r -dom <- paste0(sample(words, 1), ".info") -domain_create(name = dom, ip_address = "127.0.0.1") -``` - -``` -#> leptometer.info -#> ttl: -``` - -Get a single domain by domain name - - -```r -domain(dom) -``` - -``` -#> leptometer.info -#> ttl: 1800 -``` - -Create a domain record, list records and delete the one just created - - -```r -domain(dom) %>% - domain_record_create(type = "TXT", name = "hello", data = "world") -``` - -``` -#> 19285352 -#> TXT world -``` - -```r -records <- domain(dom) %>% domain_records() -domain_record_delete(records[[length(records)]]) -``` - -List records - - -```r -domain(dom) %>% domain_records() -``` - -``` -#> [[1]] -#> 19285348 -#> NS ns1.digitalocean.com -#> -#> [[2]] -#> 19285349 -#> NS ns2.digitalocean.com -#> -#> [[3]] -#> 19285350 -#> NS ns3.digitalocean.com -#> -#> [[4]] -#> 19285351 -#> A 127.0.0.1 -``` - -Delete a domain name, returns nothing if delete is successful - - -```r -domain(dom) %>% domain_delete() -```