Deploy whole project (multiple apps)

Hi Hashi & co!

I am currently evaluating waypoint.

When I try to run waypoint up at the root of a project, I get the very descriptive message:

This command requires a single targeted app. You have multiple apps defined.
so you can specify the app to target using the "-app" flag.

But… why? Isn’t the whole point of a project to be managed as a group of sub-items (apps) ?

I only specified two apps in my waypoint.hcl (I used your example apps). But what if I have tens/hundreds/thousands of apps?

Am I missing something?

Thank you!

# waypoint.hcl

project = "main"

app "example-nodejs" {
  path = "nodejs"

  labels = {
    "service" = "example-nodejs",
    "env" = "dev"
  }

  build {
    use "pack" {}
  }

  deploy { 
    use "docker" {}
  }
}

app "web" {
    path = "static"

    build {
        use "docker" {
        }
    }

    deploy {
        use "docker" {
        }
    }
}
1 Like

Hello! Thanks for giving it a shot. You’re right! This is good feedback. This is a limitation we intend to just be temporary and kind of forgot about it.

There is no significant technical reason that we don’t allow this today. It is a mix of a few reasons (all of which we could work around today and I’ll mention later):

(1) We intend for multiple apps to be parallelizable since builds can take awhile, and we just didn’t have the machinery in place with 0.1 to support this in the CLI. We’re in a much better place now but it still requires some work. Potential workaround: we could just run through each app serially for now.

(2) Failure modes are somewhat bad right now since we don’t have any built-in concept of treating an operation over a group of apps as atomic. Potential workaround: we could just not handle errors any differently than how they’re handled if you executed the CLI one by one.

(3) Some level of coalescing the output at the end so you can see the URLs for all your apps and so on. I think at a bare minimum we should do this since it isn’t technically very difficult and I think the UX otherwise is not good.

Internally you can see we laid out some pieces with the expectation that multiple apps will be run in the future in one invocation. Implementation of commands like up use a DoApp() helper with a callback that we expected to call multiple times for each app (potentially in parallel potentially not).

Regardless, this is a good reminder to think about this again some more and maybe create a “good enough” stop gap while we make it fancier. :slight_smile: Thoughts?

4 Likes