Andrew Bogott has submitted this change and it was merged.
Change subject: Stop making so many virtual resources
......................................................................
Stop making so many virtual resources
The old puppet code used a file resource with "recurse=>true" to set the
permissions on the MediaWiki-Vagrant clone and
"require=>Git::Clone['vagrant']". This turns out to be
a really nasty thing to do in combination with Puppet 3.4.3 on Trusty.
When puppet processes the recursive File resource, it actually scans the
directory and creates a File resource for each file found. These
resources in turn inherit the require of the parent resource. For
a MediaWiki-Vagrant install with a reasonable number of extensions
installed this can balloon to 30k or more File resources. Since the
require is for a defined type Puppet will look to see if this type has
been implemented as a ruby extension before it checks to see if there is
a Puppet manifest that defines it. This requires Puppet to walk all of
the system ruby gem paths looking for "puppet/type/git::clone.rb". When
watched with strace on on labs instance, this resulted in 29 stat calls.
Now for the really really horrible part, this lookup is not cached and
will be repeated for each File resource. A full Puppet run on the same
testing host generated 2,293,353 failed stat calls for
"<something>/puppet/type/git::clone.rb".
Our git::clone type was given support for setting shared permissions on
new clones in I4c282b0ad14b3493026dead4e3b15f2749d5d22e, so we will use
that instead of cloning as root and then ensuring a perpetual recursive
chmod via the File resource.
Bug: 70971
Change-Id: I3eea91a5933af31457a3ac24624e0fda82d61849
---
M modules/labs_vagrant/manifests/init.pp
1 file changed, 4 insertions(+), 8 deletions(-)
Approvals:
Andrew Bogott: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/labs_vagrant/manifests/init.pp
b/modules/labs_vagrant/manifests/init.pp
index 5f72d05..42954a9 100644
--- a/modules/labs_vagrant/manifests/init.pp
+++ b/modules/labs_vagrant/manifests/init.pp
@@ -45,19 +45,15 @@
git::clone { 'vagrant':
directory => $install_directory,
origin => 'https://gerrit.wikimedia.org/r/mediawiki/vagrant',
- }
-
- file { $install_directory:
- recurse => true,
- owner => 'vagrant',
- group => 'www-data',
- require => Git::Clone['vagrant'],
+ owner => 'vagrant',
+ group => 'www-data',
+ shared => true,
}
file { '/vagrant':
ensure => 'link',
target => $install_directory,
- require => File[$install_directory],
+ require => Git::Clone['vagrant'],
}
file { '/bin/labs-vagrant':
--
To view, visit https://gerrit.wikimedia.org/r/161276
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3eea91a5933af31457a3ac24624e0fda82d61849
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BryanDavis <[email protected]>
Gerrit-Reviewer: Andrew Bogott <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: Filippo Giunchedi <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits