dagr
Manages Dagger Engines on a bunch of platforms
Installation
dagger install github.com/gerhard/daggerverse/dagr@v0.2.0Entrypoint
Return Type
Dagr !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | - | Dagger version to use (omit for latest): `--version=0.14.0` |
| app | String | - | 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@fd7368777dc3d05135a16ef401f878d4d0094b6f call \
func (m *MyModule) Example() *dagger.Dagr {
return dag.
Dagr()
}@function
def example() -> dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| token | Secret ! | - | `flyctl tokens create deploy` then `--token=env:FLY_API_TOKEN` |
| org | String ! | "personal" | Fly.io org name |
| primaryRegion | String | - | Primary region to use for deploying new machines, see https://fly.io/docs/reference/configuration/#primary-region |
| disk | String ! | "100GB" | Persistent disk size in GB |
| size | String ! | "performance-2x" | VM size, see https://fly.io/docs/about/pricing/#compute |
| memory | String | - | Memory to request, see https://fly.io/docs/reference/configuration/#memory |
| gpuKind | String | - | 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@fd7368777dc3d05135a16ef401f878d4d0094b6f call \
on-flyio --token env:MYSECRET --org string --disk string --size stringfunc (m *MyModule) Example(token *dagger.Secret, org string, disk string, size string) *dagger.DagrFly {
return dag.
Dagr().
OnFlyio(token, org, disk, size)
}@function
def example(token: dagger.Secret, org: str, disk: str, size: str) -> dagger.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@fd7368777dc3d05135a16ef401f878d4d0094b6f call \
get-appfunc (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@fd7368777dc3d05135a16ef401f878d4d0094b6f call \
on-flyio --token env:MYSECRET --org string --disk string --size string \
manifestfunc (m *MyModule) Example(token *dagger.Secret, org string, disk string, size string) *dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| dir | Directory | - | No description provided |
| regions | [String ! ] | - | No description provided |
Example
dagger -m github.com/gerhard/daggerverse/dagr@fd7368777dc3d05135a16ef401f878d4d0094b6f call \
on-flyio --token env:MYSECRET --org string --disk string --size string \
deployfunc (m *MyModule) Example(ctx context.Context, token *dagger.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@fd7368777dc3d05135a16ef401f878d4d0094b6f call \
on-flyio --token env:MYSECRET --org string --disk string --size string \
destroyfunc (m *MyModule) Example(ctx context.Context, token *dagger.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()
}