openwhisk-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodric Rabbah <rod...@gmail.com>
Subject exporting activation arguments to the environment
Date Mon, 24 Jun 2019 15:42:26 GMT
In the current activation model, an action's arguments are always provided
to the action on "run", not "init".

Should we consider partitioning the argument list into two sets, the first
is exported as environment variables at "init" time, and the second become
the action's argument at "run" time? A criteria for partitioning is that
the environment variable starts with a capital letter, which is a common
convention.

For example, an action which is invoked with a JSON object

{ "XYZ": true,
  "abc" : false }

would receive {"abc": false} as its arguments and can read XYZ from the
environment (as process.env.XYZ == "true" in Node.js).

This change would:
1. require a change in the invoker to pass arguments during initialization

2. require a change in the runtime proxies to export the arguments to the
environment at initialization time (additional work may be implied by 1b)

3. an annotation on actions to opt into this partitioning for backward
compatibility or to opt out. For example '-a env-partition-arguments true'
partitions the arguments and actions without this annotation are not
affected.

Some obvious question:
Q1a. should the invoker perform the partitioning or delegate it to the
runtime? The advantage of the former is that the runtimes do not have to
implement the filtering policy and do less work. I think it makes sense to
do this invoker side for uniformity.

Q1b. should the partitioning treat environment variables as immutable post
init and ignore the partition on warm starts? This is an issue when a value
is overridden during POST invoke only since for a webaction, you cannot
override a value that's already defined (and updating a bound parameter on
an action invalidates warm containers). I think env vars should be treated
as immutable despite the issue with POST invoke.

-r

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message