{"id":13666038,"url":"https://github.com/pachadotdev/analogsea","last_synced_at":"2025-08-20T04:31:57.982Z","repository":{"id":17364135,"uuid":"20135875","full_name":"pachadotdev/analogsea","owner":"pachadotdev","description":"Digital Ocean R client","archived":false,"fork":false,"pushed_at":"2024-05-01T14:23:13.000Z","size":1668,"stargazers_count":156,"open_issues_count":16,"forks_count":24,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-10-11T19:21:12.682Z","etag":null,"topics":["cloud-computing","droplet","rstats","ssh"],"latest_commit_sha":null,"homepage":"https://pacha.dev/analogsea/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pachadotdev.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":"codemeta.json"},"funding":{"custom":"https://www.buymeacoffee.com/pacha"}},"created_at":"2014-05-24T17:54:43.000Z","updated_at":"2024-10-11T15:06:15.000Z","dependencies_parsed_at":"2024-08-02T06:13:53.957Z","dependency_job_id":null,"html_url":"https://github.com/pachadotdev/analogsea","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pachadotdev%2Fanalogsea","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pachadotdev%2Fanalogsea/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pachadotdev%2Fanalogsea/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pachadotdev%2Fanalogsea/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pachadotdev","download_url":"https://codeload.github.com/pachadotdev/analogsea/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230394228,"owners_count":18218707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-computing","droplet","rstats","ssh"],"created_at":"2024-08-02T06:00:56.157Z","updated_at":"2024-12-19T07:06:10.006Z","avatar_url":"https://github.com/pachadotdev.png","language":"R","funding_links":["https://www.buymeacoffee.com/pacha"],"categories":["R"],"sub_categories":[],"readme":"analogsea\n=========\n\n[![codecov.io](https://codecov.io/github/pachadotdev/analogsea/coverage.svg?branch=master)](https://codecov.io/github/pachadotdev/analogsea?branch=master)\n[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/analogsea)](https://github.com/r-hub/cranlogs.app)\n[![cran version](https://www.r-pkg.org/badges/version/analogsea)](https://cran.r-project.org/package=analogsea)\n[![R-CMD-check](https://github.com/pachadotdev/analogsea/actions/workflows/R-CMD-check.yml/badge.svg)](https://github.com/pachadotdev/analogsea/actions/workflows/R-CMD-check.yml)\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n\n\u003cimg src=\"https://raw.githubusercontent.com/pachadotdev/analogsea/main/inst/analogsea.svg\" width=150 align=\"center\" alt=\"sticker\"/\u003e\n\n**Use our link https://m.do.co/c/1d5a471e5f54, you'll get 100 usd in credits to try DO!**\n\n`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:\n\n* R (done)\n* RStudio Server (done)\n* RStudio Shiny Server (done)\n* OpenCPU (not yet)\n* Use packrat to move a project to a droplet (not yet)\n\nIn addition, it allows you to use a readily available image with RStudio Server, Shiny Server and fully tidyverse from [DigitalOcean Marketplace](https://marketplace.digitalocean.com/apps/rstudio).\n\nDocs: https://pacha.dev/analogsea/. \n\n## Use cases\n\n- Andrew Heiss: [Create a cheap, disposable supercomputer with R, DigitalOcean, and future](https://www.andrewheiss.com/blog/2018/07/30/disposable-supercomputer-future/)\n\n## Install\n\nStable version from CRAN\n\n```r\ninstall.packages(\"analogsea\")\n```\n\nDevelopment version from GitHub\n\n```r\nremotes::install_github(\"pachadotdev/analogsea\")\n```\n\n```r\nlibrary(\"analogsea\")\n```\n\n## Create a DO account\n\nIf you don't already have one, [create a DO account](https://m.do.co/c/1d5a471e5f54). By using this link, you'll start with $100 in credits with a 2 months limit. This is enough for 1440 hours of computing on a machine with 4 GB memory and 2 dedicated CPUs.\n\n## Authenticate\n\nThe 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.\n\nMake sure you provide DigitalOcean 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/.\n\nIt is highly recommended to use `DO_PAT`, it's easier and allows (semi) automated tasks.\n\nTo use ssh keys install the recommended ssh package: `r install.packages(\"ssh\")`.\n\n## Get droplets\n\nAll droplets\n\n```r\ndroplets()\n```\n\n```r\n\u003cr\u003e droplets()\n$unintrenchable\n\u003cdroplet\u003eunintrenchable (2724525)\n  Status: off\n  Region: San Francisco 1\n  Image: Ubuntu 14.04 x64\n  Size: 512mb ($0.00744 / hr)\n\n$basipterygium\n\u003cdroplet\u003ebasipterygium (2724526)\n  Status: active\n  Region: San Francisco 1\n  Image: Ubuntu 14.04 x64\n  Size: 512mb ($0.00744 / hr)\n```\n\nA single droplet. Pass in a single droplet id.\n\n```r\ndroplet(2724525)\n```\n\n```r\n\u003cdroplet\u003eunintrenchable (2724525)\n  Status: off\n  Region: San Francisco 1\n  Image: Ubuntu 14.04 x64\n  Size: 512mb ($0.00744 / hr)\n```\n\n## Spin up a new droplet\n\nTo make this as dead simple as possible, you just use one function, without any parameters.\n\n```r\ndroplet_create()\n```\n\n```r\nUsing default ssh key: Jane Doe\nNB: This costs $0.00744 / hour  until you droplet_delete() it\n\u003cdroplet\u003esabaoth (2727258)\n  Status: new\n  Region: San Francisco 1\n  Image: Ubuntu 14.04 x64\n  Size: 512mb ($0.00744 / hr)\n```\n\nYou can of course pass in lots of options for name of the droplet, RAM size, disk size, ssh keys, etc.  See `regions()` and `sizes()` to list available regions and sizes.\n\n### Delete a droplet\n\n```r\ndroplet_delete(1707487)\n```\n\n## Chaining\n\nMost of the `droplet_*` functions can be chained together using the `%\u003e%` function. For example, you can turn a droplet off, snapshot, and then turn it back on with:\n\n```r\nd %\u003e%\n   droplet_power_off() %\u003e%\n   droplet_snapshot() %\u003e%\n   droplet_power_on() %\u003e%\n```\n\n## R/RStudio\n\n*We're still working on these, but would love feedback.*\n\nBy default, `analogsea` creates an Ubuntu 20.04 image. Let's say you've got ten students from an R workshop, then you can run\n\n```r\ndroplet_create(\"rstudio-20-04\")\n\nusers \u003c- list(\n  user = paste0(\"student\", 1:5),\n  password = sapply(rep(8,5), create_password)\n)\n  \nfor (i in seq_along(users$user)) {\n  ubuntu_create_user(x, users$user[i], users$password[i], keyfile = \"~/.ssh/id_rsa\")\n}\n```\n\nThen, each student shall be able to open RStudio from the browser, by visiting http://123.456.789:8787 and accessing with studentX (X = 1,...,10) and the password created.\n\nTo install more R packages, you can make them readily available for all the users that have access to your droplet with\n\n```r\nubuntu_install_r() # ohlf if you didn't use the RStudio image\ninstall_r_package(\"arrow\")\n```\n\n## Shiny\n\nThe RStudio Server image also features readily available Shiny Server, but we provide the functions `ubuntu_install_shiny()` and `docklet_shinyserver()` (requires to use the Docker image, i.e. `docklet_create()`) to configure Shiny from scratch.\n\n## Install RStudio Server\n\nFor the standard Ubuntu image you can use `ubuntu_install_rstudio()`.\n\nFor dockerized RStudio you have the next option:\n\n```r\ndocklet_create() %\u003e%\n  docklet_rstudio()\n```\n\nThis will install R, RStudio Server and it's dependencies. It will automatically pop open the RStudio server instance in your default browser, with default `username/password` of `rstudio/server`.\n\n\n## Meta\n\nPlease note that this project is released with a [Contributor Code of Conduct](https://github.com/pachadotdev/analogsea/blob/master/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpachadotdev%2Fanalogsea","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpachadotdev%2Fanalogsea","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpachadotdev%2Fanalogsea/lists"}