Skip to content

Instantly share code, notes, and snippets.

@Pchelolo
Created April 1, 2019 19:23
Show Gist options
  • Save Pchelolo/5029cb8bc090edc0c4cb8d47f2012364 to your computer and use it in GitHub Desktop.
Save Pchelolo/5029cb8bc090edc0c4cb8d47f2012364 to your computer and use it in GitHub Desktop.
ppchelko@deployment-restbase02:~$ cat /etc/restbase/config.yaml
# Number of worker processes to spawn.
# Set to 0 to run everything in a single process without clustering.
# Use 'ncpu' to run as many workers as there are CPU units
num_workers: ncpu
# Number of workers to start in parallel after the first worker.
# The first worker is always started independently. After it has completed
# its start-up, this number controls the number of workers to start in
# parallel until `num_workers` have been started. Note that setting this
# number to a too high a value might lead to high resource consumption
# (especially of CPU) during the start-up process.
startup_concurrency: 8
# Log error messages and gracefully restart a worker if v8 reports that it
# uses more heap (note: not RSS) than this many mb.
worker_heap_limit_mb: 700
# The maximum interval in ms that can pass between two beat messages
# sent by each worker to the master before it is killed.
worker_heartbeat_timeout: 7500
# Tell service-runner where the root dir of the service is
app_base_path: /srv/deployment/restbase/deploy/restbase
# Logger info
logging:
level: warn
name: restbase
streams:
- host: deployment-logstash2.deployment-prep.eqiad.wmflabs
port: 12201
type: gelf
- path: /srv/log/restbase/main.log
type: file
sampled_levels:
# Target is about 1 request logged per minute @1000 req/s
debug/request: 0.00005
# Not sure what the rate of these is, so start conservatively.
debug/request/slow: 0.001
debug/noindex: 0.01
debug/api_error: 0.01
# Statsd metrics reporter
metrics:
name: restbase
host: labmon1001.eqiad.wmnet
port: 8125
type: statsd
batch: true
ratelimiter:
type: kademlia
listen:
address: 172.16.5.82
port: 3050
seeds: ['deployment-restbase01.deployment-prep.eqiad.wmflabs']
# load & parametrise project templates. These are referenced / shared
# between domains in the root_spec further down.
default_project: &default_project
x-modules:
- path: projects/wmf_default.yaml
options: &default_options
table:
backend: cassandra
hosts: ['deployment-restbase01.deployment-prep.eqiad.wmflabs','deployment-restbase02.deployment-prep.eqiad.wmflabs']
keyspace: system
localDc: datacenter1
datacenters: ['datacenter1']
username: cassandra
password: cassandra
defaultConsistency: localOne
skip_schema_update: true
storage_groups:
# Catch-all group
- name: others
domains: /./
parsoid:
host: http://deployment-parsoid09.deployment-prep.eqiad.wmflabs:8000
grace_ttl: 86400
delete_probability: 1
action:
apiUriTemplate: http://deployment-mediawiki-07.deployment-prep.eqiad.wmflabs/w/api.php
baseUriTemplate: "{{'https://{domain}/api/rest_v1'}}"
graphoid:
host: http://deployment-sca01.deployment-prep.eqiad.wmflabs:19000
mathoid:
host: http://deployment-mathoid.deployment-prep.eqiad.wmflabs:10042
# 10 days Varnish caching, one day client-side
cache-control: s-maxage=864000, max-age=86400
mobileapps:
host: http://deployment-mcs01.deployment-prep.eqiad.wmflabs:8888
storage: new
citoid:
host: http://deployment-sca02.deployment-prep.eqiad.wmflabs:1970
recommendation:
host: http://deployment-sca01.deployment-prep.eqiad.wmflabs:9632
events:
uri: http://deployment-kafka-main-1.deployment-prep.eqiad.wmflabs:8085/v1/events
topic: resource_change
transcludes_topic: change-prop.transcludes.resource-change
summary:
host: http://deployment-mcs01.deployment-prep.eqiad.wmflabs:8888
implementation: mcs
protocol: https
related:
cache_control: s-maxage=86400, max-age=3600
# Cache headers for purged end points.
purged_cache_control: s-maxage=1209600, max-age=0, must-revalidate
# Cache control for purged endpoints allowing short-term client caching
purged_cache_control_client_cache: s-maxage=1209600, max-age=300
skip_updates: false
pdf:
cache_control: s-maxage=600, max-age=600
uri: http://deployment-pdfrender02.deployment-prep.eqiad.wmflabs:5252
new_uri: http://deployment-chromium01.deployment-prep.eqiad.wmflabs:24766
new_probability: 1
secret: secret
transform:
cx_host: http://deployment-sca02.deployment-prep.eqiad.wmflabs:8080
# A separate project for wikipedias because they have more features
wikipedia.org: &wikipedia.org
x-modules:
- path: projects/wmf_wikipedia.yaml
options: *default_options
# A separate project for en.wikipedia because it is even more feature-rich
en.wikipedia.org: &en.wikipedia.org
x-modules:
- path: projects/wmf_enwiki.yaml
options: *default_options
# A different project template, sharing configuration options.
wikimedia.org: &wikimedia.org
x-modules:
- path: projects/wikimedia.org.yaml
options:
<<: *default_options
pageviews:
host: https://wikimedia.org/api/rest_v1/metrics
# A different project for wikidata since we have limited RESTBase support there.
wikidata.org: &wikidata.org
x-modules:
- path: projects/wmf_wikidata.yaml
options: *default_options
# wiktionaries config
wiktionary: &wiktionary_project
x-modules:
- path: projects/wmf_wiktionary.yaml
options: *default_options
# wikivoyage config
wikivoyage: &wikivoyage_project
x-modules:
- path: projects/wmf_wikivoyage.yaml
options: *default_options
# Swagger spec root.
root_spec: &root_spec
title: "The RESTBase root"
# Some more general RESTBase info
x-request-filters:
- path: lib/security_response_header_filter.js
x-sub-request-filters:
- type: default
name: http
options:
allow:
- pattern: http://deployment-mediawiki-07.deployment-prep.eqiad.wmflabs/w/api.php
forward_headers: true
- pattern: http://deployment-parsoid09.deployment-prep.eqiad.wmflabs:8000
forward_headers: true
- pattern: https://wikimedia.org/api/rest_v1/metrics
forward_headers:
x-client-ip: true
user-agent: true
- pattern: /^https?:\/\//
paths:
# BetaCluster
/{domain:deployment.wikimedia.beta.wmflabs.org}: *default_project
/{domain:meta.wikimedia.beta.wmflabs.org}: *default_project
/{domain:ar.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:sq.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:zero.wikimedia.beta.wmflabs.org}: *default_project
/{domain:login.wikimedia.beta.wmflabs.org}: *default_project
/{domain:eo.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:he.wiktionary.beta.wmflabs.org}: *wiktionary_project
/{domain:de.wiktionary.beta.wmflabs.org}: *wiktionary_project
/{domain:uk.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:ru.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:simple.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:en.wikiversity.beta.wmflabs.org}: *default_project
/{domain:es.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:zh.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:aa.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:ca.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:en.wikivoyage.beta.wmflabs.org}: *wikivoyage_project
/{domain:en.wikipedia.beta.wmflabs.org}: *en.wikipedia.org
/{domain:nl.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:hi.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:test.wikimedia.beta.wmflabs.org}: *default_project
/{domain:en.wikisource.beta.wmflabs.org}: *default_project
/{domain:fa.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:en.wiktionary.beta.wmflabs.org}: *wiktionary_project
/{domain:de.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:ja.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:sr.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:en-rtl.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:en.wikibooks.beta.wmflabs.org}: *default_project
/{domain:sv.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:en.wikiquote.beta.wmflabs.org}: *default_project
/{domain:commons.wikimedia.beta.wmflabs.org}: *default_project
/{domain:he.wikipedia.beta.wmflabs.org}: *wikipedia.org
/{domain:wikidata.beta.wmflabs.org}: *wikidata.org
/{domain:en.wikinews.beta.wmflabs.org}: *default_project
/{domain:ko.wikipedia.beta.wmflabs.org}: *wikipedia.org
# global domain
/{domain:wikimedia.org}: *wikimedia.org
# A robots.txt to make sure that the content isn't indexed.
/robots.txt:
get:
x-request-handler:
- static:
return:
status: 200
headers:
content-type: text/plain
body: |
User-agent: *
Allow: /*/v1/?doc
Disallow: /
services:
- name: restbase
module: hyperswitch
conf:
port: 7231
spec: *root_spec
salt: secretkey
default_page_size: 250
user_agent: RESTBase/deployment-prep
ui_name: REST API
ui_url: https://www.mediawiki.org/wiki/RESTBase
ui_title: REST API Documentatio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment