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

Upgrade checklist updates #967

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dacook
Copy link
Member

@dacook dacook commented Nov 28, 2024

Some more updates to the upgrade checklist and readme.
I'd like to update the process further and simplify it.. but haven't got time for that.

[skip ci]
@dacook dacook self-assigned this Nov 28, 2024
@dacook dacook changed the title Upgrade updates Upgrade checklist updates Nov 28, 2024
@dacook dacook marked this pull request as ready for review December 16, 2024 23:12
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvements.

@@ -17,9 +19,10 @@ Checklist based on general guide https://github.com/openfoodfoundation/ofn-insta
- [ ] DNS: add temporary domain (eg `prod2.openfoodnetwork.org`)

### config
- [ ] Add temporary name to `inventory/hosts`
- [ ] Add temporary name to `inventory/hosts` (suggest doing this on separate branch)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering about this temporary host name. I don't think it's temporary. Don't we want to be able to identify a unique host like prod4.openfoodnetwork.org.au which is providing the site openfoodnetwork.org.au?

@@ -41,7 +44,7 @@ Then setup new server. Ensure you have the correct secrets (current secrets are
- [ ] Setup direct ssh access for `ofn-admin` and `openfoodnetwork` as per guide
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you link to the guide?

@@ -9,6 +9,8 @@ assignees: ''

Checklist based on general guide https://github.com/openfoodfoundation/ofn-install/wiki/Migrating-a-Production-Server

Tip: find/replace to set up most commands ready to go, eg: `x_prod` -> `ca_prod`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should use easy to replace example names like old_server and new_server which could be prod or staging. Some of the guide just refers to x instead of x_prod as well. It would be good to make this consistent.

- [ ] old server: make a tiny data change to verify later (eg add `.` in meta description `/admin/general_settings/edit`)

### switchover: old server
- [ ] 🚧 `maintenance_mode.yml`
- [ ] 🚧 `ansible-playbook playbooks/maintenance_mode.yml -l x_prod`
- [ ] `sudo systemctl stop sidekiq redis-jobs puma`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add disable as well? Just in case the server gets restarted accidentally. It means that rolling back is also one step more (enable) but it makes the intent of retiring the server at this stage clearer. And it could prevent us from accidentally running a start or restart command on the old server.

- [ ] `db_transfer.yml` ~3min
- [ ] `sudo systemctl stop postgres` (ensure other integrations no longer touch it)
- [ ] `transfer_assets.yml` just in case
- [ ] `sudo systemctl stop postgresql` (ensure other integrations no longer touch it)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. I think that disable would be good as well.

- [ ] `db_transfer.yml` ~3min
- [ ] `sudo systemctl stop postgres` (ensure other integrations no longer touch it)
- [ ] `transfer_assets.yml` just in case
- [ ] `sudo systemctl stop postgresql` (ensure other integrations no longer touch it)

### switchover: new server
- [ ] `sudo systemctl restart puma; sudo systemctl start sidekiq redis-jobs`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sidekiq is disabled at this point. We have to enable it first before we can start it. But I personally would probably do it staggered:

  • Start puma and check with hosts file.
  • Start sidekiq and check log file.
  • Then install proxy forwarding.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much time did you need for testing? If it's short, maybe we could do it during maintenance mode which would enable us to then switch over straight away. It would save us all the work of transferring data twice and resetting in between.

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

Successfully merging this pull request may close these issues.

2 participants