Skip to content

Add Daytona backend - #4321

Merged
peterschmidt85 merged 7 commits into
masterfrom
daytona
Sep 30, 2026
Merged

peterschmidt85 merged 7 commits into
masterfrom
daytona

Conversation

@peterschmidt85

@peterschmidt85 peterschmidt85 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds Daytona backend support for CPU/GPU runs and volumes. It uses the online Daytona provider added in dstackai/gpuhunt#263.

  • Docker images: Uses Daytona's Declarative Builder to build images on demand, instead of registering pre-built Snapshots. The Dockerfile starts with FROM <configured image> and overrides the user and startup command so dstack can install and start the runner as root. Daytona's user option does not override the image's USER.
  • Private registries: Daytona requires a Registry containing the registry URL and credentials before it can pull a private image. When registry_auth is set, the backend creates this Registry and deletes it after deleting the sandbox.
  • Volumes: Daytona Volumes are S3-backed FUSE mounts. The API has no size or region parameters; dstack accepts a volume configuration without these fields and lets runs share the volume across Daytona regions.
  • Release gpuhunt 0.1.31.
  • Replace the main dependency with gpuhunt==0.1.31 and remove allow-direct-references.

@peterschmidt85
peterschmidt85 marked this pull request as ready for review September 29, 2026 09:39
@peterschmidt85

Copy link
Copy Markdown
Contributor Author

@mislavivanda would you like to review it?

@mislavivanda

Copy link
Copy Markdown

@mislavivanda would you like to review it?

Hey @peterschmidt85, sorry for a small delay here.

I've ran the backend end-to-end against production Daytona from this branch: CPU and GPU task both provisioned, ran and exited 0 - offers, quota labels, Declarative Builder path and the Toolbox runner bootstrap all behave exactly as the platform intends. LGTM.

One rough edge found by testing with a minimally-scoped API key: offers require the read:limits permission (organizations/{id}/usage returns 403 without it) and termination requires delete:sandboxes - but an under-scoped key configures successfully and then either yields silently empty offers or loops in NotYetTerminated on teardown. Conveniently, api-keys/current - which validate_config already calls - returns the key's permissions array, so the fix is free: check the required scopes (write:sandboxes, delete:sandboxes, read:limits, plus registry/volume scopes when used) against that list and fail fast with the missing ones named. Worth also listing the minimum permissions in backends.md. Not blocking - green light from our side.

@peterschmidt85
peterschmidt85 merged commit 1284826 into master Sep 30, 2026
26 checks passed
@peterschmidt85
peterschmidt85 deleted the daytona branch September 30, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants