Provides a set of functions for interacting with the 'Digital Ocean' API at < https://developers.digitalocean.com/documentation/v2>, including creating images, destroying them, rebooting, getting details on regions, and available images.
analogsea is an R client for version 2 of the Digital Ocean API. It allows you to programatically create and destroy droplets (remote computers), and install various R related tools: (these are still a work in progress):
Stable version from CRAN
Development version from GitHub
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 :)
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.
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/.
<r> droplets()$unintrenchable<droplet>unintrenchable (2724525)Status: offRegion: San Francisco 1Image: Ubuntu 14.04 x64Size: 512mb ($0.00744 / hr)$basipterygium<droplet>basipterygium (2724526)Status: activeRegion: San Francisco 1Image: Ubuntu 14.04 x64Size: 512mb ($0.00744 / hr)
A single droplet. Pass in a single droplet id.
<droplet>unintrenchable (2724525)Status: offRegion: San Francisco 1Image: Ubuntu 14.04 x64Size: 512mb ($0.00744 / hr)
To make this as dead simple as possible, you just use one function, without any parameters.
Using default ssh key: Scott ChamberlainNB: This costs $0.00744 / hour until you droplet_delete() it<droplet>sabaoth (2727258)Status: newRegion: San Francisco 1Image: Ubuntu 14.04 x64Size: 512mb ($0.00744 / hr)
You can of course pass in lots of options for name of the droplet, RAM size, disk size, ssh keys, etc. See
sizes() to list available regions and sizes.
Most of the
droplet_* functions can be chained together using the
%>% function. For example, you can turn a droplet off, snapshot, and then turn it back on with:
d %>%droplet_power_off() %>%droplet_snapshot() %>%droplet_power_on() %>%
We're still working on these, but would love feedback.
This requires a "docklet", a droplet with docker installed:
This will install R, RStudio Server and it's dependencies. It will automatically pop open the RStudio server instance in your default browser, with default
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
as.keyfunction changed to
as.sshkeyto avoid collision with
domain_record_updateto update a domain record and
domain_recordto get a domain record by id (#124)
ttlfor time to live for the domain record, in seconds (#124)
docklet_shinyappnow return a droplet instead of a URL so they can be piped - docs now contain how to construct the URL for the rstudio or shiny server instance in case user sets
browse = FALSE(#134)
tagfor CAA support for Domain Record resources (#137)
allparam, with default value of
droplet_create: it couldn't generate a random name without first loading the package via
library(#125) thanks @trestletech
debian_add_swapadds swap memory, but was not persisted across reboots. fixed now (#127) thanks @trestletech
droplet_create, the parameters
tagsnow default to
NULLas they path pass to
I()that warns now on
tag_renameis now defunct as is you can no longer rename tags (#123)
docklets_create()to create many docklets at once (similar to
tagsto the parameter of the same name when creating droplets, with either
docklets_create. The tags can be existing ones, or if not they will be created (#122)
droplet_delete()gains new parameter
droplets()gains new parameter
tag, and examples added to its man file for tag usage.
docklet_shinyapp()to spin up Shiny server and a Shiny app, respectively. (#100)
droplets_create()to create many droplets at once (#112)
droplets_cost()to calculate cost of droplets across one or more droplets.
account()print method (#111)
docklet_create()when port 22 is not open before further action is taken on the droplet. We now check if port 22 is open and error with informative message about waiting a bit for it to open (#113) thanks @fmichonneau @hrbrmstr
print.dropletdue to problem in
droplet_ip()internal function (#109)
*_createto allow flexibility in how often DO API is pinged. Previously we pinged every second, meaning you could hit your API rate limit fastish. Now you can set an option
do.wait_timeto tweak time bewtween pings to check for droplet creation (or other actions). See https://github.com/sckott/analogsea/issues/108#issuecomment-151519855 for example of doing droplet creation in parallel. (#108) thanks @simecek !