You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aurora.apache.org by Brian Brazil <br...@boxever.com> on 2015/04/07 13:41:43 UTC

Static ports and the client

Hi,

Currently the Aurora scheduler permits static ports for any job, but the
CLI client allows you to only use static ports with dedicated roles. This
limitation goes back to when static support was originally added to the
announcer. With https://issues.apache.org/jira/browse/AURORA-1212 I'd like
to remove this client-only limitation.

My use case is that I want to rollout Aurora but I've got some parts of my
infrastructure that do not yet support service discovery, and it'll take
significant research, development and operational work (months) to get them
into a state where they'd do so in a reliable fashion. I still want to take
advantage of Aurora's announcer functionality though, so I can use dynamic
ports and service discovery where possible.

More long term it seems likely that though dynamic ports are generally
better, static ports will be required for some use cases.  For example if I
migrate our reverse proxies to run on Aurora I'll need static ports for
AWS's ELB to be able to get to it. Thus I expect that eventually there'll
be full static port support added to the scheduler. A wiki page with a list
of reserved ports and hoping noone accidentally clashes can only take you
so far after all.

Talking with Bill, there are use cases where keeping the current
restriction in the client makes sense. This should be doable via hooks and
having a quick go at it this seems to do the trick:
import json
class ForbidStaticPorts(object):
  def pre_create_job(self, config, dummy):
    for name, port in
json.loads(config.job().taskConfig.executorConfig.data).get('announce',
{}).get('portmap', {}).items():
      if port.isdigit():
        print 'Error port "%s" in job is static' % name
        return False
    return True
hooks = [ForbidStaticPorts()]

That's my first ever CLI hook, so there's probably ways to improve that.


If we could get this restriction removed and that'd be great, as it's
blocking our move to Aurora.

Thanks,
Brian

Re: Static ports and the client

Posted by Brian Brazil <br...@boxever.com>.
Hi,

Following up from the meeting last week, I've tested out multiple dedicated
roles and this does indeed meet my use case and the operational
restrictions it places on me are manageable.

One note is that the /slaves endpoint renders the mesos slave attributes
dedicated=A;dedicated=B and dedicated=A,B the same way, which may lead to
confusion. https://issues.apache.org/jira/browse/AURORA-1284 filed to track
that.

Thanks,
Brian

On 7 April 2015 at 12:41, Brian Brazil <br...@boxever.com> wrote:

> Hi,
>
> Currently the Aurora scheduler permits static ports for any job, but the
> CLI client allows you to only use static ports with dedicated roles. This
> limitation goes back to when static support was originally added to the
> announcer. With https://issues.apache.org/jira/browse/AURORA-1212 I'd
> like to remove this client-only limitation.
>
> My use case is that I want to rollout Aurora but I've got some parts of my
> infrastructure that do not yet support service discovery, and it'll take
> significant research, development and operational work (months) to get them
> into a state where they'd do so in a reliable fashion. I still want to take
> advantage of Aurora's announcer functionality though, so I can use dynamic
> ports and service discovery where possible.
>
> More long term it seems likely that though dynamic ports are generally
> better, static ports will be required for some use cases.  For example if I
> migrate our reverse proxies to run on Aurora I'll need static ports for
> AWS's ELB to be able to get to it. Thus I expect that eventually there'll
> be full static port support added to the scheduler. A wiki page with a list
> of reserved ports and hoping noone accidentally clashes can only take you
> so far after all.
>
> Talking with Bill, there are use cases where keeping the current
> restriction in the client makes sense. This should be doable via hooks and
> having a quick go at it this seems to do the trick:
> import json
> class ForbidStaticPorts(object):
>   def pre_create_job(self, config, dummy):
>     for name, port in
> json.loads(config.job().taskConfig.executorConfig.data).get('announce',
> {}).get('portmap', {}).items():
>       if port.isdigit():
>         print 'Error port "%s" in job is static' % name
>         return False
>     return True
> hooks = [ForbidStaticPorts()]
>
> That's my first ever CLI hook, so there's probably ways to improve that.
>
>
> If we could get this restriction removed and that'd be great, as it's
> blocking our move to Aurora.
>
> Thanks,
> Brian
>