Cloud Machines
Use machines in your own cloud provider account as Daintree hosts: connecting Boat, Agent 37, AWS, Google Cloud or DigitalOcean, who pays, creating and setting up a machine, adding one you already have, running a new worktree on its own machine, starting and stopping, lifetime and idle stop, and removing or deleting.
A Host Daintree Can Create
A cloud machine is a Linux host in your own cloud provider account. You connect the account once, and from then on Daintree can create a machine there, set Daintree up on it, start it when you want to work on it, stop it, and delete it when you are done. Once it is set up it is a host like any other: its projects, worktrees, terminals and agents run there, and a window on it shows them, as described in the rest of Remote Hosts.
Daintree ships five providers: Boat, Agent 37, AWS (EC2 instances), Google Cloud (Compute Engine VMs) and DigitalOcean (Droplets). An installed plugin can add more. They differ in what a stop keeps, what a stopped machine still costs and how a machine stops by itself; Cloud Providers has the details for each.
Who Pays
The machines run on your account with the provider, and the provider bills that account under its own terms. For the built-in providers, Daintree calls the provider's API from your computer with the credentials you connected and reaches the machine over ssh from your computer; no service run by Daintree sits in between.
- You choose who pays when you connect. After checking the credentials, the dialog asks Who pays for machines: your own account, an organization or team you belong to, the workspace the key belongs to, or a Google Cloud project, depending on what the provider offers and what the key may bill.
- Prices are a guide. Sizes read, for example, $0.036 an hour while running. Boat and DigitalOcean report their rates; Agent 37's are worked out from rates built into Daintree; AWS and Google Cloud don't report prices through the API Daintree uses, so their sizes say Price not reported. Check the provider's own pricing.
- A stop doesn't always end the bill. Boat stops billing a stopped machine. Agent 37, AWS and Google Cloud bill for the disk while it's stopped. DigitalOcean bills a stopped Droplet in full until it's deleted. The create dialog, the stop confirmation and the prompt when you open a stopped machine say which applies.
- No spending limit. A machine's lifetime and the host's idle time stop machines that are left running, but Daintree has no budget or cap. The Boat lifetime's help calls it A guard against a machine left running, not a spending limit. Use your provider's billing alerts for that.
Connect a Provider Account
- Open Settings → Hosts and find Cloud providers, below your remote hosts.
- Click Connect account and choose the provider. The dialog, Connect Boat account for example, says what the credentials are for: Daintree uses an API key to create, start, stop and delete machines in your Boat account, and to set up SSH to them. Daintree never asks for your password.
- Use Create a key on Boat (or Create credentials on AWS) to open the provider's page for making one, then paste or choose it. Each provider asks for different fields; see Cloud Providers.
- Click Check key (or Check credentials). Daintree asks the provider who the credentials sign in as and what they may bill. AWS also tries each permission Daintree needs in that region and names any it is refused. A check that passes doesn't guarantee the provider will accept every size later.
- Choose under Who pays for machines, optionally fill in Name (optional) (Renaming it never changes who pays), and click Connect account.
The credentials are kept encrypted with this computer's keychain; for a single-key provider the field says Kept in this device's keychain. Daintree never shows it again or copies it to a machine. They never go to a host. If this computer has no usable keychain, as on a Linux desktop without a keyring, Daintree refuses to connect rather than store them in plain text. Remote Host Security has the details.
Managing Accounts
Each account is a row under Cloud providers: its name, provider, who pays, the identity it signs in as and the last characters of the key where there are any, how many hosts use it, and whether the key worked when last checked.
- Check asks the provider again whether the credentials work.
- Replace key (or Replace credentials) swaps in new ones, which must belong to the same account and be allowed to bill the same scope; Hosts keep their machines.
- The trash button removes the account from this computer, after asking Remove '…' from this device?. It is refused while any host in your list still uses the account: remove those hosts first, choosing to delete the machines you no longer want. A machine you keep stays in your provider account as it was and can go on billing. Removing the account also deletes this computer's SSH key for it, so to reach a kept machine that only accepts that key again, you would have to give it a new account's key yourself. Removing deletes the credentials and the SSH key from this computer; Nothing changes on Boat: the key keeps working there until you revoke it.
A provider contributed by a plugin is picked by its name like any other; its account row names the plugin. Daintree asks first, once per plugin: Allow … to use your cloud accounts? See Providers From Plugins.
Create a Machine
Open Settings → Hosts → Add host (or Add host… in the command palette or the host menu) and click Create a cloud machine instead. The dialog is Add a cloud machine on Boat, or the provider of the account you pick. With no account yet, it offers to connect one first.
| Field | What it sets |
|---|---|
| Account | Shown when you have more than one. |
| New machine / Existing machine | Create one, or add one the account already has. |
| Name | What the host menu and window titles call it. |
| Region, Zone, Image, Subnet | Only what the provider's create needs, in its own words: AWS and DigitalOcean take a region and image, Google Cloud a zone, image and subnet, Boat and Agent 37 none. |
| Size | The machine types on offer, with vCPUs, memory and the hourly price where known. Sizes the provider says the account can't use say why; a size being offered doesn't guarantee the provider accepts it at create. |
| Stops by itself after | Boat and Google Cloud only: 1, 2, 4, 8 or 24 hours, or Never. See Lifetime. |
Below the fields, one line says what you are agreeing to: who is billed and roughly how much an hour, when it stops by itself, what a stopped machine still costs, and what a stop keeps and loses. Create and connect asks the provider for the machine.
The dialog then follows the machine: Asking Boat for a machine, Starting the machine, and so on. Closing it doesn't stop anything: the host's row in Settings → Hosts follows the machine, and setup carries on from there.
If the provider's answer is lost, for example because the network dropped mid-request, Daintree doesn't assume either way. The host says Boat didn't confirm the machine. Retry looks for it before creating another., and Retry looks for a machine carrying this host's label before it asks again. Boat, AWS and Google Cloud recognize a repeated create and answer with the machine they already made. Agent 37 can't, so Retry only ever looks there. DigitalOcean can't either: if the lookup finds nothing, Retry sends the create again, so check the DigitalOcean console for an extra Droplet if a create went unanswered.
Setting Daintree Up on It
Once the machine is running, the dialog gives way to Set up build-host, the same steps as adding any host, run over ssh to the new machine:
- Check runs by itself. A new machine can take a few minutes to answer ssh and finish its first boot; Daintree checks again every 10 seconds, and says when it has stopped trying.
- Review install, then Install on build-host. This puts this machine's exact Daintree build on the machine, the x64 or arm64 Linux package to match it, the AppImage unless you choose the
.deb. - Turn on Host mode, then Done, which connects. The host is already in your list, so there is no Add host step.
For some providers you also confirm the machine's ssh host key once, on the first connect. The setup and the host's details say DigitalOcean can't vouch for this machine's host key, so Daintree asks you once, show its fingerprint, and offer Trust this key. To check it, compare it with what ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub (or the key type shown) prints in the provider's console for that machine. Boat and Google Cloud supply the key through their API, so there is nothing to confirm. On AWS, the first connect trusts the key the instance reports in its console output when the machine presents it, and asks you only when there is none to read; after that, a changed key needs your review. Agent 37 machines are reached through Agent 37's own agent37 command, which has to be installed on this computer; the host's details offer Get agent37 when it isn't. See How a Cloud Machine's Host Key Is Trusted.
Adding a Machine You Already Have
Choose Existing machine to list the account's machines with their state and size, then pick one, name it and click Add machine. A stopped machine whose compute still bills says still billing; one billed only for its disk doesn't, so check the provider for disk charges. Machines already in your host list, a teammate's private machine and ones whose saved disk was deleted can't be picked.
Adding a machine doesn't start it or change how it stops by itself. A stopped machine joins your host list stopped, and the dialog offers Start machine or Leave stopped. Daintree connects with the account's own SSH key from this computer. On the first connect it puts that key on a Boat machine, or registers it with the Agent 37 workspace, which can take up to two minutes to reach a machine that is already running. AWS, Google Cloud and DigitalOcean take a key only when a machine is created, so to connect to one you add there, it must already accept this account's key from this computer, such as one Daintree created from here.
Run a New Worktree on Its Own Machine
The New Worktree dialog can give a worktree a machine of its own. Under Destination, the Host row lists, after your hosts, one entry per connected account, named after the account: New machine · Work for a Boat account called Work, described as Created for this worktree on Boat. Pick it and the dialog adds the provider's fields, a Size and, for Boat and Google Cloud, Stops after, with the same billing line. The button becomes Create on new machine.
What happens, in order, as the dialog's hint says:
- The worktree is created on this machine first, and stays here. Only a window on this machine offers a new machine.
- The provider creates a machine for it, named after the branch (
feature/loginbecomesfeature-login, with-2added if that name is taken). The worktree's card shows it coming up: Creating feature-login. - Once it runs, setup opens in this window: When setup finishes, feature/login opens on feature-login.
- The branch is opened on the machine the way Continue a Branch on Another Host moves any branch: through Git, with the push choices that dialog offers. A new machine has no Git credentials of its own, so cloning a private repository needs access set up on it first; the dialog says what failed and how to fix it.
The environment, recipe, agent and prompt choices are off for a new machine; the dialog keeps them for this machine. Until the worktree opens there, its card shows what can be done at that stage, such as Retry, Set up…, Open on feature-login, Details…, Delete machine… after a failure, and Cancel, which asks whether to keep the machine (It stays in your host list, marked as made for feature/login) or delete it.
When the Worktree Is Deleted
The machine belongs to the worktree you created it from, on this machine. Deleting that worktree adds a choice to the delete dialog, under Its cloud machine. Deleting the branch's copy on the cloud machine doesn't, and leaves the machine in your account. To end its charges, choose to delete it when you delete the original worktree or remove the host; a stop can leave charges, as Who Pays explains.
- Keep it on Boat, the default. The machine stays as it is.
- Stop it. It stops once the worktree is deleted.
- Delete it. It and everything on its disk are deleted from the provider once the worktree is deleted, and its host leaves your list. You confirm by typing the worktree's branch name (or its name, if it has no branch), under a warning that names the machine.
The stop or delete runs only after the worktree is confirmed gone; if the worktree delete is refused, nothing happens to the machine. If the stop or delete then fails, a notice says so with Retry, and the host's details link to the provider's console. Only Keep is offered while the provider is unavailable or the machine has no confirmed id at the provider yet ('feature-login' is still being created, so it's kept.), and Daintree acts only on a machine that was created for that worktree.
Start and Stop
Daintree never starts a machine unless you ask. Start starts it at once; opening a stopped machine asks first. A cloud host's row in Settings → Hosts shows its state (Running, Stopped, Asleep, Starting and so on), its hourly price while running, and how it stops by itself, with Start, Stop, Check status and Details. The same controls are in other places:
- The host menu (click the host chip) has a Cloud machines submenu with Start, Stop or Check for each, with its state, cost and account.
- Switching to a stopped machine asks first: Start 'build-host'?, with what it bills while it runs and when it stops by itself.
- A window on a machine that stopped says build-host's machine is stopped with Start and reconnect.
Stop asks Stop 'build-host'?: terminals, agents and anything else running on it end. Daintree always asks for the provider's normal stop, never a forced power-off. What survives it depends on the provider: Boat keeps files in the home folder, AWS, Google Cloud and DigitalOcean keep the disk Daintree created with the machine, and Agent 37 keeps files and installed programs. Memory and running processes never survive. For a machine you added, or extra disks, check the provider's own rules.
In a window on a cloud machine, the host chip names the provider instead of SSH, Boat · build-host, and its tooltip reads Working on build-host, a Boat machine, over SSH. Project files, terminals and agents run there.
Lifetime and Idle Stop
Two separate things stop a machine without you: the provider's own lifetime for it, and the host's idle time.
Lifetime
Boat and Google Cloud machines can carry a runtime limit, set with Stops by itself after when you create one and on the host's details page later.
- Boat (2 hours by default) counts from each start, and Daintree pushes the deadline back while a window here shows the host or its agents are working. Once Daintree has given the machine its own key, the host does this too with nothing connected.
- Google Cloud (Never by default) counts from each start and can't be extended while the machine runs, so it stops at the deadline even if agents are still working. Choose a new limit while the machine is fully stopped; Daintree applies it the next time it starts the machine.
AWS and DigitalOcean machines run until stopped. A new Agent 37 machine sleeps by itself after 30 minutes without activity; one you added keeps its own setting until you pick an idle time.
Idle Time
Every cloud host has an Idle after setting on its details page: 15 or 30 minutes, or 1, 2, 4 or 8 hours, 30 minutes by default, changed while the host is connected. It is kept on the host and counted there from the last time an agent there was working or waiting, or a window showed it, so it runs with this device away. Only agents count: a long build in a plain terminal, with no window showing the host, doesn't keep the machine running. When it runs out, what happens depends on the provider:
| Provider | When the host has been idle that long |
|---|---|
| Boat | The machine stops itself, using a Boat key Daintree gave it that is limited to that one machine. |
| AWS, Google Cloud | The machine powers itself off from inside, which these providers treat as a normal stop that keeps the disk. Daintree puts none of your account's credentials on the machine for this. |
| Agent 37 | The machine goes to sleep, keeping its disk, when its sleep is on (it is for machines Daintree creates). While this computer is connected, the host's idle time decides and Daintree puts it to sleep. With nothing connected, Agent 37's own timer, set to your idle time once you pick one, is in charge; the host keeps the machine awake while it sees work only while the link Daintree gave it for that works, and otherwise Agent 37 can put it to sleep mid-work. |
| DigitalOcean | Nothing: On DigitalOcean, the machine doesn't stop when the host's idle time ends. A stopped Droplet bills in full anyway, so stopping would save nothing. |
Some AWS and Google Cloud machines can't stop themselves, and the details page says why under the Idle after row. When stopping is safe and only the login lacks permission to power off without a password, Daintree stops the machine from this computer once the idle time ends, while it is connected. When the provider says a stop isn't safe, as for an instance in an Auto Scaling group or a managed instance group, the machine is left running. Cloud Providers lists the conditions.
Remove a Host or Delete Its Machine
A cloud host has no plain delete button. A machine is deleted when you remove its host and choose to, when you delete the worktree it was made for and choose to, or from a worktree card waiting on its machine.
Remove host on the host's details page, or the trash button on its row, asks what happens to the machine under Its machine:
- Keep it on Boat. The host leaves your list and the machine stays in your account as it is, still billing as the provider bills it. You can add it back from Add host.
- Delete the machine too. Its machine and everything on its disk are deleted from Boat, and the host leaves your list. You type the host's name to confirm, and the button reads Delete machine.
Either way, windows on it return to this machine, and its plugin permissions, history and browser data on this computer are cleared. Delete is refused for a machine another host in your list also uses.
daintree-ssh security group on AWS stay until you delete them in the provider's console. Removing an account from Daintree doesn't revoke its key at the provider either.