How deploy to just one machine?

Hi! I am currently investigating a bug in our CI workflow, where I spin up a temporary pocketbase db instance for each branch. This db has no persistent volume attached.

Lately (since we migrated to machines, perhaps?) I have experienced a bug where our e2e-tests sometimes fails and I suspect that the following (from docs) is the problem:

fly deploy creates two Machines per process, for resilience purposes.”

It sounds like something that may cause havoc since it is 50/50 that the “right” machine is used. It is a hypothesis at least.

I don’t see any options in fly.toml for configuring this. Is there such? If not, can you add it? It is not always the case that you want a resilient setup if it adds complexity and cost. I just one app running in one machine.

Furthermore, the docs says

"When Machines are created or destroyed using either of the above methods, the resulting scale is preserved by fly deploy —except in the case that you scale right down to zero Machines. In that case, fly deploy seeds the app with new Machines according to the primary_region and [processes] configured in fly.toml "

What does it mean “according to primary_region”? Can I control the scale with that field? fra(1) ? If I use fly scale count 1, will that option be saved? Where?

Please enlighten me! :pray:

1 Like

I have now added an extra step in my workflow, immediately running flyctl scale count 1 -a **** --yes after the deploy step. It seems to work, but it feels a bit wasteful to first deploy 2 machines and then scale down to one.

I still think there should be a way of configuring this in the fly.toml-file. Is there? I can’t find it.

You can use --ha=false flag with fly launch or fly deploy. That will disable the default of shipping two machines on first deploy.

2 Likes

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