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

Vendor InSpec gem #112

Closed
chris-rock opened this issue Oct 14, 2016 · 3 comments
Closed

Vendor InSpec gem #112

chris-rock opened this issue Oct 14, 2016 · 3 comments
Assignees
Labels
Type: Enhancement Adds new functionality.

Comments

@chris-rock
Copy link
Contributor

Instead of requiring Chef to install the InSpec gem, we vendor the gem into the cookbook. This allows users to update easier.

Cookbook version

1.0.0

@chris-rock chris-rock added this to the 2.0 milestone Oct 14, 2016
@arlimus arlimus added the ready label Oct 17, 2016
@chris-rock chris-rock removed this from the 2.0 milestone Oct 19, 2016
@jeremymv2
Copy link
Contributor

jeremymv2 commented Oct 28, 2016

@chris-rock
The vendoring approach can be problematic for a couple of reasons that come to mind:

  • cookbook size - as of inspec 1.3.0 the size is 27MB of core libs + all deps
~/Downloads$ gem install --no-rdoc --no-ri --install-dir files/default/vendor --no-user-install inspec
...
...
~/Downloads$ du -sk files
27480   files  # 27MB
~/Downloads$
  • typically you'd manipulate ruby's $LOAD_PATH to prepend your custom vendor lib path from the cookbook; however, if certain gem libs are already present from Chef-client's lib path, the gem library from the chef-client install is ALWAYS used instead of the vendored one. This is because the chef-client already has the gem activated prior to loading/activating the one from the vendored path. I've witnessed this behavior even when manipulating $LOAD_PATH like so:
$LOAD_PATH.push *Dir[File.expand_path('../../files/default/vendor/gems/**/lib', __FILE__)]
$LOAD_PATH.unshift *Dir[File.expand_path('..', __FILE__)]

@chris-rock
Copy link
Contributor Author

As discussed with @grdnrio @jeremymv2 @alexpop:

  • We identified that at least 90% of the customers do not have their own gem repository
  • for now, we added alternative gem source: adding support for alternate gem source #146
  • If we are going to vendor, we should eliminate all non-required dependencies (eg. winrm or docker for train )

@chris-rock
Copy link
Contributor Author

InSpec is part of Chef 13 now. Therefore we do not need to vendor inspec anymore.

@tas50 tas50 added Type: Enhancement Adds new functionality. and removed Type: Feature Request labels Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Development

No branches or pull requests

5 participants