Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up install by disabling RDOC generation #13

Closed
rosenfeld opened this issue Apr 22, 2011 · 16 comments
Closed

Speed up install by disabling RDOC generation #13

rosenfeld opened this issue Apr 22, 2011 · 16 comments
Assignees

Comments

@rosenfeld
Copy link
Contributor

I've noticed that a lot of CPU time and memory is used by a long time in:

./ruby -rpurelib.rb ./bin/rdoc --all --ri --op .ext/rdoc .

Maybe it would be great to disable RDOC generation from the beggining for make the install process faster... What do you think?

@yfeldblum
Copy link

Who needs rdoc/ri generation on a server? Especially on an automated server?

Skipping rdoc/ri generation would be fantastic.

@fnichol
Copy link
Contributor

fnichol commented May 1, 2011

Agreed, I hate that as well (rubygems/rubygems#42). Only thing I'm iffy on is going against the rubygems default (principal of least surprise), even if it's kinda lame. Besides, it's possible that the cookbook could be used for development workstations as well.

What do you both think about an attribue, something like:

default['rvm']['gem_docs'] = true

which could be overridden to false (that's what I'd drop in my role definitions that tweak rvm defaults).

To be honest, I forgot about this build delay because sooner or later I drop in a /etc/gemrc file and it's done. Good catch!

@ghost ghost assigned fnichol May 1, 2011
@rosenfeld
Copy link
Contributor Author

I think it is a good idea, but I think the default should be false because it is the most common option for most automated install environments.

@fnichol
Copy link
Contributor

fnichol commented May 1, 2011

I don't think my arm needed too much twisting there. Will do (make false the default) then those who want the docs can at least ask to get them. Now to update...

@rosenfeld
Copy link
Contributor Author

Thanks!

@yfeldblum
Copy link

+1

@fnichol
Copy link
Contributor

fnichol commented May 2, 2011

So, it looks like the Chef::Provider::Rubygems provider already kills docs on gem install (https://github.com/opscode/chef/blob/0.9-stable/chef/lib/chef/provider/package/rubygems.rb#L420). Can either of you confirm with -l debug on a chef execution? Here is an example when I bundler gets installed:

[Sun, 01 May 2011 21:12:18 -0700] DEBUG: Processing rvm_gem[bundler] on cb-tester
[Sun, 01 May 2011 21:12:18 -0700] DEBUG: Executing grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems"
: stdout
[default] [Sun, 01 May 2011 21:12:18 -0700] DEBUG: ---- Begin output of grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems" ----
[Sun, 01 May 2011 21:12:18 -0700] DEBUG: STDOUT: 
[Sun, 01 May 2011 21:12:18 -0700] DEBUG: STDERR: 
[Sun, 01 May 2011 21:12:18 -0700] DEBUG: ---- End output of grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems" ----
[Sun, 01 May 2011 21:12:18 -0700] DEBUG: Ran grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems" returned 1
[Sun, 01 May 2011 21:12:18 -0700] DEBUG: Executing echo "bundler" >> "/usr/local/rvm/gemsets/global.gems"
[default] [Sun, 01 May 2011 21:12:18 -0700] DEBUG: ---- Begin output of echo "bundler" >> "/usr/local/rvm/gemsets/global.gems" ----
[Sun, 01 May 2011 21:12:18 -0700] DEBUG: STDOUT: 
[Sun, 01 May 2011 21:12:18 -0700] DEBUG: STDERR: 
[Sun, 01 May 2011 21:12:18 -0700] DEBUG: ---- End output of echo "bundler" >> "/usr/local/rvm/gemsets/global.gems" ----
[Sun, 01 May 2011 21:12:18 -0700] DEBUG: Ran echo "bundler" >> "/usr/local/rvm/gemsets/global.gems" returned 0
[Sun, 01 May 2011 21:12:18 -0700] INFO: Ran execute[Add bundler to /usr/local/rvm/gemsets/global.gems] successfully
[default] [Sun, 01 May 2011 21:12:19 -0700] DEBUG: sh(bash -c "source /etc/profile.d/rvm.sh" && rvm ruby-1.8.7-p334@global gem env gempath)
: stdout
[default] [Sun, 01 May 2011 21:12:20 -0700] DEBUG: No installed version found for bundler (>= 0, runtime)
[Sun, 01 May 2011 21:12:20 -0700] DEBUG: sh(bash -c "source /etc/profile.d/rvm.sh" && rvm ruby-1.8.7-p334@global gem env)
: stdout
[default] [Sun, 01 May 2011 21:12:21 -0700] DEBUG: Found gem bundler version 1.0.12 for platform ruby from http://rubygems.org/
[Sun, 01 May 2011 21:12:21 -0700] INFO: Installing gem_package[bundler] version 1.0.12
[Sun, 01 May 2011 21:12:21 -0700] DEBUG: sh(bash -c "source /etc/profile.d/rvm.sh" && rvm ruby-1.8.7-p334@global gem install bundler -q --no-rdoc --no-ri -v "1.0.12")
: stdout
[default] [Sun, 01 May 2011 21:12:28 -0700] DEBUG: Processing execute[Add bundler to /usr/local/rvm/gemsets/global.gems] on cb-tester
[Sun, 01 May 2011 21:12:28 -0700] DEBUG: Executing grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems"
: stdout
[default] [Sun, 01 May 2011 21:12:28 -0700] DEBUG: ---- Begin output of grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems" ----
[Sun, 01 May 2011 21:12:28 -0700] DEBUG: STDOUT: 
[Sun, 01 May 2011 21:12:28 -0700] DEBUG: STDERR: 
[Sun, 01 May 2011 21:12:28 -0700] DEBUG: ---- End output of grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems" ----
[Sun, 01 May 2011 21:12:28 -0700] DEBUG: Ran grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems" returned 0
[Sun, 01 May 2011 21:12:28 -0700] DEBUG: Skipping execute[Add bundler to /usr/local/rvm/gemsets/global.gems] due to not_if
[Sun, 01 May 2011 21:12:28 -0700] DEBUG: Processing gem_package[bundler] on cb-tester
[Sun, 01 May 2011 21:12:28 -0700] DEBUG: Found installed gem bundler version 1.0.12 matching bundler (>= 0, runtime)
[Sun, 01 May 2011 21:12:28 -0700] DEBUG: Doing nothing for gem_package[bundler]

@rosenfeld
Copy link
Contributor Author

Hi Fletcher, I think we are talking about different things. You are talking about the 'gem_package' definition, while I'm talking about installing Ruby through RVM. I believe that gem_package won't generated RDoc, but while installing RVM Ruby and watching 'top', I've noticed that 100% of the CPU was being used for generating the docs for the initial/default gems installed by RVM.

I talked with Waynee and told him that we would like to avoid changing gemrc for disabling RDoc generation for the initial gems while installing RVM Ruby. He told me that we could add 'export rvm_gem_options="--no-rdoc --no-ri"' to rvmrc.

What do you think about this option?

@fnichol
Copy link
Contributor

fnichol commented May 6, 2011

Great, I saw your patch to RVM. I'll get this added in the next couple of days, thanks for your help!

@fnichol
Copy link
Contributor

fnichol commented May 12, 2011

Done! Looks okay?

@rosenfeld
Copy link
Contributor Author

Yes, it looks ok. I just didn't understand why using "enable"/"disable" instead of true/false. Another approach also would be something like:

default[:rvm][:rvm_gem_options] = "--no-rdoc --no-ri"

What do you think about it?

@yfeldblum
Copy link

I would at least name it skip_docs_on_gem_install because it affects only the installation of gems, not the installation of rvm or of any rubies.

I might also tend to name it in the positive with a zero/null/empty default, as the following examples:

default[:rvm][:gem_install_docs] = false # option 1
default[:rvm][:gem_install_docs] = [] # option 2

# can be overridden:
node[:rvm][:gem_install_docs] = true # option 1
node[:rvm][:gem_install_docs] = %w[rdoc ri] # option 2

@fnichol
Copy link
Contributor

fnichol commented May 12, 2011

How does this look? I agree, that feels better. The reason for those crazy "enable"/"disable" values is because I didn't realize you could use boolean value in attributes and the rvm/install_rubies was already in that form. Oh well, it's pre-1.0 so API changes are allowed (so that's updated too).

@yfeldblum
Copy link

+1

@rosenfeld
Copy link
Contributor Author

Awesome! :)

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants