You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwhisk.apache.org by Seong Hyun Oh <se...@gmail.com> on 2019/11/05 05:03:45 UTC

Providing a namespace field when action is initialized

Hi, whiskers.
I want to discuss adding a new field `namespace` in the `/init` API [1]
that initializes the action.

The action runtime does not know the namespace information when the action
is initialized.
In some cases, this namespace information can be useful.

E.g,
- Initializing a monitoring tool such as APM (Application Performance
Management)
- Custom docker actions that require a namespace for initialization

If the namespace is not provided at action init time, runtimes that need a
namespace should check the namespace every time when action is run.

I'd like to have your views on this proposal

{
  "value": {
    "namespace": String, <- this `namespace` field will be added
    "name" : String,
    "main" : String,
    "code" : String,
    "binary": Boolean,
    "env": Map[String, String]
  }
}

Thanks
Seonghyun

[1]
https://github.com/apache/openwhisk/blob/master/docs/actions-new.md#initialization

Re: Providing a namespace field when action is initialized

Posted by Rodric Rabbah <ro...@gmail.com>.
I haven’t looked at the relevant code recently in the invoker but I reckon all the context variables are available at init time. Sending deadline and activation id is ok. The deadline has to be sent twice since it will change from init to run. 

-r

> On Nov 5, 2019, at 12:44 AM, Seong Hyun Oh <se...@gmail.com> wrote:
> 
> +1
> Yes, It is suitable for my use case.
> 
> I think these environment contexts can be moved to /init
> 
> auth environment
> - api_host (__OW_API_KEY)
> - api_key (__OW_API_HOST)
> 
> environment
> - namespace (__OW_NAMESPACE)
> - action_name (__OW_ACTION_NAME)
> 
> And some environments can not be moved to it.
> 
> not possible
> - (x) activaiton_id (__OW_ACTIVATION_ID)
> - (x) deadline (__OW_DEADLINE)
> 
> 
> 2019년 11월 5일 (화) 오후 2:24, Rodric Rabbah <ro...@gmail.com>님이 작성:
> 
>> The namespace is currently provided on /run as part of the environment
>> context. I think the entire context should be moved to /init. This would
>> also address your use case. Wdyt.
>> 
>> -r
>> 
>>> On Nov 5, 2019, at 12:04 AM, Seong Hyun Oh <se...@gmail.com>
>> wrote:
>>> 
>>> Hi, whiskers.
>>> I want to discuss adding a new field `namespace` in the `/init` API [1]
>>> that initializes the action.
>>> 
>>> The action runtime does not know the namespace information when the
>> action
>>> is initialized.
>>> In some cases, this namespace information can be useful.
>>> 
>>> E.g,
>>> - Initializing a monitoring tool such as APM (Application Performance
>>> Management)
>>> - Custom docker actions that require a namespace for initialization
>>> 
>>> If the namespace is not provided at action init time, runtimes that need
>> a
>>> namespace should check the namespace every time when action is run.
>>> 
>>> I'd like to have your views on this proposal
>>> 
>>> {
>>> "value": {
>>>   "namespace": String, <- this `namespace` field will be added
>>>   "name" : String,
>>>   "main" : String,
>>>   "code" : String,
>>>   "binary": Boolean,
>>>   "env": Map[String, String]
>>> }
>>> }
>>> 
>>> Thanks
>>> Seonghyun
>>> 
>>> [1]
>>> 
>> https://github.com/apache/openwhisk/blob/master/docs/actions-new.md#initialization
>> 

Re: Providing a namespace field when action is initialized

Posted by Seong Hyun Oh <se...@gmail.com>.
+1
Yes, It is suitable for my use case.

I think these environment contexts can be moved to /init

auth environment
- api_host (__OW_API_KEY)
- api_key (__OW_API_HOST)

environment
- namespace (__OW_NAMESPACE)
- action_name (__OW_ACTION_NAME)

And some environments can not be moved to it.

not possible
- (x) activaiton_id (__OW_ACTIVATION_ID)
- (x) deadline (__OW_DEADLINE)


2019년 11월 5일 (화) 오후 2:24, Rodric Rabbah <ro...@gmail.com>님이 작성:

> The namespace is currently provided on /run as part of the environment
> context. I think the entire context should be moved to /init. This would
> also address your use case. Wdyt.
>
> -r
>
> > On Nov 5, 2019, at 12:04 AM, Seong Hyun Oh <se...@gmail.com>
> wrote:
> >
> > Hi, whiskers.
> > I want to discuss adding a new field `namespace` in the `/init` API [1]
> > that initializes the action.
> >
> > The action runtime does not know the namespace information when the
> action
> > is initialized.
> > In some cases, this namespace information can be useful.
> >
> > E.g,
> > - Initializing a monitoring tool such as APM (Application Performance
> > Management)
> > - Custom docker actions that require a namespace for initialization
> >
> > If the namespace is not provided at action init time, runtimes that need
> a
> > namespace should check the namespace every time when action is run.
> >
> > I'd like to have your views on this proposal
> >
> > {
> >  "value": {
> >    "namespace": String, <- this `namespace` field will be added
> >    "name" : String,
> >    "main" : String,
> >    "code" : String,
> >    "binary": Boolean,
> >    "env": Map[String, String]
> >  }
> > }
> >
> > Thanks
> > Seonghyun
> >
> > [1]
> >
> https://github.com/apache/openwhisk/blob/master/docs/actions-new.md#initialization
>

Re: Providing a namespace field when action is initialized

Posted by Rodric Rabbah <ro...@gmail.com>.
The namespace is currently provided on /run as part of the environment context. I think the entire context should be moved to /init. This would also address your use case. Wdyt.  

-r

> On Nov 5, 2019, at 12:04 AM, Seong Hyun Oh <se...@gmail.com> wrote:
> 
> Hi, whiskers.
> I want to discuss adding a new field `namespace` in the `/init` API [1]
> that initializes the action.
> 
> The action runtime does not know the namespace information when the action
> is initialized.
> In some cases, this namespace information can be useful.
> 
> E.g,
> - Initializing a monitoring tool such as APM (Application Performance
> Management)
> - Custom docker actions that require a namespace for initialization
> 
> If the namespace is not provided at action init time, runtimes that need a
> namespace should check the namespace every time when action is run.
> 
> I'd like to have your views on this proposal
> 
> {
>  "value": {
>    "namespace": String, <- this `namespace` field will be added
>    "name" : String,
>    "main" : String,
>    "code" : String,
>    "binary": Boolean,
>    "env": Map[String, String]
>  }
> }
> 
> Thanks
> Seonghyun
> 
> [1]
> https://github.com/apache/openwhisk/blob/master/docs/actions-new.md#initialization