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

Hot upgrade support #195

Open
edimoldovan opened this issue Nov 9, 2017 · 11 comments · May be fixed by #305
Open

Hot upgrade support #195

edimoldovan opened this issue Nov 9, 2017 · 11 comments · May be fixed by #305
Labels

Comments

@edimoldovan
Copy link

It seams that rollup updates are not supported. Any intention on supporting them?

@holetse
Copy link
Member

holetse commented Nov 10, 2017

Thanks for getting in touch @edimoldovan. I'm not sure exactly what you mean by a rollup update in this context. Can you give us a bit more details on what you are trying to accomplish please?

@nulian
Copy link

nulian commented Nov 24, 2017

He probably means hot upgrade releases where you do not stop the servers. But just upgrade the code. Was the first thing I noticed too when looking at this tool.

@edimoldovan
Copy link
Author

edimoldovan commented Nov 26, 2017

Sorry for the late reply. Indeed, I meant hot upgrades.
This is script I used for building locally (on a mac) and deploying and running on a debian machine:

./node_modules/brunch/bin/brunch b -p && MIX_ENV=prod mix do phoenix.digest, release --env=prod --upgrade
rsync -r _build/prod/rel/web/releases/$1/web.tar.gz root@<ip>:/var/www/<folder>/web/run/releases/$1/
ssh root@<ip> <<'ENDSSH'
cd /var/www/<folder>/web/run; bin/web migrate; bin/web upgrade 0.0.7
ENDSSH

Might look a bit primitive, but it was efficient.

@holetse
Copy link
Member

holetse commented Nov 27, 2017

Thanks for the clarification! We are currently gauging community interest around support for hot upgrades, but we don’t have a specific timeline/milestone for when we will support them. We’d welcome any contributions in that direction.

@holetse holetse changed the title Rollup updates Hot upgrade support Nov 27, 2017
@rjanja
Copy link
Contributor

rjanja commented Oct 23, 2018

The functionality shown in the snippet above can be reproduced in Bootleg using its remote macro:

use Bootleg.DSL

role :app, "example.com", workspace: "/opt/app"

task :hot_upgrade do
  vsn = config(:version)
  remote :app do
    "./bin/web migrate"
    "./bin/web upgrade #{vsn}"
  end
end
$ mix bootleg.invoke hot_upgrade

You can also hook into the existing build and deployment tasks, or override the update task.

I think we can safely close this issue. Thoughts?

@rjanja rjanja closed this as completed Jul 17, 2019
@guidotripaldi
Copy link

guidotripaldi commented Jul 18, 2019

I've just written some new tasks for supporting Distillery 2.1 hot upgrades:

bootleg.build_upgrade build the app by calling distillery.release --upgrade, i.e. producing the relup file
bootleg.deploy_upgrade setup the release for upgrading
bootleg.hot_upgrade upgrade the running release without stopping it with the last deployed release

bootleg.upgrade packs all previous steps together

if you think they can be useful, I can submit a PR

@rjanja
Copy link
Contributor

rjanja commented Jul 18, 2019

Hi @guidotripaldi ! Yes, that sounds very useful! I'm happy to help with the functional tests if you'd like to open a PR. Thanks!

@rjanja rjanja reopened this Jul 18, 2019
@guidotripaldi
Copy link

guidotripaldi commented Jul 18, 2019

Fine, thank you! Maybe it is better I wait for you merge PR #300 to master before I set up the PR, so it will be based on an already distillery_2.1-ready Bootleg version

@guidotripaldi
Copy link

In the meantime I've upload the hot_upgrade branch on github, try to check if it could be ok at https://github.com/guidotripaldi/bootleg/tree/hot_upgrade

@rjanja rjanja added the feature label Jul 19, 2019
@rjanja
Copy link
Contributor

rjanja commented Jul 19, 2019

That looks great @guidotripaldi. The distillery 2.1.0 changes have now been merged into master. Thanks!

@guidotripaldi
Copy link

guidotripaldi commented Jul 23, 2019

I've just submitted the PR #305 adding a hopefully useful sort of mini tutorial for the new tasks.
Please let me know about the functional tests :)

@guidotripaldi guidotripaldi linked a pull request Jul 23, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants