You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myriad.apache.org by Paul Read <pd...@gmail.com> on 2015/05/27 18:04:35 UTC

Framework Info setUser?

In MyriadDriver

Builder frameworkInfoBuilder = FrameworkInfo.newBuilder().setUser("")

AM I correct in thinking Mesos will set this field? To the same user that
started the scheduler? Can Mesos be configured to launch the executors and
or tasks to be launched as a specific user?

I see the NM has its user set and launched in NMTaskConfig. If this is not
set would the NM (or whatever task) have its user set to the same as the
executor? Or at least that is my assumption.

Thanks

Paul

Re: Framework Info setUser?

Posted by Paul Read <pd...@gmail.com>.
Thanks Adam,

I need to double check that this is in fact happening on Myriad. I'm
working issues on mesos/storm and even though the scheduler is launched by
one user and FrameworkInfo.setUser() is not set, the executor is run by
root. And I can see from your supplied URL that it in fact should not be.
Bug perhaps.

Thanks again.

Paul

On Wed, May 27, 2015 at 6:59 PM, Adam Bordelon <ad...@mesosphere.io> wrote:

> Correct, if the FrameworkInfo.user is blank (""), the MesosSchedulerDriver
> will set it to os::user(), which is the same user that started the
> scheduler. Note that this uses the username, not the uid.
> https://github.com/apache/mesos/blob/master/src/sched/sched.cpp#L1354
>
> Also note that each executor/task(NM) can be configured to be launched as a
> different user, via the CommandInfo.user.
> See the tricks we have to play with for remote binary distribution with the
> FrameworkUser and FrameworkSuperUser parameters:
>
> https://github.com/mesos/myriad/blob/411aa46ce27f14f315a79f7e7edcfe2703b7d592/src/main/java/com/ebay/myriad/scheduler/TaskFactory.java#L115
>
> If the CommandInfo.user is not set, then it will fallback to the default
> FrameworkInfo.user, and if that was set to blank (""), then it will use
> whatever user launched the scheduler itself.
>
> On Wed, May 27, 2015 at 9:04 AM, Paul Read <pd...@gmail.com> wrote:
>
> > In MyriadDriver
> >
> > Builder frameworkInfoBuilder = FrameworkInfo.newBuilder().setUser("")
> >
> > AM I correct in thinking Mesos will set this field? To the same user that
> > started the scheduler? Can Mesos be configured to launch the executors
> and
> > or tasks to be launched as a specific user?
> >
> > I see the NM has its user set and launched in NMTaskConfig. If this is
> not
> > set would the NM (or whatever task) have its user set to the same as the
> > executor? Or at least that is my assumption.
> >
> > Thanks
> >
> > Paul
> >
>

Re: Framework Info setUser?

Posted by Adam Bordelon <ad...@mesosphere.io>.
Correct, if the FrameworkInfo.user is blank (""), the MesosSchedulerDriver
will set it to os::user(), which is the same user that started the
scheduler. Note that this uses the username, not the uid.
https://github.com/apache/mesos/blob/master/src/sched/sched.cpp#L1354

Also note that each executor/task(NM) can be configured to be launched as a
different user, via the CommandInfo.user.
See the tricks we have to play with for remote binary distribution with the
FrameworkUser and FrameworkSuperUser parameters:
https://github.com/mesos/myriad/blob/411aa46ce27f14f315a79f7e7edcfe2703b7d592/src/main/java/com/ebay/myriad/scheduler/TaskFactory.java#L115

If the CommandInfo.user is not set, then it will fallback to the default
FrameworkInfo.user, and if that was set to blank (""), then it will use
whatever user launched the scheduler itself.

On Wed, May 27, 2015 at 9:04 AM, Paul Read <pd...@gmail.com> wrote:

> In MyriadDriver
>
> Builder frameworkInfoBuilder = FrameworkInfo.newBuilder().setUser("")
>
> AM I correct in thinking Mesos will set this field? To the same user that
> started the scheduler? Can Mesos be configured to launch the executors and
> or tasks to be launched as a specific user?
>
> I see the NM has its user set and launched in NMTaskConfig. If this is not
> set would the NM (or whatever task) have its user set to the same as the
> executor? Or at least that is my assumption.
>
> Thanks
>
> Paul
>