What setup for build cache is require for bundle install

gep13's Avatar

gep13

12 Oct, 2014 08:13 PM

Hello,

I am a bit of a noob in terms of all things ruby, so I am looking for some help.

As part of the deployment of my blog site, which is using octopress as the engine, I run the command bundle install. This goes off and grabs a bunch of installations each time I build my blog. I figure I should be able to cache these files using the appveyor build cache, but I have no idea what folder they end up going into.

Any thoughts on which folder I should add to the build cache to speed up this installation process, and not have to download the files each time?

Thanks!

Gary

  1. 1 Posted by gep13 on 13 Oct, 2014 12:14 PM

    gep13's Avatar

    I "think" i might have answered my own question :-)

    Using this:

    http://stackoverflow.com/questions/5107141/ruby-on-rails-where-to-g...

    Added the following commands to my build script:

      - cmd: gem env
      - cmd: bundle show rack
    

    Which resulted in this:

    https://ci.appveyor.com/project/GaryEwanPark/adnuguk-github-io/buil...

    So I have added this to my cache settings:

    cache:
      - C:/Ruby193/lib/ruby/gems/1.9.1
      - C:/Users/appveyor/.gem/ruby/1.9.1
    

    And just trying this out. Does this seem like a sensible approach?

    Thanks

  2. 2 Posted by gep13 on 13 Oct, 2014 12:23 PM

    gep13's Avatar

    Hmmm, did I do something wrong? My build just failed:

    https://ci.appveyor.com/project/GaryEwanPark/adnuguk-github-io/buil...

    With the error:

    The system cannot find the path specified

    All I did was add this:

    https://github.com/adnuguk/adnuguk.github.io/commit/34b7370a096a9e2...

    It is like the caching was able to find the folder, even though the gem env command just told me that it was there.

    Any thoughts?

    Thanks!

  3. 3 Posted by gep13 on 14 Oct, 2014 12:40 PM

    gep13's Avatar

    Ok, looks like I am getting "somewhere" with this.

    If I change from this:

    cache:
      - C:/Ruby193/lib/ruby/gems/1.9.1
      - C:/Users/appveyor/.gem/ruby/1.9.1
    

    To this:

    cache:
      - C:\Ruby193\lib\ruby\gems\1.9.1
    

    i.e. use backslashes, rather than forward slashes, then the build caching works.

    However, then the rest of the build stops working properly :-(

    Here is the output of the build when caching is enabled:

    https://ci.appveyor.com/project/GaryEwanPark/adnuguk-github-io/buil...

    And here is the output from a build straight after the last one, with caching disabled:

    https://ci.appveyor.com/project/GaryEwanPark/adnuguk-github-io/buil...

    As you can see it is the rake generate step where things start to go wrong. I honestly have no idea why this is happening, or what effect the build caching is having on the process. Can anyone help?

    Thanks!

    Gary

  4. Support Staff 4 Posted by Feodor Fitsner on 14 Oct, 2014 06:12 PM

    Feodor Fitsner's Avatar

    Maybe cache already contains some invalid data.

    I've just reset the cache for this project - give it another try with cache enabled.

  5. 5 Posted by gep13 on 14 Oct, 2014 06:32 PM

    gep13's Avatar

    Re-running build now, will keep you posted.

    Thanks!

  6. 6 Posted by gep13 on 14 Oct, 2014 06:54 PM

    gep13's Avatar

    Hello Feodor,

    Sorry to report that the same problem occured:

    https://ci.appveyor.com/project/GaryEwanPark/adnuguk-github-io/buil...

    Do you know if the folder that I am caching is all that is required? I am a complete noob in Ruby, and I don't know if there is other stuff that I need to cache or not.

    Thanks

    Gary

  7. Support Staff 7 Posted by Feodor Fitsner on 14 Oct, 2014 07:04 PM

    Feodor Fitsner's Avatar

    That's interesting. Maybe there is some issue with file timestamps restored from cache.
    Btw, this is how it works in Travis: http://docs.travis-ci.com/user/caching/

  8. Support Staff 8 Posted by Feodor Fitsner on 14 Oct, 2014 07:21 PM

    Feodor Fitsner's Avatar

    Another idea! Many gems put their bash or CMD scripts into bin folder to make tooling work from command line, for example jekyll.

    I think you should also try caching C:\Ruby193\bin folder in addition to that one.

  9. Support Staff 9 Posted by Feodor Fitsner on 14 Oct, 2014 07:23 PM

    Feodor Fitsner's Avatar

    I cleared your cache one more time.

  10. 10 Posted by gep13 on 15 Oct, 2014 07:01 AM

    gep13's Avatar

    You sir, are a genius!

    Build now working:

    https://ci.appveyor.com/project/GaryEwanPark/adnuguk-github-io

    with this:

    cache:
      - C:\Ruby193\lib\ruby\gems\1.9.1
      - C:\Ruby193\bin
    

    as cache settings.

    Thanks again!

  11. 11 Posted by gep13 on 15 Oct, 2014 07:10 AM

    gep13's Avatar

    The above has taken my build times from 5 min 37 sec to 2 min 28 sec

    Gary

  12. Support Staff 12 Posted by Feodor Fitsner on 15 Oct, 2014 04:41 PM

    Feodor Fitsner's Avatar

    Awesome! This definitely should go to the docs!

    Thanks for the update!

  13. 13 Posted by gep13 on 15 Oct, 2014 06:20 PM

    gep13's Avatar

    How does the documentation work here at AppVeyor, do you accept any community contributions?

  14. Support Staff 14 Posted by Feodor Fitsner on 16 Oct, 2014 03:59 AM

    Feodor Fitsner's Avatar

    Website is in private repo right now, but we're going to make it public.

    If you want to help with content (any, not only help) - this would be fantastic help!

  15. 15 Posted by gep13 on 16 Oct, 2014 06:33 AM

    gep13's Avatar

    Happy to help out, where and when I can :-)

    Perhaps a separate Issues list, or at least categorized issues, with tasks that can be cherry picked and raised as PR's into the documentation repo?

  16. gep13 closed this discussion on 17 Oct, 2014 06:37 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

01 Oct, 2024 04:27 PM
26 Sep, 2024 03:49 PM
26 Sep, 2024 09:02 AM
25 Sep, 2024 07:07 PM
24 Sep, 2024 08:39 PM
24 Sep, 2024 06:47 AM