[ 
https://issues.apache.org/jira/browse/YARN-7654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16420054#comment-16420054
 ] 

Eric Yang commented on YARN-7654:
---------------------------------

[~jlowe]

{quote}
Why does add_param_to_command_if_allowed bother to track the previous index? 
The code only modifies the index if the command is allowed, and the index is 
only adjusted if add_to_buffer doesn't fail.
{quote}

This is only forwarding the integer pointer because the top level functions 
call this method, which calls add_to_buffer.  We can not lose track of index 
because it is local pointer, not a global variable.

{quote}
It looks like we're doing this a lot and will continue to do so. I'd recommend 
creating a simple vararg utility function that lets vsnprintf do the 
calculation for us. It would be very handy to solve the potential buffer 
overruns in a lot of the get_docker_*_command functions. See the vsnprintf 
manpage for sample code.
{quote}

I'll make a simple version of make_message that allows user to pass in final 
string length.  vsnprintf will not dynamic calculate string length, so the 
final output correctness is really depending on the developer that use the 
function.

> Support ENTRY_POINT for docker container
> ----------------------------------------
>
>                 Key: YARN-7654
>                 URL: https://issues.apache.org/jira/browse/YARN-7654
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: yarn
>    Affects Versions: 3.1.0
>            Reporter: Eric Yang
>            Assignee: Eric Yang
>            Priority: Blocker
>         Attachments: YARN-7654.001.patch, YARN-7654.002.patch, 
> YARN-7654.003.patch, YARN-7654.004.patch, YARN-7654.005.patch, 
> YARN-7654.006.patch, YARN-7654.007.patch
>
>
> Docker image may have ENTRY_POINT predefined, but this is not supported in 
> the current implementation.  It would be nice if we can detect existence of 
> {{launch_command}} and base on this variable launch docker container in 
> different ways:
> h3. Launch command exists
> {code}
> docker run [image]:[version]
> docker exec [container_id] [launch_command]
> {code}
> h3. Use ENTRY_POINT
> {code}
> docker run [image]:[version]
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to