Giter Club home page Giter Club logo

Comments (10)

bflad avatar bflad commented on July 17, 2024

I agree this could be improved. I thought error! Fails with any non-zero exit status. Is this what makes sense in all cases? Should we have retries, etc for exit codes in any places and how would the implementation look? Thanks for the consideration

from docker.

errm avatar errm commented on July 17, 2024

It seems till the next release of docker this won't be much use anyway as there a lot of fixes for things exiting with the wrong exit code mainly, 0 with an error. See a
moby/moby#3767 and moby/moby#3775

from docker.

jcrobak avatar jcrobak commented on July 17, 2024

I agree this could be improved. I thought error! Fails with any non-zero exit status. Is this what makes sense in all cases? Should we have retries, etc for exit codes in any places and how would the implementation look? Thanks for the consideration

It probably makes sense to have both a docker_cmd! that checks error codes and a docker_cmd that doesn't. I've started working on a local changeset, and it seems to have already uncovered some issues in the current cookbook. I've been trying to work through some of those before sharing. I'm not sure on the retries -- that is typically used for network commands, so it might make sense for e.g. a docker pull. Although it seems like that'd be better place in docker itself.

It seems till the next release of docker this won't be much use anyway as there a lot of fixes for things exiting with the wrong exit code mainly, 0 with an error. See a
moby/moby#3767 and moby/moby#3775

AFAICT, the use of return codes has gotten better and better with each release. docker build used to always return 0, but it doesn't in the latest release. We could look at output of commands that don't return proper codes if it's important before there's a new docker release...

from docker.

jhulten avatar jhulten commented on July 17, 2024

@jcrobak Are your changes in a public repo somewhere? I was also thinking about refactoring the docker_cmd work into the helper library.

from docker.

jcrobak avatar jcrobak commented on July 17, 2024

@jhulten I don't have anything up yet, but I'll try to push up what I have after some cleanups.

from docker.

jcrobak avatar jcrobak commented on July 17, 2024

Here's most of what I have so far: https://github.com/jcrobak/chef-docker/tree/return-code-validation

I haven't been able to get the tests to pass on debian 7 (in particular, the test that service('testcontainerd').must_be_running -- it seems that chef is falling back to ps to check that the service is running, which obviously won't work. That doesn't seem related to my changes, though...

from docker.

bflad avatar bflad commented on July 17, 2024

@jcrobak nice work so far. I'd be happy to merge that into next release. With respect to Debian 7 support, I still have it listed as "Debian 7 (experimental)" in the README, so I wouldn't let that stop you for now given your changes would likely not change that behavior.

from docker.

jcrobak avatar jcrobak commented on July 17, 2024

@bflad Sounds good. I was able to verify that my full changeset (there are a couple more commits atop of what's pushed publicly) passes kitchen tests on all platforms other than Debian 7. Would you prefer if I break the branch into a couple PRs or are you ok with a PR with a few semi-related commits?

from docker.

bflad avatar bflad commented on July 17, 2024

Ah, sorry I didn't respond to this yesterday. If you already have it in one branch, please feel free to submit as one PR, although may need to rebase. I also have some more minor functionality going into the image provider tonight to match (ha!) the functionality #57 just added to the container provider. If I have time I may look into #59 as well, but that shouldn't affect your work.

from docker.

bflad avatar bflad commented on July 17, 2024

Fixed in 0.30.0 which will be released tonight.

from docker.

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.