-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Include capistrano tasks that reload the services after deploying. #12642
Include capistrano tasks that reload the services after deploying. #12642
Conversation
Can you submit those? Although I'm not sure reloading Sidekiq makes a difference since it's not user-facing and is not accepting connections. Curious how you got the streaming server to reload. |
Certainly! Do you want them in a PR, fully integrated, or do you want them for reference, attached? Because in order to make them a full PR, I'll have to rewrite their structure and logic from my setup to that for mastodon.
Well, Sidekiq is using the codebase, database structure and so on, so you'll want to reload after a new deploy. E.g. to get new mail-templates, locales or to use migrated models. |
Sorry, you misunderstood. I'm talking about |
config/deploy.rb
Outdated
end | ||
|
||
after 'deploy:publishing', 'systemd:web:reload' | ||
after 'deploy:publishing', 'systemd:sidekiq:reload' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, only web
has a reload
. The others need a restart
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood.
I've changed and refactored the code.
Rebased and force pushed too.
After a successfull deploy, I need the services to switch over to use the new code. I need to restart the services. These capistrano tasks do that.
6a4f787
to
2b3f967
Compare
After a successfull deploy, I need the services to switch over to use the
new code. I need to (re)start the services. Also, often, I need to inspect whether the services are running or why they crashed.
The capistrano tasks in this PR do that.
I'm not certain whether this is useful to mastodon at all.
Please let me know what you think about this PR. Is it useful to Mastodon? Would it be useful if I make some changes? Or should it simply be closed?
It might be more appropriate in the specific environment-deploy files for example:
config/deploy/production.rb
. Otherwise, I probably need to add documentation (but where?) and a PR in the ansible-repo to set this up properly.On my server, using ansible, I configure the deploy user to be allowed to restart services. Without such a configuration, the deploy will fail with this setup.
EDIT: additional detail, is that it depends on the service and its setup whether it can be reloaded. I have set up my units on my server such that they can be reloaded but with the service-examples in
/dist
of this repo, for example, Sidekiq cannot be reloaded, only restarted.