Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/222914
Change subject: ores: Move ores initial install setup into a base class ...................................................................... ores: Move ores initial install setup into a base class Change-Id: If3d159f187a98240a01148d437e8ca3f6c2fd25e --- A modules/ores/manifests/base.pp M modules/ores/manifests/web.pp 2 files changed, 60 insertions(+), 53 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/14/222914/1 diff --git a/modules/ores/manifests/base.pp b/modules/ores/manifests/base.pp new file mode 100644 index 0000000..c147079 --- /dev/null +++ b/modules/ores/manifests/base.pp @@ -0,0 +1,58 @@ +class ores::base( + $branch = 'deploy', +) { + # Let's use a virtualenv for maximum flexibility - we can convert + # this to deb packages in the future if needed. We also install build tools + # because they are needed by pip to install scikit. + # FIXME: Use debian packages for all the packages needing compilation + require_package('python-virtualenv', 'python3-dev', 'build-essential', + 'gfortran', 'libopenblas-dev', 'liblapack-dev') + + # Install scipy via debian package so we don't need to build it via pip + # takes forever and is quite buggy + require_package('python3-scipy') + + # ORES is a python3 application \o/ + require_package('uwsgi-plugin-python3') + + # It requires the enchant debian package + require_package('enchant') + + # Spellcheck packages for supported languages + require_package('myspell-pt', 'myspell-fa', 'myspell-en-au', + 'myspell-en-gb', 'myspell-en-us', + 'myspell-en-za', 'myspell-fr') + + $config_path = '/srv/ores/config' + $venv_path = '/srv/ores/venv' + $data_path = '/srv/ores/data' + + file { '/srv': + ensure => directory, + owner => 'root', + group => 'root', + mode => '0775', + } + + file { [ + '/srv/ores', + $data_path, + "${data_path}/nltk", + ]: + ensure => directory, + owner => 'www-data', + group => 'www-data', + mode => '0775', + require => File['/srv'], + } + + git::clone { 'ores-wm-config': + origin => 'https://github.com/wiki-ai/ores-wikimedia-config.git', + ensure => present, + directory => $config_path, + branch => $branch, + owner => 'www-data', + group => 'www-data', + require => File['/srv/ores'], + } +} diff --git a/modules/ores/manifests/web.pp b/modules/ores/manifests/web.pp index 33825f1..6ce6afa 100644 --- a/modules/ores/manifests/web.pp +++ b/modules/ores/manifests/web.pp @@ -3,59 +3,8 @@ class ores::web( $branch = 'deploy', ) { - # Let's use a virtualenv for maximum flexibility - we can convert - # this to deb packages in the future if needed. We also install build tools - # because they are needed by pip to install scikit. - # FIXME: Use debian packages for all the packages needing compilation - require_package('python-virtualenv', 'python3-dev', 'build-essential', - 'gfortran', 'libopenblas-dev', 'liblapack-dev') - - # Install scipy via debian package so we don't need to build it via pip - # takes forever and is quite buggy - require_package('python3-scipy') - - # ORES is a python3 application \o/ - require_package('uwsgi-plugin-python3') - - # It requires the enchant debian package - require_package('enchant') - - # Spellcheck packages for supported languages - require_package('myspell-pt', 'myspell-fa', 'myspell-en-au', - 'myspell-en-gb', 'myspell-en-us', - 'myspell-en-za', 'myspell-fr') - - $config_path = '/srv/ores/config' - $venv_path = '/srv/ores/venv' - $data_path = '/srv/ores/data' - - file { '/srv': - ensure => directory, - owner => 'root', - group => 'root', - mode => '0775', - } - - file { [ - '/srv/ores', - $data_path, - "${data_path}/nltk", - ]: - ensure => directory, - owner => 'www-data', - group => 'www-data', - mode => '0775', - require => File['/srv'], - } - - git::clone { 'ores-wm-config': - origin => 'https://github.com/wiki-ai/ores-wikimedia-config.git', - ensure => present, - directory => $config_path, - branch => $branch, - owner => 'www-data', - group => 'www-data', - require => File['/srv/ores'], + class { 'ores::base': + branch => $branch, } uwsgi::app { 'ores-web': -- To view, visit https://gerrit.wikimedia.org/r/222914 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3d159f187a98240a01148d437e8ca3f6c2fd25e Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Yuvipanda <yuvipa...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits