superfly / flyctl-actions

:octocat: GitHub Action that wraps the flyctl
Apache License 2.0
260 stars 33 forks source link

Make `flyctl scale` blocking? #32

Closed onpaws closed 1 year ago

onpaws commented 1 year ago

TL, DR

flyctl scale calls SetAppVMSize which calls the setVmSize mutation. This mutation appears to schedule the scale job asynchronously/returns early, but I want to use flyctl to set VM size synchronously - possible?

Background

I'm trying to write a CI GHA that temporarily scales a VM up for a brief-but-resource-hungry job, then scales the VM back down after. I noticed flyctl monitor is blocking and comes close to what I need, however apparently if I don't call it at exactly the right time, it fails which breaks the job.

Not sure best way to arrange, but something like e.g. flyctl scale --wait {...} would be nice.

$ flyctl scale {...}
Scaled VM Type to
 dedicated-cpu-4x
      CPU Cores: 4
         Memory: 32 GB
$ sleep(x) where x is "the correct" amount of time
$ flyctl monitor
Error app seafowl-socrata is not currently deploying a release. The build and release command must succeed before a release is deployed. The latest release version is 51
# uh oh, wrong amount of time
jsierles commented 1 year ago

In the new v2 platform, scaling blocks, so closing this.

https://fly.io/docs/reference/apps/#apps-v2