Dagger
Search

dagr

Manages Dagger Engines on a bunch of platforms

Installation

dagger install github.com/gerhard/daggerverse/dagr@7f47b54e2dd8daa18a38fc79246e2fd5f93a7f05

Entrypoint

Return Type
Dagr !
Arguments
NameTypeDefault ValueDescription
versionString -Dagger version to use (omit for latest): `--version=0.14.0`
appString -App name, defaults to version & unique name & date: `--app=dagger-v0-14-0-<GENERATED_NAME>-2024-11-19`
Example
dagger -m github.com/gerhard/daggerverse/dagr@7f47b54e2dd8daa18a38fc79246e2fd5f93a7f05 call \
func (m *myModule) example() *Dagr  {
	return dag.
			Dagr()
}
@function
def example() -> dag.Dagr:
	return (
		dag.dagr()
	)
@func()
example(): Dagr {
	return dag
		.dagr()
}

Types

Dagr 🔗

onFlyio() 🔗

Manages Dagger on Fly.io: dager call on-flyio --token=env:FLY_API_TOKEN

Return Type
Fly !
Arguments
NameTypeDefault ValueDescription
tokenSecret !-`flyctl tokens create deploy` then `--token=env:FLY_API_TOKEN`
orgString !"personal"Fly.io org name
primaryRegionString -Primary region to use for deploying new machines, see https://fly.io/docs/reference/configuration/#primary-region
diskString !"100GB"Persistent disk size in GB
sizeString !"performance-2x"VM size, see https://fly.io/docs/about/pricing/#compute
memoryString -Memory to request, see https://fly.io/docs/reference/configuration/#memory
gpuKindString -GPU kind to use, see https://fly.io/docs/reference/configuration/#gpu_kind
env[String ! ] -Environment variables to export on the machine, see https://fly.io/docs/reference/configuration/#the-env-variables-section Each env var needs to follow the TOML format (eg. MY_KEY = "value") FIXME(samalba): turn this into a map[string]string once supported by the Dagger Go SDK
Example
dagger -m github.com/gerhard/daggerverse/dagr@7f47b54e2dd8daa18a38fc79246e2fd5f93a7f05 call \
 on-flyio --token env:MYSECRET --org string --disk string --size string
func (m *myModule) example(token *Secret, org string, disk string, size string) *DagrFly  {
	return dag.
			Dagr().
			OnFlyio(token, org, disk, size)
}
@function
def example(token: dagger.Secret, org: str, disk: str, size: str) -> dag.DagrFly:
	return (
		dag.dagr()
		.on_flyio(token, org, disk, size)
	)
@func()
example(token: Secret, org: string, disk: string, size: string): DagrFly {
	return dag
		.dagr()
		.onFlyio(token, org, disk, size)
}

getApp() 🔗

Returns the app name: dagger call get-app

Return Type
String !
Example
dagger -m github.com/gerhard/daggerverse/dagr@7f47b54e2dd8daa18a38fc79246e2fd5f93a7f05 call \
 get-app
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Dagr().
			GetApp(ctx)
}
@function
async def example() -> str:
	return await (
		dag.dagr()
		.get_app()
	)
@func()
async example(): Promise<string> {
	return dag
		.dagr()
		.getApp()
}

Fly 🔗

manifest() 🔗

App manifest: dagger call on-flyio --token=env:FLY_API_TOKEN manifest file --path=fly.toml export --path=fly.toml

Return Type
Directory !
Example
dagger -m github.com/gerhard/daggerverse/dagr@7f47b54e2dd8daa18a38fc79246e2fd5f93a7f05 call \
 on-flyio --token env:MYSECRET --org string --disk string --size string \
 manifest
func (m *myModule) example(token *Secret, org string, disk string, size string) *Directory  {
	return dag.
			Dagr().
			OnFlyio(token, org, disk, size).
			Manifest()
}
@function
def example(token: dagger.Secret, org: str, disk: str, size: str) -> dagger.Directory:
	return (
		dag.dagr()
		.on_flyio(token, org, disk, size)
		.manifest()
	)
@func()
example(token: Secret, org: string, disk: string, size: string): Directory {
	return dag
		.dagr()
		.onFlyio(token, org, disk, size)
		.manifest()
}

deploy() 🔗

Deploy with default manifest: dagger call on-flyio --token=env:FLY_API_TOKEN deploy Then: export _EXPERIMENTAL_DAGGER_RUNNER_HOST=tcp://<APP_NAME>.internal:2345 Assumes https://fly.io/docs/networking/private-networking (clashes with Tailscale MagicDNS)

Return Type
String !
Arguments
NameTypeDefault ValueDescription
dirDirectory -No description provided
regions[String ! ] -No description provided
Example
dagger -m github.com/gerhard/daggerverse/dagr@7f47b54e2dd8daa18a38fc79246e2fd5f93a7f05 call \
 on-flyio --token env:MYSECRET --org string --disk string --size string \
 deploy
func (m *myModule) example(ctx context.Context, token *Secret, org string, disk string, size string) string  {
	return dag.
			Dagr().
			OnFlyio(token, org, disk, size).
			Deploy(ctx)
}
@function
async def example(token: dagger.Secret, org: str, disk: str, size: str) -> str:
	return await (
		dag.dagr()
		.on_flyio(token, org, disk, size)
		.deploy()
	)
@func()
async example(token: Secret, org: string, disk: string, size: string): Promise<string> {
	return dag
		.dagr()
		.onFlyio(token, org, disk, size)
		.deploy()
}

destroy() 🔗

Destroy the application: dagger call on-flyio --token=env:FLY_API_TOKEN destroy

Return Type
Void !
Example
dagger -m github.com/gerhard/daggerverse/dagr@7f47b54e2dd8daa18a38fc79246e2fd5f93a7f05 call \
 on-flyio --token env:MYSECRET --org string --disk string --size string \
 destroy
func (m *myModule) example(ctx context.Context, token *Secret, org string, disk string, size string)   {
	return dag.
			Dagr().
			OnFlyio(token, org, disk, size).
			Destroy(ctx)
}
@function
async def example(token: dagger.Secret, org: str, disk: str, size: str) -> None:
	return await (
		dag.dagr()
		.on_flyio(token, org, disk, size)
		.destroy()
	)
@func()
async example(token: Secret, org: string, disk: string, size: string): Promise<void> {
	return dag
		.dagr()
		.onFlyio(token, org, disk, size)
		.destroy()
}