Git Product home page Git Product logo

Comments (5)

cppforlife avatar cppforlife commented on August 22, 2024 1

i see. may be following is useful kbld -f ... --lock-output /tmp/lock.yml (which will record resolved/built images and save them as ImageOverrides in lock.yml) and then use it later via ytt ... | kbld -f - -f /tmp/lock.yml (to use those overrides).

from kbld.

cppforlife avatar cppforlife commented on August 22, 2024

there are two challenges with that even if kbld would preserve comments -- (1) kbld returns combined output which would "break" any non-trivial ytt template since loads would not be able to find files (2) there is no guarantee that kbld can find image references since they might be in format like this: image: #@ data.values.image (or some variation).

because of issues above i typically recommend to run kbld on the templating results or some kind of more deterministic input to the templates (eg data values files that are setting image references).

what are your thoughts on challenges above?

from kbld.

jpambrun avatar jpambrun commented on August 22, 2024

I better understand the challenges. I have a use case where spawn a lot of jobs from the same template and kbld execution, even when cached, is adding up to a long time.

In addition, kbld requires docker while ytt, kubectl does not. A system with docker could build the image and update the templated yaml. That updated template could then be used by another system without docker.

It's not something I desperately need, but I was slightly surprised to discover it wasn't possible.

Perhaps, the Sources object could have a default tag. We could invoke kbld -f build.yaml > build.yaml to build and update the default tag (build.yaml containing only Sources and ImageDestinations). Then invoke kbld with a --noop that would only transfer the default tag kbld --noop -f build.yaml -f temaplte.yaml > rendered.yaml. I don't know, I am thinking out loud..

from kbld.

jpambrun avatar jpambrun commented on August 22, 2024

Thanks @cppforlife. I didn't know about --lock-output. Makes a lot of sense. Now I almost feel embarrassed.

In case it helps others, here is what I did in a Makefile:

workflow.build.lock.yaml: workflow.yaml  workflow.build.yaml Dockerfile
	kbld -f workflow.yaml -f workflow.build.yaml --lock-output workflow.build.lock.yaml

/tmp/rendered-workflow.yaml: metadata.yaml workflow.yaml workflow.build.lock.yaml
	ytt -f metadata.yaml -f workflow.yaml | kbld -f workflow.build.lock.yaml -f - > /tmp/rendered-workflow.yaml

submit: /tmp/rendered-workflow.yaml
	argo submit /tmp/rendered-workflow.yaml

workflow.yaml in an argo workflow I want to run many time. metadata.yaml configures the workflow. workflow.build.yaml contains the image sources and destinations. workflow.build.lock.yaml is the ImageOverrides resulting for the build, it can be checked-in for teammates to use.

from kbld.

cppforlife avatar cppforlife commented on August 22, 2024

@jpambrun glad it solves your problem!

from kbld.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.