Repository navigation
Build App Platform services as images so DigitalOcean needs no GitHub link - #28
Merged
Merged
Conversation
… link DigitalOcean's API can't connect a GitHub or GitLab account to App Platform; only someone signed in to its control panel can. A deploy without that link failed with "GitHub user not authenticated". A DigitalOcean service or worker with a Dockerfile, or a Go module, now plans a build target: the default runner pool builds it, and it's pushed to the account's DigitalOcean container registry, the only one App Platform pulls from without a password. The app runs the image by digest, and the wait checks the live deployment runs that digest, so nothing at DigitalOcean reads the repository and any repository host works. The registry is checked against the app's account before anything builds. Static sites, which App Platform can't run from an image, and services with no Dockerfile still build on App Platform from the repository. So does every service until a runner pool and a DigitalOcean registry are set up, so existing projects keep deploying; the plan warns what's missing. Promotions reuse an image pushed to the same registry, and a rollback returns to the recorded deployment and checks its image. A rollback across the switch between the two kinds of build is refused. Verified: go test for internal/planning, internal/deployments, internal/clouds/digitalocean, extensions/planning and internal/agentknowledge; golangci-lint on the same packages. Tested against a fake App Platform API only: whether App Platform pulls a same-team DOCR image without credentials, accepts a nested repository path, and takes a sha256: digest isn't stated in its docs.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A DigitalOcean deploy failed with
GitHub user not authenticated. App Platform built from the repository through DigitalOcean's own GitHub connection, and DigitalOcean's API has no way to set that connection up. Only someone signed in to DigitalOcean's control panel can.What changes
internal/planning/app_platform.go): a DigitalOcean service or worker with a Dockerfile, or a Go module, gets a build target. It builds on the default runner pool, or onbuild.builder, and pushes to the account's DigitalOcean container registry, orbuild.registry. A registry outside DigitalOcean's, a CodeBuild builder, or a builder that doesn't build amd64 is a plan problem.internal/deployments/digitalocean.go): checks that the reviewed registry is in the app's account before building, builds throughImageBuilder, and sets the component'simagesource (DOCR, repository, digest;registryonly when the account has several).WaitImageDeploymentchecks that the live deployment's spec runs the built digest. Retries resume from the checkpoint.registryname, which comes and goes with the account's registry count.Setup it needs
registryscope. Each image deploy lists the account's registries.Verification
go testpasses forinternal/planning,internal/deployments,internal/clouds/digitalocean,extensions/planningandinternal/agentknowledge.golangci-lintis clean on the same packages.Not verified against real DigitalOcean. Its app spec reference doesn't say whether App Platform pulls a same-team DOCR image without credentials, whether it accepts a nested repository path like
loomplane/api, or what format the digest takes. These tests use a fake App Platform API. A real deploy should confirm all three before this is relied on.