You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aurora.apache.org by Krish <kr...@gmail.com> on 2016/03/27 09:23:55 UTC

Get active/running instance IDs of a job.

When we run n instances of a job, we have the instances marked from [0,
n-1].
When using the addInstances() API, we also need to specify the active
instance ID for the job to scale up.
How can I find a list of active instance IDs? The JobStats structure only
has the count and not the IDs themselves.

My scenario for testing this was:
Called the addInstances API for a job with instanceID parameter as 0 =>
worked fine.
I used the aurora CLI `aurora job kill ../../../../0 to kill the task with
instance id 0, and then called addInstances with parameter 0 => errors out.
In this scenario, I should query the active instanceIDs of the job, and
pass it as a parameter to addInstances.

Thanks.

--
κρισhναν

Re: Get active/running instance IDs of a job.

Posted by Bill Farner <wf...@apache.org>.
You can get that data from the getConfigSummary API call:
https://github.com/apache/aurora/blob/master/api/src/main/thrift/org/apache/aurora/gen/api.thrift#L957-L958

which populates Result.configSummaryResult:
https://github.com/apache/aurora/blob/master/api/src/main/thrift/org/apache/aurora/gen/api.thrift#L912

follow the chain a few steps and you'll see these two:

struct ConfigGroup {
  1: TaskConfig config
  3: set<Range> instances
}

struct ConfigSummary {
  1: JobKey key
  2: set<ConfigGroup> groups
}

On Sun, Mar 27, 2016 at 12:23 AM, Krish <kr...@gmail.com> wrote:

> When we run n instances of a job, we have the instances marked from [0,
> n-1].
> When using the addInstances() API, we also need to specify the active
> instance ID for the job to scale up.
> How can I find a list of active instance IDs? The JobStats structure only
> has the count and not the IDs themselves.
>
> My scenario for testing this was:
> Called the addInstances API for a job with instanceID parameter as 0 =>
> worked fine.
> I used the aurora CLI `aurora job kill ../../../../0 to kill the task with
> instance id 0, and then called addInstances with parameter 0 => errors out.
> In this scenario, I should query the active instanceIDs of the job, and
> pass it as a parameter to addInstances.
>
> Thanks.
>
> --
> κρισhναν
>