This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env nodejs | |
'use strict'; | |
const cassandra = require('cassandra-driver'); | |
const P = require('bluebird'); | |
const preq = require('preq'); | |
const yargs = require('yargs'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const preq = require('preq'); | |
return preq.post({ | |
uri: 'https://en.wikipedia.org/w/api.php', | |
headers: { | |
'content-type': 'application/json' | |
}, | |
body: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# curl http://208.80.154.57:9090/pools/restbase_7231 | sort | |
restbase1007.eqiad.wmnet: enabled/up/pooled | |
restbase1011.eqiad.wmnet: enabled/up/pooled | |
restbase1012.eqiad.wmnet: enabled/up/pooled | |
restbase1013.eqiad.wmnet: enabled/up/pooled | |
restbase1014.eqiad.wmnet: enabled/up/pooled | |
restbase1015.eqiad.wmnet: enabled/up/pooled | |
restbase1016.eqiad.wmnet: enabled/up/pooled | |
restbase1017.eqiad.wmnet: enabled/up/pooled | |
restbase1018.eqiad.wmnet: enabled/up/pooled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const crypto = require('crypto'); | |
const align = require('string-align'); | |
const cassandra = require('cassandra-driver'); | |
const colors = require('colors/safe'); | |
const fs = require('fs'); | |
const yaml = require('js-yaml'); | |
const P = require('bluebird'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:jessie | |
RUN apt-get update && apt-get install -y nodejs nodejs-legacy npm git wget && rm -rf /var/lib/apt/lists/* | |
ENV NVM_DIR /usr/local/nvm | |
RUN wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash && . $NVM_DIR/nvm.sh && nvm install 4.4.6 | |
RUN groupadd -g 1000 -r rungroup && useradd -m -r -g rungroup -u 1000 runuser | |
USER runuser | |
ENV HOME=/home/runuser LINK=g++ | |
ENV IN_DOCKER=1 | |
CMD . $NVM_DIR/nvm.sh && nvm use 4.4.6 && npm install --production && npm install heapdump && npm dedupe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
declare PUPPET_PATH='<path_to_ops_puppet_repo_locally>'; | |
declare JENKINS_TOKEN='<your_token_from_integration.wikimedia.org>'; | |
declare JENKINS_USERNAME='<your-username>'; | |
declare change_id="${1}"; | |
declare hosts="${2}"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
event: | |
type: object | |
properties: | |
structured_field1: | |
type: type1 | |
structured_field2: | |
type: type2 | |
structured_field3: | |
type: type3 | |
stringified_event: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# rule name | |
refresh-html: | |
# the topic to watch for | |
topic: mw-page-edit | |
# the modules to call when a message arrives there | |
exec: | |
# call the request module and pass in the params it expects | |
- request: | |
uri: http://restbase.svc.eqiad.wmnet:7231/{$.message.event.domain}/v1/page/html/{$.message.title}/{$.message.revision} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://localhost:7231 | |
POST /en.wikipedia.org/v1/media/math/svg | |
{ | |
"q": "c^2=a^2+b^2", | |
"type": "tex" | |
} | |
http://localhost:7231 | |
GET /wikimedia.org/v1/media/math/png/049ce72abeb43eeca53d3e55a1d226bffc0cb0f1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RESTBase config | |
info: | |
name: restbase | |
templates: | |
wmf-content-1.0.0: &wp/content/1.0.0 | |
swagger: '2.0' |
NewerOlder