Wikimedia production uses Node.js 6.11.0. Vagrant uses 6.16.0 (currently; for some reason only the major version is pinned). It should match production, or (preferably) make it possible to select the node version per service.
Description
Details
Related Objects
- Mentioned In
- T259988: Decide the fate of Parsoid/JS Puppet in Mediawiki-Vagrant
T260503: Split visualeditor Vagrant role
T236975: Vagrant eventbus role can't be installed because of node_version
T237819: Install VisualEditor and Citoid on Wikispore
T236282: `npm run selenium` fails on MW Vagrant (SyntaxError: Unexpected identifier; due to Node 6)
T232495: selenium-daily-beta-CirrusSearch is broken
T229033: wdio-cucumber-framework fails on NodeJS due to fibers@2.x under nodejs10
T210506: `npm install` fails for mediawiki/core with EPEERINVALID when running on Node 11
T217253: Improve error handling in Proton tests
T213367: Add MediaWiki-Vagrant role for Proton - Mentioned Here
- rMWVA427f1168c688: Update Vagrant to Node 16
T308371: Migrate node-based services in production to node16
T210704: Migrate node-based services in production to node10
T210506: `npm install` fails for mediawiki/core with EPEERINVALID when running on Node 11
Event Timeline
We should use the same version of node/npm across mw-vagrant, CI and production. See T210506#5065817.
We are now using NodeJS 10. That can be aligned with Wikimedia production by using:
deb http://apt.wikimedia.org/wikimedia stretch-wikimedia component/node10 #deb-src http://apt.wikimedia.org/wikimedia stretch-wikimedia component/node10
Change 545832 had a related patch set uploaded (by Zfilipin; owner: Zfilipin):
[mediawiki/vagrant@master] WIP Update Node.js to v10
Change 545832 abandoned by Zfilipin:
WIP Update Node.js to v10
Reason:
no activity in a week
Production uses a mix of node 6 and node 10 (the more important ones are still on 6), see T210704: Migrate node-based services in production to node10.
So vagrant needs the ability to use multiple node versions in parallel. Currently either the eventlogging or the restbase role is broken, depending on how one sets npm::node_version.
So basically, we need to install something like nvm, install node manually (can't use apt / dpkg anymore; which also means we cannot automatically track production), extend npm::install and npm::update with a version parameter and make them call nvm use before-after the npm call, and do the same (of use nvm exec) for nodejs calls.
Alternatively, we could just wait until everything is kubernetized, at which point the issue will hopefully go away on its own.
Wrt using node 10 based CI tools on vagrant, my workaround is using nodeenv. It goes something like
sudo pip install nodeenv cd <repo> nodeenv ./nodeenv --node=10.20.1 source ./nodeenv/bin/activate npm install npm test deactivate_node
Change 932452 had a related patch set uploaded (by Gergő Tisza; author: Mainframe98):
[mediawiki/vagrant@bullseye-migration] NodeJS: Use the version (12) that is provided by bullseye
Change 932452 merged by jenkins-bot:
[mediawiki/vagrant@bullseye-migration] NodeJS: Use the version (12) that is provided by bullseye
Previously the MediaWiki services were collocated on hosts with a fixed version of Node JS (version 10 at the time iirc). Nowadays they are running in Docker image which might have different versions of NodeJS depending on their maintainers velocity. At least MediaWiki vagrant got updated to NodeJS 12.
It actually didn't.
vagrant@test:~$ node --version v6.14.4
...which is just a consequence of RESTBase still being on Node 6. So we'll either have to wait for RESTBase to be fully deprecated or remove / update all Vagrant roles that require it (restbase, mobilecontentservice, proton, visualeditor_wikimedia, wikimediaproduction).
Change 982180 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):
[mediawiki/vagrant@master] Update Vagrant to Node 16
Change 982180 merged by jenkins-bot:
[mediawiki/vagrant@master] Update Vagrant to Node 16
After merging rMWVA427f1168c688: Update Vagrant to Node 16, Node.js is now (by default) at v16.20.2. Production is mostly on Node 10 I believe, but being migrated to 16 (T308371: Migrate node-based services in production to node16) so close enough.
Originally this task was about matching both major and minor version of Node with production, but that's probably not worth the effort.
Change #1040852 had a related patch set uploaded (by Gergő Tisza; author: Mainframe98):
[mediawiki/vagrant@master] NodeJS: Use the version (12) that is provided by bullseye
Change #1040852 merged by jenkins-bot:
[mediawiki/vagrant@master] NodeJS: Use the version (12) that is provided by bullseye