Declarative configuration

There is currently work underway concerning this. Mostly because I wanted it for myself :slight_smile: It’s actually what our new remote builders use!

I’ve made a GraphQL mutation to launch an app with volumes, VM count, VM size, regions, etc. Like all our GraphQL API, it’s largely undocumented.

However, here’s how you can use it:

mutation($input: LaunchAppInput!) {
  launchApp(input: $input) {
    app { id, name }
    release { id, version, inProgress }
  }
}

where LaunchAppInput looks like this:

{
  organizationId: "your organization graphql node id",
  name: "my-app-name",
  config: {
    mounts: [{
      source: "vol",
      destination: "/voldata",
    }],
    services: [
      {
        ports: [{
          port: 443,
          handlers: ["tls", "http"]
        }]
      }
    ],
    env: {
      FOO: "bar"
    }
  },
  image: "registry/image",
  vmSize: "DEDICATED_CPU_1X",
  regions: ["EWR", "YYZ"],
  secrets: [
    {
      key: "foo",
      value: "bar",
    },
    {
      key: "hello",
      value: "world",
    },
  ],
  volumes: [
    {
      name: "vol",
      sizeGb: 15,
      region: "EWR"
    },
    {
      name: "vol",
      sizeGb: 15,
      region: "YYZ"
    }
  ]
}

You’ll need to have an image built and pushed already, either in a public repository or on us (in the same organization).

Anyway, I don’t recommend using this just yet until we make it better :slight_smile:

It’s also not idempotent. It won’t update an app with new configs, this is just to create an initial app.