Page MenuHomePhabricator

Require 'libicu-dev' package and `npm install -g teleirc` for a Wikitech project
Closed, ResolvedPublic

Description

I want libicu-dev package for a Wikitech project. It creates a bridge between IRC and Telegram, and the application depends on that package.

I also need to run npm install -g teleirc which needs a sudo as well to make it work.
(related task T164910)

Details

Related Gerrit Patches:
operations/docker-images/toollabs-images : masterAdd libicu-dev to nodejs images

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 30 2017, 2:24 PM
Acagastya renamed this task from Require 'libicu-dev' package for teleIRC bot to Require 'libicu-dev' package for teleIRC bot for Wikitech project.Jun 30 2017, 2:27 PM
Acagastya updated the task description. (Show Details)
Acagastya updated the task description. (Show Details)
Acagastya renamed this task from Require 'libicu-dev' package for teleIRC bot for Wikitech project to Require 'libicu-dev' package and `npm install -g teleirc` for a Wikitech project.Jun 30 2017, 2:42 PM
Acagastya updated the task description. (Show Details)

@Acagastya where are you trying to do this work? Are you building a tool on Toolforge as we discussed in T164910: Request creation of <enwnbot> labs project (to bridge IRC channels and Telegram groups)? I know that @Amire80 has built a nodejs bot that talks to telegram and translatewiki. He actually used the hints that I gave in T164910#3271720 while working on T159368: update node.js on tools.telegrambot at the recent Vienna hackathon to migrate his bot into our Kubernetes environment. Maybe he can point us to some artifacts of his work that can be used to help get you started in the right direction.

To your original question, you will not be able to use npm -g install ... to make global installations in Tool Labs. Instead you can leave off the -g flag to install locally in a node_modules directory somewhere inside your tool's $HOME directory.

I thought we had already installed libicu-dev in all of the Kubernetes containers, but it turns out that we only added it to the Python and Python2 images.

Change 362457 had a related patch set uploaded (by BryanDavis; owner: Bryan Davis):
[operations/docker-images/toollabs-images@master] Add libicu-dev to nodejs images

https://gerrit.wikimedia.org/r/362457

Change 362457 merged by jenkins-bot:
[operations/docker-images/toollabs-images@master] Add libicu-dev to nodejs images

https://gerrit.wikimedia.org/r/362457

bd808 closed this task as Resolved.Jun 30 2017, 8:03 PM
bd808 claimed this task.

libicu and it's dev dependencies are now available in our nodejs Kubernetes containers:

$ ssh tools-login.wmflabs.org
$ become my-cool-nodejs-tool
$ webservice --backend=kubernetes nodejs shell
If you don't see a command prompt, try pressing enter.
$ mkdir T169338
$ cd T169338
$ npm install teleirc
(node:11) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
/
> node-icu-charset-detector@0.2.0 install /data/project/hatjitsu/T169338/node_modules/teleirc/node_modules/irc/node_modules/node-icu-charset-detector
> node-gyp rebuild

(node:22) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:22) DeprecationWarning: child_process: options.customFds option is deprecated. Use options.stdio instead.
make: Entering directory '/data/project/hatjitsu/T169338/node_modules/teleirc/node_modules/irc/node_modules/node-icu-charset-detector/build'
  CXX(target) Release/obj.target/node-icu-charset-detector/node-icu-charset-detector.o
  SOLINK_MODULE(target) Release/obj.target/node-icu-charset-detector.node
  COPY Release/node-icu-charset-detector.node
make: Leaving directory '/data/project/hatjitsu/T169338/node_modules/teleirc/node_modules/irc/node_modules/node-icu-charset-detector/build'

> iconv@2.2.3 install /data/project/hatjitsu/T169338/node_modules/teleirc/node_modules/irc/node_modules/iconv
> node-gyp rebuild

(node:97) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:97) DeprecationWarning: child_process: options.customFds option is deprecated. Use options.stdio instead.
make: Entering directory '/data/project/hatjitsu/T169338/node_modules/teleirc/node_modules/irc/node_modules/iconv/build'
  CXX(target) Release/obj.target/iconv/src/binding.o
  CC(target) Release/obj.target/iconv/deps/libiconv/lib/iconv.o
  SOLINK_MODULE(target) Release/obj.target/iconv.node
  COPY Release/iconv.node
make: Leaving directory '/data/project/hatjitsu/T169338/node_modules/teleirc/node_modules/irc/node_modules/iconv/build'
teleirc@0.4.6 node_modules/teleirc
├── os-homedir@1.0.2
├── irc-colors@1.3.3
├── mkdirp@0.5.1 (minimist@0.0.8)
├── winston@2.3.1 (cycle@1.0.3, stack-trace@0.0.10, eyes@0.1.8, isstream@0.1.2, async@1.0.0, colors@1.0.3)
├── node-static@0.7.9 (mime@1.3.6, colors@1.1.2, optimist@0.6.1)
├── yargs@4.8.1 (get-caller-file@1.0.2, decamelize@1.2.0, lodash.assign@4.2.0, y18n@3.2.1, which-module@1.0.0, set-blocking@2.0.0, window-size@0.2.0, require-ma
in-filename@1.0.1, require-directory@2.1.1, yargs-parser@2.4.1, os-locale@1.4.0, string-width@1.0.2, cliui@3.2.0, read-pkg-up@1.0.1)
├── git-rev-sync@1.9.1 (escape-string-regexp@1.0.5, graceful-fs@4.1.11, shelljs@0.7.7)
├── node-telegram-bot-api@0.21.1 (file-type@3.9.0, mime@1.3.6, debug@2.6.8, bluebird@2.11.0, request@2.81.0)
├── lodash@4.17.4
└── irc@0.5.2 (node-icu-charset-detector@0.2.0, iconv@2.2.3)
$ find . -name '*.o'
./node_modules/teleirc/node_modules/irc/node_modules/node-icu-charset-detector/build/Release/obj.target/node-icu-charset-detector/node-icu-charset-detector.o
./node_modules/teleirc/node_modules/irc/node_modules/iconv/build/Release/obj.target/iconv/deps/libiconv/lib/iconv.o
./node_modules/teleirc/node_modules/irc/node_modules/iconv/build/Release/obj.target/iconv/src/binding.o
$ ./node_modules/.bin/teleirc --help
Usage: /usr/bin/nodejs node_modules/.bin/teleirc [options]

Options:
  -c, --config      Use config from given path
  -g, --genconfig   Generate a new default config
  -j, --join-tg     Show official Telegram support group invite URL
  -v, --verbose     Enable verbose output                                [count]  --version         Show teleirc version and quit
  --upgrade-config  Replace deprecated options and add new options to config
  -h, --help        Show help                                          [boolean]
Restricted Application added a project: User-bd808. · View Herald TranscriptJun 30 2017, 8:03 PM

Yep, I am indeed developing a Telegram bot that makes edits on MediaWiki. The code is at https://github.com/amire80/mediawiki-telegram-bot/ and it's in pretty active development now. I'll be happy to collaborate.