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

Jie Yu commented on MESOS-5350:
-------------------------------

commit f5b3f2a6c4795d2c4e7effbb594749cdc9b8ea4e
Author: Joseph Wu <[email protected]>
Date:   Fri May 27 17:19:43 2016 -0700

    Wired up the new docker environment hook.
    
    Modifies the code path for docker executors.
    
    Docker command executors are now launched with an additional flag
    that is filled in by a hook.  The --task_environment flag tells the
    command executor to pass some specified mapping of environment
    variables to the task.
    
    Custom executors are launched with the environment variables directly.
    It is up to custom executors to pass these variables into tasks.
    
    Review: https://reviews.apache.org/r/47216/

commit 8486e9829435d9f09ad0c13de8a4c14257d8a988
Author: Joseph Wu <[email protected]>
Date:   Fri May 27 17:19:30 2016 -0700

    Implemented new asynchronous docker pre-launch hook.
    
    Introduces, but does not fully wire up a new hook.
    
    The new hook, "slavePreLaunchDockerEnvironmentDecorator",
    has divergent semantics compared with existing hooks:
    
    * The hook is asynchronous,
    * can prevent a task from launching if it errors,
    * can overwrite environment variables.
    
    The new hook is intended to be a strictly-superior
    replacement for the existing hook "slavePreLaunchDockerHook".
    
    Review: https://reviews.apache.org/r/47150/

commit cd46db8073fd1ee3d8bd63d3bfedab2e7a522bd7
Author: Joseph Wu <[email protected]>
Date:   Fri May 27 17:19:26 2016 -0700

    Changed the dockerized docker command executor CommandInfo usage.
    
    This changes how we override the `CommandInfo` when launching a
    dockerized executor; from `shell == true` to `shell = false`.
    This means that flags are now passed directly rather than as
    a long string.
    
    i.e.
    From: 'mesos-docker-executor --foo="bar" --some="thing"'
    To: [ 'mesos-docker-executor', '--foo=bar', '--some=thing' ]
    
    Review: https://reviews.apache.org/r/47215/

commit 9b054cc46d462ad5c8c5074b8b5c9e7eeac3dabf
Author: Joseph Wu <[email protected]>
Date:   Fri May 27 17:19:22 2016 -0700

    Removed duplicate call to containerizer::executorEnvironment.
    
    In this code path, where the task uses the default command executor,
    and the agent is not dockerized
    (i.e. `taskInfo.isSome() && flags.docker_mesos_image.isNone()`),
    the `executorEnvironment` function is called twice.
    
    The first call is inside the `Container*` constructor called by
    `Container::create`.  Since `Container::create` gives passes `None`
    for the `environment` field, the constructor will call
    `executorEnvironment` to populate the `environment` field.
    The populated field is then accessible by `launchExecutorProcess`.
    
    Review: https://reviews.apache.org/r/47212/

commit 82029372c3eb0a12218fd9864cc0f5da38f5b108
Author: Joseph Wu <[email protected]>
Date:   Fri May 27 17:19:15 2016 -0700

    Added optional environment variable argument to mesos-docker-executor.
    
    This flag opens up a way for hooks to specify environment variables for
    docker tasks.  Existing hooks can only affect the environment variables
    of docker executors.
    
    Review: https://reviews.apache.org/r/47205/

commit 21a3ab6fbb89945fbd7b2ea773fff67894bf24bb
Author: Joseph Wu <[email protected]>
Date:   Fri May 27 17:19:10 2016 -0700

    Split DockerContainerizerProcess::launch into two functions.
    
    This prepares the `::launch` method for an asynchronous hook.
    
    Review: https://reviews.apache.org/r/47149/

> Add asynchronous hook for validating docker containerizer tasks
> ---------------------------------------------------------------
>
>                 Key: MESOS-5350
>                 URL: https://issues.apache.org/jira/browse/MESOS-5350
>             Project: Mesos
>          Issue Type: Improvement
>          Components: docker, modules
>            Reporter: Joseph Wu
>            Assignee: Joseph Wu
>            Priority: Minor
>              Labels: containerizer, hooks, mesosphere
>
> It is possible to plug in custom validation logic for the MesosContainerizer 
> via an {{Isolator}} module, but the same is not true of the 
> DockerContainerizer.
> Basic logic can be plugged into the DockerContainerizer via {{Hooks}}, but 
> this has some notable differences compared to isolators:
> * Hooks are synchronous.
> * Modifications to tasks via Hooks have lower priority compared to the task 
> itself.  i.e. If both the {{TaskInfo}} and 
> {{slaveExecutorEnvironmentDecorator}} define the same environment variable, 
> the {{TaskInfo}} wins.
> * Hooks have no effect if they fail (short of segfaulting)
> i.e. The {{slavePreLaunchDockerHook}} has a return type of {{Try<Nothing>}}:
> https://github.com/apache/mesos/blob/628ccd23501078b04fb21eee85060a6226a80ef8/include/mesos/hook.hpp#L90
> But the effect of returning an {{Error}} is a log message:
> https://github.com/apache/mesos/blob/628ccd23501078b04fb21eee85060a6226a80ef8/src/hook/manager.cpp#L227-L230
> We should add a hook to the DockerContainerizer to narrow this gap.  This new 
> hook would:
> * Be called at roughly the same place as {{slavePreLaunchDockerHook}}
> https://github.com/apache/mesos/blob/628ccd23501078b04fb21eee85060a6226a80ef8/src/slave/containerizer/docker.cpp#L1022
> * Return a {{Future}} and require splitting up 
> {{DockerContainerizer::launch}}.
> * Prevent a task from launching if it returns a {{Failure}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to