Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy all hosts asynchronously rather than synchronously #3827

Open
sts-ryan-holton opened this issue May 9, 2024 · 5 comments
Open

Deploy all hosts asynchronously rather than synchronously #3827

sts-ryan-holton opened this issue May 9, 2024 · 5 comments

Comments

@sts-ryan-holton
Copy link

I'm using the latest version of Deployer to deploy my Nuxt JS project to multiple ipv6 hosts. If I were to deploy one host individually, it wouldn't take no more than 5 minutes. But when defining multiple hosts, it seems that it deploys synchronously through each one, I'd like to be able to configure it to deploy to all at the same time because it takes over an hour right now, additionally, if something fails, then deployments to all hosts fail and are locked which is quite frustrating.

What are your thoughts?

This is my deployment hosts:

host('a420:c3d3:ba97:c042:deff:8a15:fbfd:6276', 'c7b3:ea23:e29f:2564:8187:13aa:d2f3:bf36', 'ae7c:af20:e51d:1449:cc45:7e07:644f:33ba')
    ->set('branch', 'main')
    ->stage('all')
    ->set('repository', 'git@fudge:company/project)
    ->user('root')
    ->set('deploy_path', '/var/www/include-forms/fudge');

And I deploy running:

dep deploy all
@Schrank
Copy link
Contributor

Schrank commented May 9, 2024

From the doc:

Deployer runs a task in parallel on each host. This is why the output is mixed. We can limit it to run only on one host at a time.

This should be the default. Are you saying this doesn’t work for you?

can you check -vvv?

@sts-ryan-holton
Copy link
Author

It seems to take a long time. 41 minutes to deploy to around 20 - 25 hosts

@Schrank
Copy link
Contributor

Schrank commented May 9, 2024

Please try

dep deploy all -vvv

then you see wether it works parallel or not.

@antonmedv
Copy link
Member

additionally, if something fails, then deployments to all hosts fail and are locked

This is a feature of Deployer ʕっ•ᴥ•ʔっ

Deployer tried to keep all deployment hosts in sync (as Deployer does not know if it is save to deploy only to one host and allow other to fail).

This feature was requested a few times and I think it will be nice to add a simple API to configure deploy to run deploys not in sync.

Right now you can do:

  • Create a separate bash script to start each deploy to each host simultaneously:
dep deploy host1 &
dep deploy host2 &
dep deploy host3 &

@sts-ryan-holton
Copy link
Author

How do I know if parallel deploying is working with that flag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants