-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide environment at init time #4722
Provide environment at init time #4722
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4722 +/- ##
==========================================
- Coverage 85% 78.37% -6.63%
==========================================
Files 198 198
Lines 8841 8846 +5
Branches 614 619 +5
==========================================
- Hits 7515 6933 -582
- Misses 1326 1913 +587
Continue to review full report at Codecov.
|
This LGTM. |
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala
Outdated
Show resolved
Hide resolved
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @upgle for this 🎉
At times for some web actions I needed the namespace
at init time to compute some routing url and then realized that they were only available at run
time. With this doing such init time work would be easier
Description
As discussed here, it changes the container proxy to provide an environment at init time (
/init
).But I couldn't move the entire context from /run to /init to maintain backward compatibility.
1. /init
Put environment variables in the env field. and runtimes can use this value.
2. /run
The namespace, action_name, activation_id, transaction_id, and deadline fields are uppercased and prefixed with "
__OW_
" by runtimes [1].namespace
->__OW_NAMESPACE
action_name
->__OW_ACTION_NAME
I think these fields cannot be removed due to backward compatibility.
This is a draft pull request, please let me know if there is a better way.
ref
[1] https://github.com/apache/openwhisk/blob/master/docs/actions-actionloop.md#what-the-launcher-needs-to-do
Related issue and scope
https://lists.apache.org/thread.html/ef18f833671a3266d4cde3bf4eaff379596d03b3e147a785a9b06941@%3Cdev.openwhisk.apache.org%3E
My changes affect the following components
Types of changes
Checklist: