[MediaWiki-commits] [Gerrit] operations/puppet[production]: Add config file for the Pivot UI

2016-10-12 Thread Elukey (Code Review)
Elukey has submitted this change and it was merged.

Change subject: Add config file for the Pivot UI
..


Add config file for the Pivot UI

Bug: T138262
Change-Id: If98e77173b9c15fcb40ac433cf338020da84a7a1
---
M modules/pivot/manifests/init.pp
A modules/pivot/templates/config.yaml.erb
M modules/pivot/templates/initscripts/pivot.systemd.erb
3 files changed, 182 insertions(+), 18 deletions(-)

Approvals:
  Elukey: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/pivot/manifests/init.pp b/modules/pivot/manifests/init.pp
index d175968..011e35e 100644
--- a/modules/pivot/manifests/init.pp
+++ b/modules/pivot/manifests/init.pp
@@ -17,24 +17,48 @@
 #
 # === Parameters
 #
-# $port  The port used by Pivot to accept HTTP connections.
-#Default: 9090
-# $druid_broker  The fully qualified domain name (like 
druid1001.eqiad.wmnet)
-#of the Druid Broker that the Pivot UI will contact.
-#Default: undef
-# $deployment_user   Scap deployment user.
-#Default: 'analytics_deploy'
-# $scap_repo Scap repository.
-#Default: 'analytics/pivot/deploy'
-# $contact_group Contact group for alerts.
-#Default: 'admins'
-
+# [*port*]
+#   The port used by Pivot to accept HTTP connections.
+#   Default: 9090
+#
+# [*druid_broker*]
+#   The fully qualified domain name (like druid1001.eqiad.wmnet)
+#   of the Druid Broker that the Pivot UI will contact.
+#   Default: undef
+#
+# [*query_timeout*]
+#   The timeout to set on the Druid queries in ms.
+#   Default: 4
+#
+# [*source_refresh_ms*]
+#   How often should Druid sources be reloaded in ms.
+#   Default: 15000
+#
+# [*schema_refresh_ms*]
+#   How often should Druid source schema be reloaded in ms.
+#   Default: 12
+#
+# [*deployment_user*]
+#   Scap deployment user.
+#   Default: 'analytics_deploy'
+#
+# [*scap_repo*]
+#   Scap repository.
+#   Default: 'analytics/pivot/deploy'
+#
+# [*contact_group*]
+#   Contact group for alerts.
+#   Default: 'admins'
+#
 class pivot(
-$port= 9090,
-$druid_broker= undef,
-$deployment_user = 'analytics_deploy',
-$scap_repo   = 'analytics/pivot/deploy',
-$contact_group   = 'admins',
+$port  = 9090,
+$druid_broker  = undef,
+$query_timeout = 4,
+$source_refresh_ms = 15000,
+$schema_refresh_ms = 12,
+$deployment_user   = 'analytics_deploy',
+$scap_repo = 'analytics/pivot/deploy',
+$contact_group = 'admins',
 ) {
 
 requires_os('debian >= jessie')
@@ -68,6 +92,14 @@
 source => 'puppet:///modules/pivot/pivot.profile.firejail',
 }
 
+file { '/etc/pivot/config.yaml':
+ensure => present,
+owner  => 'root',
+group  => 'root',
+mode   => '0444',
+source => 'puppet:///modules/pivot/templates/config.yaml.erb',
+}
+
 systemd::syslog { 'pivot':
 readable_by => 'all',
 base_dir=> '/var/log',
@@ -80,6 +112,7 @@
 require => [
 Scap::Target['analytics/pivot/deploy'],
 File['/etc/firejail/pivot.profile'],
+File['/etc/pivot/config.yaml'],
 User['pivot'],
 Systemd::Syslog['pivot'],
 ],
diff --git a/modules/pivot/templates/config.yaml.erb 
b/modules/pivot/templates/config.yaml.erb
new file mode 100644
index 000..99d52b0
--- /dev/null
+++ b/modules/pivot/templates/config.yaml.erb
@@ -0,0 +1,131 @@
+# generated by Pivot version 0.9.39
+# for a more detailed walk-through go to: 
https://github.com/implydata/pivot/blob/v0.9.39/docs/configuration.md
+
+# The port on which the Pivot server will listen on
+port: <%= @port %>
+
+clusters:
+  - name: druid
+
+# The database type of the cluster
+type: druid
+
+# The host (hostname:port) of the cluster. In the Druid case this must be 
the broker.
+host: <%= @druid_broker %>
+
+# The timeout to set on the queries in ms.
+timeout: <%= @query_timeout %>
+
+# Should the sources of this cluster be automatically scanned and new 
sources added as data cubes.
+sourceListScan: auto
+
+# Should the list of sources be reloaded every time that Pivot is loaded.
+#sourceListRefreshOnLoad: false
+
+# How often should sources be reloaded in ms.
+sourceListRefreshInterval: <%= @source_refresh_ms %>
+
+# Should sources be scanned for additional dimensions every time that 
Pivot is loaded.
+#sourceReintrospectOnLoad: false
+
+# How often should source schema be reloaded in ms.
+sourceReintrospectInterval: <%= @schema_refresh_ms %>
+
+# Database specific (druid) ===
+
+# The introspection strategy for the Druid external.
+#introspectionStrategy: segment-metadata-fallback
+
+dataCubes:
+  - name: pageviews-daily
+title: Pageviews Daily
+

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Add config file for the Pivot UI

2016-10-12 Thread Elukey (Code Review)
Elukey has uploaded a new change for review.

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

Change subject: Add config file for the Pivot UI
..

Add config file for the Pivot UI

Bug: T138262
Change-Id: If98e77173b9c15fcb40ac433cf338020da84a7a1
---
M modules/pivot/manifests/init.pp
A modules/pivot/templates/config.yaml.erb
M modules/pivot/templates/initscripts/pivot.systemd.erb
3 files changed, 182 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/80/315480/1

diff --git a/modules/pivot/manifests/init.pp b/modules/pivot/manifests/init.pp
index d175968..011e35e 100644
--- a/modules/pivot/manifests/init.pp
+++ b/modules/pivot/manifests/init.pp
@@ -17,24 +17,48 @@
 #
 # === Parameters
 #
-# $port  The port used by Pivot to accept HTTP connections.
-#Default: 9090
-# $druid_broker  The fully qualified domain name (like 
druid1001.eqiad.wmnet)
-#of the Druid Broker that the Pivot UI will contact.
-#Default: undef
-# $deployment_user   Scap deployment user.
-#Default: 'analytics_deploy'
-# $scap_repo Scap repository.
-#Default: 'analytics/pivot/deploy'
-# $contact_group Contact group for alerts.
-#Default: 'admins'
-
+# [*port*]
+#   The port used by Pivot to accept HTTP connections.
+#   Default: 9090
+#
+# [*druid_broker*]
+#   The fully qualified domain name (like druid1001.eqiad.wmnet)
+#   of the Druid Broker that the Pivot UI will contact.
+#   Default: undef
+#
+# [*query_timeout*]
+#   The timeout to set on the Druid queries in ms.
+#   Default: 4
+#
+# [*source_refresh_ms*]
+#   How often should Druid sources be reloaded in ms.
+#   Default: 15000
+#
+# [*schema_refresh_ms*]
+#   How often should Druid source schema be reloaded in ms.
+#   Default: 12
+#
+# [*deployment_user*]
+#   Scap deployment user.
+#   Default: 'analytics_deploy'
+#
+# [*scap_repo*]
+#   Scap repository.
+#   Default: 'analytics/pivot/deploy'
+#
+# [*contact_group*]
+#   Contact group for alerts.
+#   Default: 'admins'
+#
 class pivot(
-$port= 9090,
-$druid_broker= undef,
-$deployment_user = 'analytics_deploy',
-$scap_repo   = 'analytics/pivot/deploy',
-$contact_group   = 'admins',
+$port  = 9090,
+$druid_broker  = undef,
+$query_timeout = 4,
+$source_refresh_ms = 15000,
+$schema_refresh_ms = 12,
+$deployment_user   = 'analytics_deploy',
+$scap_repo = 'analytics/pivot/deploy',
+$contact_group = 'admins',
 ) {
 
 requires_os('debian >= jessie')
@@ -68,6 +92,14 @@
 source => 'puppet:///modules/pivot/pivot.profile.firejail',
 }
 
+file { '/etc/pivot/config.yaml':
+ensure => present,
+owner  => 'root',
+group  => 'root',
+mode   => '0444',
+source => 'puppet:///modules/pivot/templates/config.yaml.erb',
+}
+
 systemd::syslog { 'pivot':
 readable_by => 'all',
 base_dir=> '/var/log',
@@ -80,6 +112,7 @@
 require => [
 Scap::Target['analytics/pivot/deploy'],
 File['/etc/firejail/pivot.profile'],
+File['/etc/pivot/config.yaml'],
 User['pivot'],
 Systemd::Syslog['pivot'],
 ],
diff --git a/modules/pivot/templates/config.yaml.erb 
b/modules/pivot/templates/config.yaml.erb
new file mode 100644
index 000..99d52b0
--- /dev/null
+++ b/modules/pivot/templates/config.yaml.erb
@@ -0,0 +1,131 @@
+# generated by Pivot version 0.9.39
+# for a more detailed walk-through go to: 
https://github.com/implydata/pivot/blob/v0.9.39/docs/configuration.md
+
+# The port on which the Pivot server will listen on
+port: <%= @port %>
+
+clusters:
+  - name: druid
+
+# The database type of the cluster
+type: druid
+
+# The host (hostname:port) of the cluster. In the Druid case this must be 
the broker.
+host: <%= @druid_broker %>
+
+# The timeout to set on the queries in ms.
+timeout: <%= @query_timeout %>
+
+# Should the sources of this cluster be automatically scanned and new 
sources added as data cubes.
+sourceListScan: auto
+
+# Should the list of sources be reloaded every time that Pivot is loaded.
+#sourceListRefreshOnLoad: false
+
+# How often should sources be reloaded in ms.
+sourceListRefreshInterval: <%= @source_refresh_ms %>
+
+# Should sources be scanned for additional dimensions every time that 
Pivot is loaded.
+#sourceReintrospectOnLoad: false
+
+# How often should source schema be reloaded in ms.
+sourceReintrospectInterval: <%= @schema_refresh_ms %>
+
+# Database specific (druid) ===
+
+# The introspection strategy for the Druid external.
+#introspectionStrategy: segment-metadata-fallback
+
+dataCubes:
+  - name: