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

Add rsync_direct deployment strategy #335

Merged
merged 4 commits into from Oct 18, 2019
Merged

Add rsync_direct deployment strategy #335

merged 4 commits into from Oct 18, 2019

Conversation

shanedroid
Copy link
Contributor

Adds a rsync_direct deployment strategy which is slightly faster than the default rsync because it skips the copy step from the ansistrano_shared_rsync_copy_path to ansistrano_release_path for #243

… for traditional rsync deployment strategy.
@shanedroid shanedroid changed the title Added rsync_direct deployment strategy Add rsync_direct deployment strategy Sep 24, 2019
@ricardclau
Copy link
Member

ricardclau commented Oct 15, 2019

Sorry about the delay here... this is problematic as you cannot use the rollback role in this strategy. I am not against merging this but probably worth pointing that out in the README as well?

@shanedroid
Copy link
Contributor Author

this is problematic as you cannot use the rollback role in this strategy. I am not against merging this but probably worth pointing that out in the README as well?

Why can't the rollback be used? We are using this now and have still used ansistrano.rollback with it. I thought that during a rollback the actual release dir is what is used not the shared?

https://github.com/ansistrano/rollback/blob/master/defaults/main.yml#L6

ansistrano/rollback#3 (comment)

@ricardclau
Copy link
Member

ricardclau commented Oct 15, 2019

Oh sorry, my bad, I was thinking you would rsync to the same folder all the time but with this approach you basically upload everything in every deployment as rsync always compares to nothing so of course rollback can be used. However, I cannot see how this can be faster than the current approach TBH.

The intermediate folder was designed so that the network transfer was always minimal as generally speaking you would not change many things in every deployment and this strategy is often used from development computers to servers and not from, say, a Jenkins server in a close network to the final server.

I am curious, have you actually benchmarked it? How many files approx are there in your repos? Some assets or mostly code? Maybe with the connections we have these days and considering most cloud drives are actually network drives (local, but still network) it might not be relevant anymore.

@shanedroid
Copy link
Contributor Author

I have not personally benchmarked it - simply started using this method when we saw that it was marginally faster, primarily using this to deploy to EC2 in AWS, it made sense to just skip the extra local copy of files. Saw #243 so figured maybe others would use it too. For deployments where static assets got hosted along side any app src the time boost could start to get pretty substantial though. Can mention in README for clarity so people have a TLDR, when deciding which rsync strategy to use?

README.md Show resolved Hide resolved
@ricardclau
Copy link
Member

Yeah, perhaps adding some short TLDR would do so people can test both rsync approaches if interested.

Some EC2 instance types (looking at you, low end t3) have quite poor EBS performance and it these cases the extra copy can potentially make it slower in some codebases. Same could happen in shared hosts or other places where the drives are not having good performance.

At the end of the day, having options can't be bad :)

Thanks for your patience and waiting for some final tweaks!

@ricardclau ricardclau merged commit fed73d7 into ansistrano:master Oct 18, 2019
@ricardclau
Copy link
Member

Nice one! Thanks for your work! Merging and adding a new tag!

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

Successfully merging this pull request may close these issues.

None yet

2 participants