Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions apps/docs/content/docs/clouds/digitalocean.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,29 @@ description: Connect a DigitalOcean team and run services on App Platform with M

import { Step, Steps } from 'fumadocs-ui/components/steps';

Loomplane runs your services on DigitalOcean App Platform and gives them Managed PostgreSQL, MySQL and Valkey databases. App Platform builds each service from your repository, so you don't need a registry or a builder of your own.
Loomplane runs your services on DigitalOcean App Platform and gives them Managed PostgreSQL, MySQL and Valkey databases. Loomplane builds each service's image itself and pushes it to your DigitalOcean container registry, and App Platform runs that image. DigitalOcean never needs access to your repository.

## Connect DigitalOcean

<Steps>
<Step>

In DigitalOcean, open **API**, then **Tokens**, and create a personal access token with read and write access. A custom-scoped token needs `app`, `database` and `account:read`.
In DigitalOcean, open **API**, then **Tokens**, and create a personal access token with read and write access. A custom-scoped token needs `app`, `database`, `registry` and `account:read`.

</Step>
<Step>

Under **Settings**, then **GitHub**, give DigitalOcean access to the repositories you'll deploy. App Platform clones them through that connection. Loomplane never hands it your code.
In Loomplane, open **Integrations**, choose **DigitalOcean** and paste the token.

</Step>
<Step>

In Loomplane, open **Integrations**, choose **DigitalOcean** and paste the token.
Still in **Integrations**, add a registry, choose the **DigitalOcean account** and its **Registry**, then **Check and connect**. If DigitalOcean has no container registry yet, create one under **Container Registry** first. Loomplane pushes the images it builds there, and App Platform pulls them without a password of its own, because the registry is in the same team.

</Step>
<Step>

Make sure a [runner pool](/docs/clouds/runners) can build for the project. Loomplane builds on the project's default pool, or the organization's.

</Step>
</Steps>
Expand Down Expand Up @@ -55,11 +60,22 @@ resources:

The regions are App Platform's: `nyc`, `sfo`, `tor`, `atl`, `ams`, `fra`, `lon`, `blr`, `sgp` and `syd`. Leave `region` out and you get `nyc`.

Each service in each environment becomes an App Platform app of its own, named after the service, the environment and the project, with deploy on push turned off. A service with a Dockerfile builds from it. Anything else goes through App Platform's buildpacks. Workers run as App Platform workers and static sites as static sites. `size` picks the smallest instance that fits, from `apps-s-1vcpu-0.5gb` up to `apps-d-8vcpu-32gb`, and `scale.min` sets how many instances run. Secret variables go in as App Platform secrets.
Each service in each environment becomes an App Platform app of its own, named after the service, the environment and the project. Workers run as App Platform workers and static sites as static sites. `size` picks the smallest instance that fits, from `apps-s-1vcpu-0.5gb` up to `apps-d-8vcpu-32gb`, and `scale.min` sets how many instances run. Secret variables go in as App Platform secrets.

## How a service gets built

A service with a Dockerfile, or a Go module, is built by Loomplane from the commit you approved. The image goes to the DigitalOcean container registry, and the app runs it by digest, so what runs is exactly what you reviewed. The repository can live anywhere Loomplane reads from, a self-managed GitLab included. `build.builder` and `build.registry` pick another runner pool or registry. The registry has to be in the DigitalOcean team the app runs in, because that's the only place App Platform pulls from without a password, and the builder has to build amd64 images. A promotion deploys the image the earlier environment ran when both push to the same registry.

Two kinds of service still build on App Platform from the repository:

- Static sites, which App Platform can't run from an image.
- Services with neither a Dockerfile nor a Go module, which App Platform builds with its own buildpacks.

The same goes for every service until there's a runner pool and a DigitalOcean registry to build with, and the plan warns which one is missing. Those builds need DigitalOcean's own connection to your GitHub or GitLab account, which only someone signed in to DigitalOcean can set up: in DigitalOcean, under **Settings**, then **GitHub**, give it access to the repositories you'll deploy. DigitalOcean's API has no way to do it, so Loomplane can't do it for you. The plan warns about every service that needs it, and a deployment without it fails with DigitalOcean's "GitHub user not authenticated".

## Which commit runs
## Which commit runs from the repository

Every other target here deploys the exact commit a plan approved. App Platform can't, because it always builds the newest commit of a branch and gives you no way to ask for a particular one. So Loomplane checks instead.
An image Loomplane built is the approved commit by construction. A build from the repository isn't, because App Platform always builds the newest commit of a branch and gives you no way to ask for a particular one. So Loomplane checks instead.

It points the app at the branch your project reads, starts the deployment itself, and watches the commit App Platform reports for every component. If that's the approved commit, the deployment goes ahead. If someone pushed to the branch after you approved the plan, Loomplane cancels the deployment before it goes live and the step fails with both commits in the message. In the rare case a wrong build gets live before the check sees it, Loomplane rolls the app back to what ran before, or deletes the app if nothing approved ever ran there.

Expand Down Expand Up @@ -95,7 +111,7 @@ Wildcard hostnames and blocked paths aren't supported yet. Neither is moving a h

## Limits

A private service is only reachable from inside its own App Platform app, and each service here gets its own app, so nothing can call one. The planner says so and asks you to make it public. Build logs stay on the app's **Activity** tab, and Loomplane shows the deployment's progress.
A private service is only reachable from inside its own App Platform app, and each service here gets its own app, so nothing can call one. The planner says so and asks you to make it public. An image Loomplane builds has its build log in Loomplane. A build on App Platform keeps its log on the app's **Activity** tab, and Loomplane shows the deployment's progress.

## Droplets and DNS

Expand Down
5 changes: 3 additions & 2 deletions apps/docs/content/docs/concepts/promotion-and-rollback.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ Where it can, a promotion deploys the image staging already built, named by its
| Azure Container Apps | Yes | The conditions below don't hold, or the image is in another Azure container registry (the region doesn't matter) |
| Your own servers, Kubernetes | Yes | The conditions below don't hold, or the target pushes to a different registry, or staging built on its server without one |
| Render, Vercel | No | Always. They build each deployment from the commit themselves |
| DigitalOcean App Platform | No | Always. App Platform builds the newest commit of its branch, and the reason says a promotion only works while that's still the commit you're promoting |
| DigitalOcean App Platform, image Loomplane built | Yes | The conditions below don't hold, or the target pushes to a different registry |
| DigitalOcean App Platform, built from the repository | No | Always. App Platform builds the newest commit of its branch, and the reason says a promotion only works while that's still the commit you're promoting |

The conditions, for the first three rows: staging ran the same commit of the service on the same kind of target, built for the same architecture, from the same build inputs (source, Dockerfile, build context, ecosystem, build command and start command), and recorded the image by digest. A release that predates digest-pinned images, or one whose connection can't read digests, has only a tag, so it builds again.
The conditions, for every row that reuses: staging ran the same commit of the service on the same kind of target, built for the same architecture, from the same build inputs (source, Dockerfile, build context, ecosystem, build command and start command), and recorded the image by digest. A release that predates digest-pinned images, or one whose connection can't read digests, has only a tag, so it builds again.

A gateway, a catalog service and a service pinned to an existing image have nothing built from a repository, so there's nothing to reuse. If the target environment's release strategy is `canary`, a reused image is what the canary ramps.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/guides/gitlab-repositories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ Only pushes to a project's default branch re-analyze, and only in the organizati

## Deploying

Every deployment target but two builds from the archive Loomplane fetched. Render and DigitalOcean App Platform build from the repository themselves, through their own GitLab connection, so connect GitLab in Render's or DigitalOcean's dashboard first. They build gitlab.com sources only. A source on a self-managed GitLab can't deploy to either, and the plan reports it.
Every deployment target builds from the archive Loomplane fetched, with two exceptions. Render builds from the repository itself, through its own GitLab connection. So does DigitalOcean App Platform for a static site, for a service with no Dockerfile, and for any service while there's no runner pool and DigitalOcean registry for Loomplane to build with (see [DigitalOcean](/docs/clouds/digitalocean)). Connect GitLab in Render's or DigitalOcean's dashboard first for those. They build gitlab.com sources only. A source on a self-managed GitLab can't deploy that way, and the plan reports it.
2 changes: 1 addition & 1 deletion apps/docs/content/docs/how-it-works.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ A developer can plan anything. Only an admin's approval changes a cloud, and the

## 6. Deploy

Approval starts a durable workflow. It stores one source tarball per repository, provisions resources, builds each service on its cloud's own builder (Cloud Build, CodeBuild, Vercel, Render, App Platform or ACR Tasks), deploys it, and checks that public services answer. If a step fails, you retry from that step. See [Deployments and recovery](/docs/concepts/deployments-and-recovery).
Approval starts a durable workflow. It stores one source tarball per repository, provisions resources, builds each service on its cloud's own builder (Cloud Build, CodeBuild, Vercel, Render, App Platform or ACR Tasks) or on a runner pool, deploys it, and checks that public services answer. If a step fails, you retry from that step. See [Deployments and recovery](/docs/concepts/deployments-and-recovery).

## 7. Watch for drift

Expand Down
10 changes: 7 additions & 3 deletions extensions/planning/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,13 @@ func (e *Extension) Register(fapp forge.App) error {
Ctrl: deployments.CtrlPlane{Providers: cp.Providers(), Instances: cp.Instances, Deploys: cp.Deploys},
Credentials: clouds,
},
"vercel": &deployments.Vercel{Client: vercelResourcesClient, Environments: nativeEnvironments},
"render": &deployments.Render{Client: render.New(e.cfg.Clouds.RenderEndpoint), Environments: nativeEnvironments},
"digitalocean": &deployments.DigitalOcean{Client: appPlatform},
"vercel": &deployments.Vercel{Client: vercelResourcesClient, Environments: nativeEnvironments},
"render": &deployments.Render{Client: render.New(e.cfg.Clouds.RenderEndpoint), Environments: nativeEnvironments},
// App Platform runs the images Loomplane's builders build, so
// DigitalOcean needs no access to the repository.
"digitalocean": &deployments.DigitalOcean{Client: appPlatform, Builder: &deployments.ImageBuilder{
FirecrackerAuthority: deployStore, NodeStreams: e.streams, Gate: &e.metering, Runners: e.runners, AWS: awsClient(),
}},
"azure-container-apps": &deployments.Azure{Client: azureClient()},
"azure-database": &deployments.AzureDatabase{Client: azureClient()},
"azure-managed-redis": &deployments.AzureRedis{Client: azureClient()},
Expand Down
Loading
Loading