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: 40000
+#
+# [*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: 120000
+#
+# [*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     = 40000,
+    $source_refresh_ms = 15000,
+    $schema_refresh_ms = 120000,
+    $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 0000000..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
+    clusterName: druid
+    source: pageviews-daily
+    # The refresh rule describes how often the data cube looks for new data. 
Default: 'query'/PT1M (every minute)
+    refreshRule:
+      rule: query
+
+    #defaultTimezone: Etc/UTC
+
+    #defaultDuration: P1D
+
+    #defaultSortMeasure: view_count
+
+    # The names of measures that are selected by default
+    #defaultSelectedMeasures: []
+
+    # The names of dimensions that are pinned by default (in order that they 
will appear in the pin bar)
+
+    #defaultPinnedDimensions: []
+
+    # How the dataset should be introspected
+    # possible options are:
+    # * none - Do not do any introspection, take what is written in the config 
as the rule of law.
+    # * no-autofill - Introspect the datasource but do not automatically 
generate dimensions or measures
+    # * autofill-dimensions-only - Introspect the datasource, automatically 
generate dimensions only
+    # * autofill-measures-only - Introspect the datasource, automatically 
generate measures only
+    # * autofill-all - (default) Introspect the datasource, automatically 
generate dimensions and measures
+    introspection: autofill-all
+
+
+  - name: edit-history-test
+    title: Edit History test
+    clusterName: druid
+    source: edit-history-test
+    # The refresh rule describes how often the data cube looks for new data.
+    # Default: 'query'/PT1M (every minute)
+    refreshRule:
+      rule: query
+
+    #defaultTimezone: Etc/UTC
+
+    #defaultDuration: P1D
+
+    #defaultSortMeasure: deleted_revisions
+
+    # The names of measures that are selected by default
+    #defaultSelectedMeasures: []
+
+    # The names of dimensions that are pinned by default (in order that they 
will appear in the pin bar)
+
+    #defaultPinnedDimensions: []
+
+    # How the dataset should be introspected
+    # possible options are:
+    # * none - Do not do any introspection, take what is written in the config 
as the rule of law.
+    # * no-autofill - Introspect the datasource but do not automatically 
generate dimensions or measures
+    # * autofill-dimensions-only - Introspect the datasource, automatically 
generate dimensions only
+    # * autofill-measures-only - Introspect the datasource, automatically 
generate measures only
+    # * autofill-all - (default) Introspect the datasource, automatically 
generate dimensions and measures
+    introspection: autofill-all
+
+
+  - name: pageviews-hourly
+    title: Pageviews Hourly
+    clusterName: druid
+    source: pageviews-hourly
+    # The refresh rule describes how often the data cube looks for new data.
+    # Default: 'query'/PT1M (every minute)
+      rule: query
+
+    #defaultTimezone: Etc/UTC
+
+    #defaultDuration: P1D
+
+    #defaultSortMeasure: view_count
+
+    # The names of measures that are selected by default
+    #defaultSelectedMeasures: []
+
+    # The names of dimensions that are pinned by default (in order that they 
will appear in the pin bar)
+
+    #defaultPinnedDimensions: []
+
+    # How the dataset should be introspected
+    # possible options are:
+    # * none - Do not do any introspection, take what is written in the config 
as the rule of law.
+    # * no-autofill - Introspect the datasource but do not automatically 
generate dimensions or measures
+    # * autofill-dimensions-only - Introspect the datasource, automatically 
generate dimensions only
+    # * autofill-measures-only - Introspect the datasource, automatically 
generate measures only
+    # * autofill-all - (default) Introspect the datasource, automatically 
generate dimensions and measures
+    introspection: autofill-all
\ No newline at end of file
diff --git a/modules/pivot/templates/initscripts/pivot.systemd.erb 
b/modules/pivot/templates/initscripts/pivot.systemd.erb
index 063c320..8999ac6 100644
--- a/modules/pivot/templates/initscripts/pivot.systemd.erb
+++ b/modules/pivot/templates/initscripts/pivot.systemd.erb
@@ -13,7 +13,7 @@
 # wait 60 seconds for a graceful restart before killing the master
 TimeoutStopSec=60
 WorkingDirectory=<%= @pivot_deployment_dir %>
-ExecStart=/usr/bin/firejail --profile=/etc/firejail/pivot.profile -- 
/usr/bin/nodejs <%= @pivot_deployment_dir %>/src/bin/pivot -p <%= @port %> -d 
<%= @druid_broker %>
+ExecStart=/usr/bin/firejail --profile=/etc/firejail/pivot.profile -- 
/usr/bin/nodejs <%= @pivot_deployment_dir %>/src/bin/pivot --config 
/etc/pivot/config.yaml
 SyslogIdentifier=pivot
 
 [Install]

-- 
To view, visit https://gerrit.wikimedia.org/r/315480
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If98e77173b9c15fcb40ac433cf338020da84a7a1
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Elukey <ltosc...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to