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 to node 16 (gallium) #1096

Closed
10 tasks done
larsyencken opened this issue Jan 25, 2022 · 2 comments · Fixed by #1107
Closed
10 tasks done

Upgrade to node 16 (gallium) #1096

larsyencken opened this issue Jan 25, 2022 · 2 comments · Fixed by #1107
Assignees

Comments

@larsyencken
Copy link
Contributor

larsyencken commented Jan 25, 2022

What

We are currently on Node 12.22.3 (erbium) which reaches end-of-life in April this year. We would like to update to 16.13.2 (gallium), both for speed and continued support, but also because it's blocking an upgrade to Webpack 5.

Steps

  • Remove the fibers package
  • Update .nvmrc to gallium
  • Test that everything works locally
  • Test that everything works on a staging server
  • Solve outstanding problems
    • Admin server restart when special charts are updated
    • Wordpress's yarn runPostUpdateHook runs using the wrong Node version
  • Probe the whole upgrade process
  • Deploy to live
  • Make sure the pm2 path given in /etc/systemd/system/pm2-owid.service is correct (see: Server setup: set up PM2 startup)
@marcelgerber marcelgerber self-assigned this Jan 25, 2022
@marcelgerber
Copy link
Member

marcelgerber commented Jan 25, 2022

Okay we're in a good state here now; all staging servers are now running on Node 16 and mostly fine.12

This here is the procedure we will have to run on live:

pm2 stop live live-deploy-queue

nvm install 16.13.2
nvm alias default 16
npm install -g yarn pm2
sudo vim /etc/systemd/system/pm2-owid.service # change 'v12.22.3' to 'v16.13.2'

# Install Node 16 through apt; this is what will be used by Wordpress when it runs `yarn runPostUpdateHook`
sudo apt remove nodejs
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs

# Re-create pm2 entries so they use the correct PATH and run using Node 16
cd live
pm2 stop live live-deploy-queue
pm2 delete live live-deploy-queue
pm2 start --time --name live "yarn startAdminServer"
pm2 start --time --name live-deploy-queue "yarn startDeployQueueServer"
pm2 save

# Deploy with Node 16 changes merged

sudo reboot # see that everything still works
pm2 log live # check for errors
pm2 log live-deploy-queue # check for errors

Footnotes

  1. One exception is that, for all servers that don't have 140a68e applied (currently all but tufte), the admin server will restart after a chart update for a chart that doesn't have country data.

  2. We can actually keep some (especially older) staging servers running on Node 12 and only update newer ones to Node 16, no problem.

@marcelgerber marcelgerber linked a pull request Jan 27, 2022 that will close this issue
@marcelgerber
Copy link
Member

All done, live and staging servers are all updated to Node 16.

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 a pull request may close this issue.

2 participants