Deploying a multi process app and I don't want any machines running in one of the groups after a deploy.

I’ve got a rails application running with an app and job group. I’ve got the job group scaled to 5 machines. Most of the time I want all the servers to be off in the jobs group. I’m treating them as a pool and will start machines as need.

I first thought that I could scale the group down but that will destroy the machines in the group. Which means that I would have to recreate them when I want to run a job - and destroy them when jobs are done. I wanted to leave them in a off state (as not to run up billing I’ve got a very bursty workload that drops to 0 most of the time)

Right now I’m thinking of adding a step to the deployment that shuts them all off after a deployment, but I think I would like it better if I could update them but leave them in their existing state (off or on).

Is anyone else doing something similar? What strategies have you employed?

Thanks,
Kevin

Hi Kevin,

I noticed this on an internal app as well, and I have a working draft of a solution that would skip stopped machines during a deploy. However, a machine may also be stopped because it’s crashing or misconfigured which a user may be trying to fix with a deploy, so I’m considering setting the default to only skip stopped machines when autostart / autostop are configured on a service. Would this work for your case- are your stopped machines configured to use autostart / autostop, or are you starting them on-demand using the API/CLI?

1 Like

Heads up, we’ve released a change to leave machines with auto-scaling services stopped during a deploy in flyctl v0.1.119:

fly deploy: skip launch for stopped autoscaled machines (#2992)

Hope this helps your case, give it a try and let me know if it works for you!

1 Like

I’m starting them on demand with the API.

I can’t use the auto scaling since the machines do not provide an HTTP interface, they are job runners connecting to Postgresql

Great, I’ll see if that works for my use case, does the image that the machine is using still get updated even tho the machine does not get started?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.