github/octocatalog-diff

preserve or cache to dir?

BarnumD opened this issue · 2 comments

I'm attempting to set up oc-d in gitlab CI. I've set up a job similar to the puppet_catalog_spec.rb example that takes a list of hosts and executes the run_octocatalog_diff function against each. I've noticed that each time it runs a directory in /tmp/ such as /tmp/ocd-ipc-20180827-5724-169poir/ocd-builddir-20180827-5729-zb1ej1/... will be built and destroyed when complete. The issue is that for each build, it has to run the bootstrap script - which takes time. I'm running --bootstrap-current, otherwise the puppet modules are not downloaded.

I've been pouring over the documentation trying to figure out how to improve the speed but I've not found anything for the to branch. I did, however, find the --cached-master-dir option, which helps on the 'from' side.

I'd like to be able to have multiple nodes run through without having to run the bootstrap each time. Is there currently a solution for this?

I suppose one way would be to manually run the bootstrap against the checked out directory. Then when oc-d copies that dir into the /tmp folder it would already be bootstrapped with no need for --bootstrap-current. Unless there is some other native way, then I'll have to bake that into my ci job.

If I run the bootstrap in the gitlab.ci 'before' and also run --bootstrap-current than it seems to be faster for subsequent runs. This is because the initial bootstrap update the current checked-out directory. Whereas, if you just ran --bootstrap-current the behavior was that bundle update and r10k (both part of bootstrap) had to run from scratch each time the rake task would iterate over a host. By running the bootstrap first, the symlinked directory already has this information. For some reason, it still requires the --bootstrap-current to be run or else it can't find the gems, but at least it's very fast since bundle and r10k have already run once.