Ottomata has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/369902 )
Change subject: Add ::statistics::wmde::wdcm ...................................................................... Add ::statistics::wmde::wdcm - fetch wdcm code using the analytics-wmde user - make sure packages required by scripts exist Bug: T171258 Change-Id: I9c8599bb94d94ccff34483a7dff1b0da2b78e55e --- M modules/statistics/manifests/wmde.pp A modules/statistics/manifests/wmde/wdcm.pp 2 files changed, 52 insertions(+), 0 deletions(-) Approvals: Ottomata: Verified; Looks good to me, approved Addshore: Looks good to me, but someone else must approve diff --git a/modules/statistics/manifests/wmde.pp b/modules/statistics/manifests/wmde.pp index 624b28c..be05d1c 100644 --- a/modules/statistics/manifests/wmde.pp +++ b/modules/statistics/manifests/wmde.pp @@ -40,4 +40,12 @@ wmde_secrets => $wmde_secrets, require => User[$user], } + + # Wikidata concepts processing + class { '::statistics::wmde::wdcm': + dir => "${homedir}/wdcm", + user => $user, + require => User[$user], + } + } diff --git a/modules/statistics/manifests/wmde/wdcm.pp b/modules/statistics/manifests/wmde/wdcm.pp new file mode 100644 index 0000000..09c1ade --- /dev/null +++ b/modules/statistics/manifests/wmde/wdcm.pp @@ -0,0 +1,44 @@ +# Licence AGPL version 3 or later +# +# @author Addshore +# +# Related task: https://phabricator.wikimedia.org/T171258 +# +# == Parameters +# dir - string. Directory to use. +# user - string. User to use. +class statistics::wmde::wdcm( + $dir, + $user = 'analytics-wmde' +) { + + $src_dir = "${dir}/src" + + file { $dir: + ensure => 'directory', + owner => $user, + group => $user, + mode => '0644', + require => User[$user], + } + + git::clone { 'analytics/wmde/WDCM': + # TODO do we want a similar latest & production branch here? Or just manually pulling? scap? + # Currently when we update the code in the repo we will have to pull the updates ourselves. + ensure => 'present', + branch => 'master', + directory => $src_dir, + owner => $user, + group => $user, + require => File[$dir], + } + + # TODO the scripts in the WDCM repo require R, but apparently we can't specify that here without things breaking. + + # TODO we also can't yes install any R packages that we require, but we work around that by using a maanual script. + # The WDCM repo has a script _installProduction_analytics-wmde.R which can be used to install the libraries needed. + # https://phabricator.wikimedia.org/T170995 + + # TODO crons for the R scripts will live here once each script is ready for production. + +} -- To view, visit https://gerrit.wikimedia.org/r/369902 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9c8599bb94d94ccff34483a7dff1b0da2b78e55e Gerrit-PatchSet: 15 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: Bearloga <mpo...@wikimedia.org> Gerrit-Reviewer: Elukey <ltosc...@wikimedia.org> Gerrit-Reviewer: GoranSMilovanovic <goran.milovanovic_...@wikimedia.de> Gerrit-Reviewer: Ottomata <ao...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits