Giter VIP home page Giter VIP logo

Comments (7)

carolynvs avatar carolynvs commented on August 22, 2024 1

The driver doesn't seem to print much (just 1 error message about pulling the image). Outputting everything to the Operation writer would be just fine by me.

from cnab-go.

glyn avatar glyn commented on August 22, 2024

Seems reasonable to me.

from cnab-go.

benpatt avatar benpatt commented on August 22, 2024

The docker driver is passed on the Operation struct a writer for any output, but instead it is writing directly to stdout.

Is this still the case? If so, can you give a pointer?

from cnab-go.

carolynvs avatar carolynvs commented on August 22, 2024

Yup, it's still the case. 😀 You feel like tackling it?

The driver implements the common interface for a driver, but in it's exec function it ignores the writer field coming in on the op argument to exec.

https://github.com/deislabs/duffle/blob/08636d6a7f3651ee05cba1f2fb2cdaaa3d405fae/pkg/driver/docker_driver.go#L202

from cnab-go.

glyn avatar glyn commented on August 22, 2024

When discussing this issue with @benpatt, I wondered if there was a distinction between the output stream for the logs from the docker driver and from the container that the docker drive runs. @carolynvs would you say that all the logs from the driver itself and from the container should be sent to the same output stream (the one in the Operation struct)?

from cnab-go.

silvin-lubecki avatar silvin-lubecki commented on August 22, 2024

As said on this PR review cnabio/duffle#808 (review)

Well we are actually using those 2 methods here in docker/app
https://github.com/docker/app/blob/master/internal/commands/cnab.go#L191
If I remember correctly we are using the container output stdout and stderr for our custom actions (ex: our render action which can fail or print a result), but we still need to mute the driver itself using the dockerCli stdout and stderr pointing to ioutil.Discard.
By the way, I'm wondering why we are still using the drivers here, as they were moved to cnab-go 🤔
https://github.com/deislabs/cnab-go/blob/master/driver/docker/docker.go

from cnab-go.

glyn avatar glyn commented on August 22, 2024

As said on this PR review #808 (review)

Well we are actually using those 2 methods here in docker/app
https://github.com/docker/app/blob/master/internal/commands/cnab.go#L191
If I remember correctly we are using the container output stdout and stderr for our custom actions (ex: our render action which can fail or print a result), but we still need to mute the driver itself using the dockerCli stdout and stderr pointing to ioutil.Discard.

It would be good to add a driver test to tie down the behaviour. Otherwise, it is bound to break docker/app in future.

By the way, I'm wondering why we are still using the drivers here, as they were moved to cnab-go 🤔
https://github.com/deislabs/cnab-go/blob/master/driver/docker/docker.go

Good catch. Raised cnabio/duffle#809 to delete the old code. We also need to move this issue to cnab-go which is now its proper home.

from cnab-go.

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.