docker-compose-buildkite-plugin icon indicating copy to clipboard operation
docker-compose-buildkite-plugin copied to clipboard

Allow for building an image with multiple --cache-from images

Open richafrank opened this issue 4 years ago • 13 comments

We're using this to --cache-from intermediate and final stages of a multi-stage docker build, instead of busting the cache every time on building the intermediate target.

Would definitely appreciate a review of the interface and implementation.

richafrank avatar May 14 '20 13:05 richafrank

This is a huge win for anyone building multi-stage images that want to use intermediate cache for faster builds.

irlevesque avatar May 19 '20 18:05 irlevesque

@lox / @toolmantim Quantopian has been using this internally for a while and would love to see it merged upstream. I think other customers would certainly benefit. Anything holding you back that we can address?

irlevesque avatar Jun 09 '20 00:06 irlevesque

@irlevesque sorry for the delay here, and thanks for the thorough PR. It's definitely something we'd love to support — I'll get this reviewed for you, we'd love to get it merged.

toolmantim avatar Jun 09 '20 02:06 toolmantim

Thanks so much @toolmantim .

richafrank avatar Jun 09 '20 13:06 richafrank

Thanks for the feedback!

I can definitely see a need for this… even though it's starting to create some pretty wild bash code.

Definitely agreed - please feel free to suggest better bash-isms. I was mostly extending what was here, which required some new bash learnings on my part.

Did you consider some other alternative syntaxes to the readme, rather than adding another layer of : use?

My sense of the requirement here is that we need a bit more hierarchy in order to group cache-froms together.

  • I went with adding an extra tag to each, but only because that was easiest for me to parse from the yaml. Changing the structure of the yaml was my first thought, but I wasn't aware of existing tooling à la plugin_read_list to parse, say, a dictionary. Let me know what you recommend.
  • I chose the : for the tag only because I knew it wouldn't be in use in the repo/image name. If we end up keeping this tag-based design, definitely let me know if there's a better tag.

richafrank avatar Jun 17 '20 19:06 richafrank

Hey @richafrank! Sorry for the late reply! 🙏🏻 We are checking all the PRs open we have, and we are wondering if you are still interested in this PR and if are willing to update it and maybe do the changes that Tim suggested. We can close this one and you can create a new one. Thanks!

pzeballos avatar Jan 28 '22 21:01 pzeballos

Hi @pzeballos ! My need is somewhat stale, but I'd be happy to help push this forward if you're interested in it.

  • I can update the README with my reply above.
  • For the rest, I had replied to Tim's comments needing more info. Would you be able to advise there? Thanks!

richafrank avatar Jan 29 '22 20:01 richafrank

@richafrank We discussed with Tim and we are good with the changes. So if you can update the README with changes you mentioned in the reply and resolve the conflicts we can go ahead with merging the change.

nsuma8989 avatar Apr 01 '22 17:04 nsuma8989

@richafrank Just following up to see if you had a chance to look into above comment

nsuma8989 avatar Apr 06 '22 17:04 nsuma8989

Hi @nsuma8989 , thanks for the reply! Sounds good to me, but I won't be able to get to it this week.

richafrank avatar Apr 06 '22 17:04 richafrank

@richafrank Thank you for the response. Yes, it does not need to be this week and you can just leave a comment whenever you are done.

nsuma8989 avatar Apr 06 '22 17:04 nsuma8989

@nsuma8989 How might I trigger a remote buildkite build à la https://buildkite.com/buildkite/plugins-docker-compose/builds/ , to see if the changes are still ok? I tried opening a new PR, but that didn't work either.

richafrank avatar Apr 11 '22 00:04 richafrank

Hey @richafrank! We have disabled the option to trigger new builds for open PR and third-party repos (we'll check this out). The other PR #323 is ready? Can you close this one so we'll continue on the other one? I did run a build on #323 (which failed 😅), but now all subsequent commits should trigger a new build 🙂 Thanks!

pzeballos avatar Apr 11 '22 14:04 pzeballos

Closing this PR as it is the same (and contained in) #323

toote avatar Sep 16 '22 20:09 toote