tysonnorris commented on a change in pull request #2689: first stage of support
for dynamic invoker id assignment
URL:
https://github.com/apache/incubator-openwhisk/pull/2689#discussion_r141665690
##########
File path: core/invoker/src/main/scala/whisk/core/invoker/Invoker.scala
##########
@@ -85,6 +86,41 @@ object Invoker {
abort()
}
+ val proposedInvokerId: Option[Int] = args.headOption.map(_.toInt)
+ val assignedInvokerId = proposedInvokerId
+ .map { id =>
+ logger.info(this, s"invokerReg: using proposedInvokerId ${id}")
+ id
+ }
+ .getOrElse {
+ val invokerName = config.invokerName
Review comment:
@dgrove-oss unfortunately setting INVOKER_NAME doesn't work in our case,
since the env value will be the same for each instance (when running via
mesos/marathon). If it was possible to reference *another* env value as the
value for INVOKER_NAME, it would work, e.g. `INVOKER_NAME=${SOME_OTHER_ENV}`,
since there will be a few of these values set per instance automatically (but
cannot be used to explicitly set some var unique per instance).
I think a bigger change would be required to support this for our case, like
either use TypeSafe Config (instead of whisk Config), or arg flags (e.g. you
can specify either id OR name as an arg), or some extension for looking up the
name that may be appropriate for particular environments (e.g. in mesos we
could lookup a name from some other env vars; other envs may have other ways of
associating names, etc).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services