Hashar has uploaded a new change for review. https://gerrit.wikimedia.org/r/308313
Change subject: quarry: migrate classes to autoloader layout ...................................................................... quarry: migrate classes to autoloader layout Split classes from quarry/init.pp to standalone files that match the Puppet autoloader layout. Bug: T93645 Change-Id: I895e376352d808dab8b7a8392b29d1be63a52035 --- A modules/quarry/manifests/base.pp A modules/quarry/manifests/database.pp D modules/quarry/manifests/init.pp A modules/quarry/manifests/querykiller.pp A modules/quarry/manifests/redis.pp 5 files changed, 89 insertions(+), 90 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/13/308313/1 diff --git a/modules/quarry/manifests/base.pp b/modules/quarry/manifests/base.pp new file mode 100644 index 0000000..850d7fb --- /dev/null +++ b/modules/quarry/manifests/base.pp @@ -0,0 +1,40 @@ +# = Class: quarry::base +# +# This class sets up the basic underlying structure for both +# Quarry web frontends and Quarry query runners. +class quarry::base( + $clone_path = '/srv/quarry', + $result_path_parent = '/data/project/quarry', + $result_path = '/data/project/quarry/results', +) { + include ::redis::client::python + + package { [ + 'python-celery', + 'python-sqlalchemy', + 'python-unicodecsv', + 'python-translitcodec', + ]: + ensure => latest + } + + user { 'quarry': + ensure => present, + system => true + } + + file { [$clone_path, $result_path_parent, $result_path]: + ensure => directory, + owner => 'quarry', + require => User['quarry'] + } + + git::clone { 'analytics/quarry/web': + ensure => present, + directory => $clone_path, + branch => 'master', + require => [File[$clone_path], User['quarry']], + owner => 'quarry', + group => 'www-data' + } +} diff --git a/modules/quarry/manifests/database.pp b/modules/quarry/manifests/database.pp new file mode 100644 index 0000000..e43180c --- /dev/null +++ b/modules/quarry/manifests/database.pp @@ -0,0 +1,15 @@ +# = Class: quarry::database +# +# Sets up a mysql database for use by Quarry web frontends +# and Quarry query runners +class quarry::database { + $data_path = '/srv/mysql/data' + + class { 'mysql::server': + package_name => 'mariadb-server', + config_hash => { + 'datadir' => $data_path, + 'bind_address' => '0.0.0.0', + } + } +} diff --git a/modules/quarry/manifests/init.pp b/modules/quarry/manifests/init.pp deleted file mode 100644 index 037c410..0000000 --- a/modules/quarry/manifests/init.pp +++ /dev/null @@ -1,90 +0,0 @@ -# = Class: quarry::base -# -# This class sets up the basic underlying structure for both -# Quarry web frontends and Quarry query runners. -class quarry::base( - $clone_path = '/srv/quarry', - $result_path_parent = '/data/project/quarry', - $result_path = '/data/project/quarry/results', -) { - include ::redis::client::python - - package { [ - 'python-celery', - 'python-sqlalchemy', - 'python-unicodecsv', - 'python-translitcodec', - ]: - ensure => latest - } - - user { 'quarry': - ensure => present, - system => true - } - - file { [$clone_path, $result_path_parent, $result_path]: - ensure => directory, - owner => 'quarry', - require => User['quarry'] - } - - git::clone { 'analytics/quarry/web': - ensure => present, - directory => $clone_path, - branch => 'master', - require => [File[$clone_path], User['quarry']], - owner => 'quarry', - group => 'www-data' - } -} - -# = Class: quarry::database -# -# Sets up a mysql database for use by Quarry web frontends -# and Quarry query runners -class quarry::database { - $data_path = '/srv/mysql/data' - - class { 'mysql::server': - package_name => 'mariadb-server', - config_hash => { - 'datadir' => $data_path, - 'bind_address' => '0.0.0.0', - } - } -} - -# = Class: quarry::redis -# -# Sets up a redis instance for use as caching and session storage -# by the Quarry frontends and also as working queue & results -# backend by the query runners. -class quarry::redis { - redis::instance { '6379': - settings => { - bind => '0.0.0.0', - dir => '/srv/redis', - maxmemory => '2GB', - } - } -} - -# = Class: quarry:querykiller -# -# Sets up a cron based query-killer -class quarry::querykiller { - require quarry::base - - file { '/var/log/quarry': - ensure => directory, - owner => 'quarry', - group => 'quarry' - } - - cron { 'query-killer': - command => "${quarry::base::clone_path}/quarry/web/killer.py", - minute => '*', - user => 'quarry', - } -} diff --git a/modules/quarry/manifests/querykiller.pp b/modules/quarry/manifests/querykiller.pp new file mode 100644 index 0000000..2e54389 --- /dev/null +++ b/modules/quarry/manifests/querykiller.pp @@ -0,0 +1,19 @@ + +# = Class: quarry:querykiller +# +# Sets up a cron based query-killer +class quarry::querykiller { + require quarry::base + + file { '/var/log/quarry': + ensure => directory, + owner => 'quarry', + group => 'quarry' + } + + cron { 'query-killer': + command => "${quarry::base::clone_path}/quarry/web/killer.py", + minute => '*', + user => 'quarry', + } +} diff --git a/modules/quarry/manifests/redis.pp b/modules/quarry/manifests/redis.pp new file mode 100644 index 0000000..a219275 --- /dev/null +++ b/modules/quarry/manifests/redis.pp @@ -0,0 +1,15 @@ +# = Class: quarry::redis +# +# Sets up a redis instance for use as caching and session storage +# by the Quarry frontends and also as working queue & results +# backend by the query runners. +class quarry::redis { + redis::instance { '6379': + settings => { + bind => '0.0.0.0', + dir => '/srv/redis', + maxmemory => '2GB', + } + } +} + -- To view, visit https://gerrit.wikimedia.org/r/308313 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I895e376352d808dab8b7a8392b29d1be63a52035 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Hashar <has...@free.fr> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits