-
Notifications
You must be signed in to change notification settings - Fork 111
Cache vagrant-omnibus packages #13
Comments
Install vagrant-omnibus:
Sample Vagrantfile:
After |
Hm. I couldn't sworn I'd submitted an issue for this either here or in the EDIT: Oh hey, it was |
cc: @schisamo |
@patcon common issue or common solution? :-) |
@tknerr I haven't got the time to test this one right now but would you be able to gist us |
@fgrehm tons of log for you here: https://gist.github.com/tknerr/5757832 :-) |
@tknerr tks, I'll look into it ASAP, but I can see you are using Windows, I've never used Vagrant on Windows and I hope this has nothing to do with it :-) |
@tknerr Actually, I was thinking that I think accomodating ( |
True that. If To the opscode guys, do you keep the install script in a repo somewhere for pull requests? cc: @schisamo |
We should be careful with cache_file_path now comes to me as a second thought, e.g.:
The dangerous bit about file_cache_path is that files that are downloaded there are not necessarily properly versioned, e.g. http://some.host.org/foo-1.2.3.zip might be saved locally as foo.zip... |
Hm. Really good point. Yeah, that could be a really hair-pulling problem to troubleshoot if you're new to chef and not realizing what Thoughts? Speaking of which, I'm thinking it would be great to have a command to clear all or individual caches. It might make trouble-shooting quirky states simpler if we could just start with saying "run |
👍 for Machine scope by default is definitely safer, but I'm fine with either... |
@fgrehm Totally, but most users are just going to add the plugin, enable it, and start working away. Trying to think through the safest option for them :) I know it wouldn't affect puppet users, but any chef user will hit this once we add |
@patcon well, I think I have a better solution to this. what about requiring users to set the scope in order for the plugin to work and add a note to the readme about setting defaults from |
👍 on all. Honestly, we can't even do chef caching until core vagrant gets patched, so the conversation is probably premature optimization :) Let's create an issue for a solution after progress on #14 is even possible. I created a red "blocked" tag for issues like this one (blocked by install.sh script), and #14 (blocked by vagrant :chef_solo provisioner code). Feel free to remove if you think it too much clutter. |
Darn, I thought there is a workaround by using a modified install.sh which downloads to More details in the comment here: chef-boneyard/vagrant-omnibus#22 (comment) One solution would be to hook in before the |
@tknerr starting with 0.3.0 we are no longer using hooks to configure buckets, we changed it to a monkey patch so that we can reconfigure buckets between provisioners runs and we are only relying on hooks to ensure a single cache root dir exists in order to deal with 0.2 -> 0.3 upgrades. |
@fgrehm I think I didn't fully get it yet. So you suggest to switch back to using hooks again instead of the monkey patch? |
Not sure if others found this, but we can now use a custom We can use something like this script did: https://gist.github.com/hectcastro/6443633 The downside is that it requires setting an ENV variable (might be possible to set at top of Vagrantfile). Would be great to have that be an official config setting. Seems like the cleanest route until opscode makes it possible to submit PRs for |
@tknerr sorry, I meant we could create a new hook that does what we want, but I think I like @patcon's idea to use a custom script :) @patcon just to confirm, are you suggesting that we bundle that script with vagrant-cachier and provide a config that automatically set things up or do you think it should be enough just to have documentation around on setting that script available on the readme? |
I don't normally like to move critical code outside the repo, but thinking it might be more beneficial to host in a gist? If I'm not mistaken, we can set ENV in |
@patcon @fgrehm I have tried the same approach by setting the ENV in the Vagrantfile:
It picks up the alternative I was previously under the impression that vagrant-cachier comes after omnibus because I was looking for the "Configuring cache buckets..." part in the output:
My initial approach failed because I cached the omnibus package in @hectcastro's approach is to download the omnibus package to It's only a workaround, but it finally works! :-) |
Finally added this to my if (defined? VagrantPlugins::Cachier && defined? VagrantPlugins::Omnibus)
ENV['OMNIBUS_INSTALL_URL']="https://gist.github.com/hectcastro/6443633/raw/install.sh"
puts "setting custom OMNIBUS_INSTALL_URL for vagrant-cachier: #{ENV['OMNIBUS_INSTALL_URL']}"
end |
just got back from vacation today. the changes are all in preprod now and i've run it through jenkins and done some manual testing. i need our Q/A to sign off on it and figure out what the new release process in 2014 looks like and then it should all get shipped before end of week (hopefully by wed or so...) preprod can be hit here if you want to test it:
i'm soft-launching a flag to install open source server with install.sh as well:
|
Any update @lamont-granquist? Feels like we're really close. |
yeah, still stuck on Q/A, i think they've got a bunch to do with EC releases and ohai 7, but i'll try to unblock it next week.. |
AWESOME! I've just removed the blocked tag :-) @lamont-granquist @tmatilai and others, thanks for making it happen 🍻 |
@tmatilai @lamont-granquist either it's way too late and I don't see the obvious or the updated Roadblocks I stumbled upon:
Am I just using it wrong? |
well i consciously assumed that the first thing was the responsibility of the 'caller' to create that directory. for the second thing i could see how that's a real problem since you don't know the filename to download. problem is that install.sh doesn't know that either unless it hits the web service. i could fix that with a check for existence of the file, but that'll require that the client is online and can hit the metadata service.... hmmm re-reading it bug it seems like checking for existence would fix it and we're not trying to address offline use as well? |
@lamont-granquist well I was under the impression that the new install.sh would use an offline file if filename and checksum matches. Creating the directory if not exists should be trivial, we doing it for I will modify the The main goal is still to use vagrant-cachier for caching the omnibus packages downloaded via vagrant-omnibus, and this requires not downloading the file again if it already exists and is valid. |
the problem is that we need to check the web service to get the filename and the md5 to check integrity, so if all you pass is a directory then if we're offline we have no idea of which file we need to check or install. there is an -f option which passes the whole path to the file in which case it becomes pretty easy (as long as you don't care as much about integrity, and just check for existence). |
yup, fully agree. Actually it should not be totally offline, just the "big" omnibus package should not have to be downloaded again if it is already present AND the checksum matches. The idea is as follows:
In essence this means that the we will always check the web service for the latest filename / checksums, but allow for caching if either @lamont-granquist @tmatilai what do you think? |
works for me |
@tknerr that sounds good and correct. I just can't understand how I missed the whole thing... =) |
@lamont-granquist @tmatilai install.sh PR is ready for you to review (see above) I have put together a working scenario with vagrant-omnibus and vagrant-cachier here To test it just run It requires vagrant-omnibus to use the |
To bring this lengthy issue to an end, everything seems to be in place now: Prerequisites:
Options for integrating with vagrant-cachier: Since this approach failed I implemented a workaround which creates a vagrant omnibus "pseudo bucket" directly when the root bucket is configured. This is early enough to set The last option would be to not integrate it with vagrant-cachier and handle it manually in your Vagrantfile:
@fgrehm what's your preference? |
Created PR #92 on contingency. If you have better ideas let me know... |
@schisamo proposed to let vagrant-omnibus detect whether vagrant-cachier is enabled and set the This way we would not need to change anything in vagrant-cachier, and thus would not need to introduce a "pseudo bucket" with #92 |
+1 for resolving this issue |
the omnitruck deploy to prod is imminent |
@tknerr your omnitruck change just went live in prod |
@lamont-granquist thanks! 👍
|
I'd buy a beverage to anyone who can summarize how to cache the Omnibus package and all of the changes to the associated plugins. :) |
@hectcastro yes what a mess ;-)
Once 2. is merged and released you just need to grab that new release of vagrant-omnibus. No changes in vagrant-cachier or any other plugins required. 🍻 Jump in for testing chef-boneyard/vagrant-omnibus#73 to get your beverage back ;-) |
Closing in favor of chef-boneyard/vagrant-omnibus#73 |
Opscode recently switched to provisionerless baseboxes and now installs Omnibus Chef via a Vagrant plugin:
https://github.com/schisamo/vagrant-omnibus
I just waited for >30 mins for the omnibus package to download via 3G (2.5G rather), but unfortunately it did not get cached as the
vagrant-omnibus
plugin kicks in beforevagrant-cachier
.Given that this is a common big upfront download all the time, would it be possible to cache that as well?
The text was updated successfully, but these errors were encountered: