Page MenuHomePhabricator

Setup Config:Dashiki:CX2Translations as a public chart and update the Dashiki documentation accordingly
Closed, ResolvedPublic

Description

I created a report updater job that creates this file: https://analytics.wikimedia.org/datasets/periodic/reports/metrics/published_cx2_translations/ . It appears to work correctly, but it also needs to show the data as a chart (see T196435).

I created configuration in a wiki page at https://meta.wikimedia.org/wiki/Config:Dashiki:CX2Translations and I tried following the instructions at https://wikitech.wikimedia.org/wiki/Analytics/Systems/Dashiki#Test_your_dashboard_config_locally , but I had many issues with installing Dashiki, gulp, bower, etc. The README and the wiki page appear to be out of date. @Nuria said on IRC: "i think our setup of dashiki needs an update to work well, do send us a ticket about your dashboard and we will get to it."

I try to do the following:

  • Clone Dashiki from Gerrit.
  • npm install
  • sudo npm install -g gulp
  • cd semantic && gulp build

The "gulp build" step fails with:

macdavid:dashiki aaharoni$ cd semantic && gulp build
[08:23:28] Working directory changed to ~/dev/dashiki
[08:23:29] [ERROR] you need --layout and --config parameters to build

/Users/aaharoni/dev/dashiki/gulpfile.js:137
    throw msg;
    ^
[ERROR] you need --layout and --config parameters to build

The documentation at the wikitech wiki also says:

Note: In addition to install gulp, you also need to install bower globally, then install bower locally in your directory.

Clone dashiki depot:

git clone ssh://<user>@gerrit.wikimedia.org:29418/analytics/dashiki

Install bower locally or globally:

Install bower globally,

npm install -g bower

To install bower locally, cd to your directory, and:

bower install

The bower install step fails, too:

macdavid:dashiki aaharoni$ bower install
bower ENOENT        No bower.json present

Event Timeline

Amire80 triaged this task as High priority.Sep 4 2018, 10:11 PM
Amire80 created this task.
Restricted Application added a project: Analytics. · View Herald TranscriptSep 4 2018, 10:11 PM
Amire80 updated the task description. (Show Details)Sep 5 2018, 5:25 AM
Amire80 updated the task description. (Show Details)Sep 5 2018, 7:14 AM
fdans moved this task from Incoming to Smart Tools for Better Data on the Analytics board.
Amire80 removed Amire80 as the assignee of this task.Sep 7 2018, 10:31 AM
Nuria assigned this task to fdans.Sep 7 2018, 2:36 PM
fdans added a comment.Sep 10 2018, 2:08 PM

Hey @Amire80 it seems that when you do gulp build on the semantic directory for some reason it changes to the parent dir. --config and .--layout are the two dashiki parameters to generate the graphs. Other than that I just went through the steps with a fresh clone of the repo and everything seems to be working fine.

Can you make sure that you do gulp build inside the semantic directory, and that when you npm installed, the semantic directory was created with its bunch of files? Also your OS version, nodejs version and npm version might give us a hint.

Also your OS version, nodejs version and npm version might give us a hint.

This is macOS 10.13.6 and:

macdavid:dev aaharoni$ node -v
v10.9.0
macdavid:dev aaharoni$ npm -v
6.4.1

Now, I'm not sure what changed, but it looks differently now from how it was when I created the task. Here's what I'm doing:

macdavid:dev aaharoni$ git clone https://amire80@gerrit.wikimedia.org/r/analytics/dashiki
Cloning into 'dashiki'...
remote: Counting objects: 3, done
remote: Total 2551 (delta 0), reused 2551 (delta 0)
Receiving objects: 100% (2551/2551), 2.37 MiB | 502.00 KiB/s, done.
Resolving deltas: 100% (1878/1878), done.
macdavid:dev aaharoni$ cd dashiki/
macdavid:dashiki aaharoni$ npm install

> canvas@1.6.11 install /Users/aaharoni/dev/dashiki/node_modules/canvas
> node-gyp rebuild

./util/has_lib.sh: line 31: pkg-config: command not found
gyp: Call to './util/has_lib.sh freetype' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:239:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/Cellar/node/10.9.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/aaharoni/dev/dashiki/node_modules/canvas
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 

> fsevents@1.2.4 install /Users/aaharoni/dev/dashiki/node_modules/fsevents
> node install

[fsevents] Success: "/Users/aaharoni/dev/dashiki/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> semantic-ui@2.3.3 install /Users/aaharoni/dev/dashiki/node_modules/semantic-ui
> gulp install

[18:05:28] Using gulpfile ~/dev/dashiki/node_modules/semantic-ui/gulpfile.js
[18:05:28] Starting 'install'...

Cannot locate files to update at path:  /Users/aaharoni/dev/dashiki/semantic/src/definitions
Running installer
[18:05:28] Starting 'run setup'...
? It looks like you have a semantic.json file already. (Use arrow keys)
❯ Yes, extend my current settings. 
  Skip install

In the end there I can select something using the arrow keys on my keyboard, and I don't know what to select. This is before installing gulp or bower.

@Amire80, Francisco's right about the setup. However, if you have a config page testing it locally isn't too important, I published your dashboard and it looks good (we always do that step anyway):

http://language-reportcard.wmflabs.org/cx2

Oh, thanks! It looks good, indeed.

My last comment is still correct though—I couldn't set it up locally, and if anybody ever has to do that, the docs should probably be refreshed.

fdans added a comment.Sep 11 2018, 2:19 PM

@Amire80 it seems then that you've been skipping the installation of semantic, which explains why when running gulp build on the semantic dir, gulp would cd back to the main directory and try to run the dashiki builder. The solution to this is to select "Yes, extend my current settings" when npm installing, on the semantic part. I will update this on the docs.

Amire80 closed this task as Resolved.Sep 11 2018, 2:49 PM

Alá vai o meu heroe! Thanks, that's what I've meant.

Petar.petkovic moved this task from Next Up to Done on the Analytics-Kanban board.