You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Timothy Chen <tn...@apache.org> on 2014/08/10 09:44:22 UTC

Review Request 24533: Detect image entrypoint in docker run

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/24533/
-----------------------------------------------------------

Review request for mesos, Benjamin Hindman, Ian Downes, and Jie Yu.


Repository: mesos-git


Description
-------

We need to treat docker images with entrypoint specially since a docker image without an entrypoint requires us to wrap the command in /bin/sh -c, where command to a image with entrypoint should be passed arguments directly to the image.


Diffs
-----

  src/docker/docker.hpp 98b2d60 
  src/docker/docker.cpp 1cba381 

Diff: https://reviews.apache.org/r/24533/diff/


Testing
-------

make check


Thanks,

Timothy Chen


Re: Review Request 24533: Detect image entrypoint in docker run

Posted by Mesos ReviewBot <de...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/24533/#review50284
-----------------------------------------------------------


Bad patch!

Reviews applied: [24464, 24349, 24475]

Failed command: git apply --index 24475.patch

Error:
 error: patch failed: src/slave/containerizer/docker.cpp:127
error: src/slave/containerizer/docker.cpp: patch does not apply


- Mesos ReviewBot


On Aug. 10, 2014, 7:44 a.m., Timothy Chen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/24533/
> -----------------------------------------------------------
> 
> (Updated Aug. 10, 2014, 7:44 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Ian Downes, and Jie Yu.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> We need to treat docker images with entrypoint specially since a docker image without an entrypoint requires us to wrap the command in /bin/sh -c, where command to a image with entrypoint should be passed arguments directly to the image.
> 
> 
> Diffs
> -----
> 
>   src/docker/docker.hpp 98b2d60 
>   src/docker/docker.cpp 1cba381 
> 
> Diff: https://reviews.apache.org/r/24533/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Timothy Chen
> 
>


Re: Review Request 24533: Detect image entrypoint in docker run

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/24533/#review50143
-----------------------------------------------------------


Not a complete review yet, wanted to help out with https://reviews.apache.org/r/24541.


src/docker/docker.hpp
<https://reviews.apache.org/r/24533/#comment87740>

    Why not return 'Image' and make it public?



src/docker/docker.cpp
<https://reviews.apache.org/r/24533/#comment87741>

    s/str/s/



src/docker/docker.cpp
<https://reviews.apache.org/r/24533/#comment87761>

    Okay, it's very very clear that we need some JSON helpers for looking things up!!! This is getting insane! ;-)
    
    I just threw up https://reviews.apache.org/r/24541 which should let you do:
    
    Result<JSON::Value> entrypoint =
      json.find<JSON::Value>("ContainerConfig.Entrypoint");
    
    if (entrypoint.isError()) {
      return Error("Failed to find 'ContainerConfig.Entrypoint': " +
                   entrypoint.error());
    } else if (entrypoint.isNone()) {
      return Error("Unable to find 'ContainerConfig.Entrypoint'");
    }
    
    if (entrypoint.is<JSON::Null>()) {
      return Docker::Image(None());
    }
    
    if (!entrypoint.is<JSON::Array>()) {
      return Error("Unexpected type found for 'ContainerConfig.Entrypoint' (not an array)");
    }
    
    ...



src/docker/docker.cpp
<https://reviews.apache.org/r/24533/#comment87762>

    Might the entrypoint not actually be all of the values in the JSON array?


- Benjamin Hindman


On Aug. 10, 2014, 7:44 a.m., Timothy Chen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/24533/
> -----------------------------------------------------------
> 
> (Updated Aug. 10, 2014, 7:44 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Ian Downes, and Jie Yu.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> We need to treat docker images with entrypoint specially since a docker image without an entrypoint requires us to wrap the command in /bin/sh -c, where command to a image with entrypoint should be passed arguments directly to the image.
> 
> 
> Diffs
> -----
> 
>   src/docker/docker.hpp 98b2d60 
>   src/docker/docker.cpp 1cba381 
> 
> Diff: https://reviews.apache.org/r/24533/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Timothy Chen
> 
>


Re: Review Request 24533: Detect image entrypoint in docker run

Posted by Timothy Chen <tn...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/24533/
-----------------------------------------------------------

(Updated Aug. 10, 2014, 7:44 a.m.)


Review request for mesos, Benjamin Hindman, Ian Downes, and Jie Yu.


Repository: mesos-git


Description
-------

We need to treat docker images with entrypoint specially since a docker image without an entrypoint requires us to wrap the command in /bin/sh -c, where command to a image with entrypoint should be passed arguments directly to the image.


Diffs
-----

  src/docker/docker.hpp 98b2d60 
  src/docker/docker.cpp 1cba381 

Diff: https://reviews.apache.org/r/24533/diff/


Testing
-------

make check


Thanks,

Timothy Chen