Alexandros Kosiaris has submitted this change and it was merged. Change subject: WIP: Phase 1 of moving to new parsoid repo / upstart ......................................................................
WIP: Phase 1 of moving to new parsoid repo / upstart * Add new deploy repo * Point prod upstart to it so that we can test it manually As discussed in https://gerrit.wikimedia.org/r/#/c/106471, the next steps will be 1) test the upstart / new repo setup on one of the boxes 2) once that works, switch to upstart by default and remove the old repo and init scripts Change-Id: Iad299f0e43f309409a98d3f32d1ac9a3851228c3 --- M files/misc/parsoid.upstart M manifests/role/deployment.pp M manifests/role/parsoid.pp 3 files changed, 56 insertions(+), 3 deletions(-) Approvals: Alexandros Kosiaris: Looks good to me, approved jenkins-bot: Verified diff --git a/files/misc/parsoid.upstart b/files/misc/parsoid.upstart index 060efd8..82c4900 100644 --- a/files/misc/parsoid.upstart +++ b/files/misc/parsoid.upstart @@ -21,8 +21,8 @@ # Basic build in default, would be overridden by whatever # is defined in the DEFAULTFILE defined above env VCAP_APP_PORT="8000" -env NODE_PATH="/var/lib/parsoid/Parsoid/js/node_modules" -env PARSOID_BASE_PATH="/var/lib/parsoid/Parsoid" +env NODE_PATH="/var/lib/parsoid/deploy/node_modules" +env PARSOID_BASE_PATH="/var/lib/parsoid/deploy/src" respawn @@ -35,5 +35,5 @@ fi chdir "$PARSOID_BASE_PATH" - exec /usr/bin/nodejs api/server.js < /dev/null >> "$PARSOID_LOG_FILE" 2>&1 + exec /usr/bin/nodejs api/server.js -c ../../conf/wmf/localsettings.js < /dev/null >> "$PARSOID_LOG_FILE" 2>&1 end script diff --git a/manifests/role/deployment.pp b/manifests/role/deployment.pp index 30e0967..38ef7ec 100644 --- a/manifests/role/deployment.pp +++ b/manifests/role/deployment.pp @@ -91,6 +91,12 @@ 'parsoid/config' => { 'grain' => 'parsoid', }, + 'parsoid/deploy' => { + 'grain' => 'parsoid', + 'upstream' => 'https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid/deploy', + 'checkout_submodules' => true, + 'service_name' => 'parsoid', + }, 'eventlogging/EventLogging' => { 'grain' => 'eventlogging', 'upstream' => 'https://gerrit.wikimedia.org/r/mediawiki/extensions/EventLogging', diff --git a/manifests/role/parsoid.pp b/manifests/role/parsoid.pp index 9d5d277..e33a56f 100644 --- a/manifests/role/parsoid.pp +++ b/manifests/role/parsoid.pp @@ -48,6 +48,11 @@ target => '/srv/deployment/parsoid/Parsoid', } + file { '/var/lib/parsoid/deploy': + ensure => link, + target => '/srv/deployment/parsoid/deploy', + } + # production uses an init script whereas labs experiments with upstart file { '/etc/init.d/parsoid': ensure => present, @@ -56,6 +61,48 @@ mode => '0555', source => 'puppet:///files/misc/parsoid.init', } + + # upstart config prep, will replace sysv init above + # Use name that does not match the 'parsoid' service name for now to avoid + # it taking precedence over the init script + # TODO: remove init script and rename back to parsoid.conf + file { '/etc/init/parsoid-test.conf': + ensure => present, + owner => root, + group => root, + mode => '0444', + source => 'puppet:///files/misc/parsoid.upstart', + } + file { '/var/log/parsoid': + ensure => directory, + owner => parsoid, + group => parsoid, + mode => '0775', + } + + $parsoid_log_file = '/var/log/parsoid/parsoid.log' + $parsoid_node_path = '/var/lib/parsoid/deploy/node_modules' + $parsoid_base_path = '/var/lib/parsoid/deploy/src' + + #TODO: Duplication of code from beta class, deduplicate somehow + file { '/etc/default/parsoid': + ensure => present, + owner => root, + group => root, + mode => '0444', + content => template('misc/parsoid.default.erb'), + require => File['/var/log/parsoid'], + } + + file { '/etc/logrotate.d/parsoid': + ensure => present, + owner => root, + group => root, + mode => '0444', + content => template('misc/parsoid.logrotate.erb'), + } + + # Still using the old init script for now service { 'parsoid': ensure => running, hasstatus => true, -- To view, visit https://gerrit.wikimedia.org/r/107492 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iad299f0e43f309409a98d3f32d1ac9a3851228c3 Gerrit-PatchSet: 5 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: GWicke <[email protected]> Gerrit-Reviewer: Alexandros Kosiaris <[email protected]> Gerrit-Reviewer: Catrope <[email protected]> Gerrit-Reviewer: Cscott <[email protected]> Gerrit-Reviewer: Faidon Liambotis <[email protected]> Gerrit-Reviewer: GWicke <[email protected]> Gerrit-Reviewer: Ori.livneh <[email protected]> Gerrit-Reviewer: Subramanya Sastry <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
