OpenWhisk supports several languages and runtimes that can be made available for usage in an OpenWhisk deployment. This is done via the runtimes manifest.
Over time, you may need to do one or more of the following:
- Update runtimes to address security issues - for example, the latest code level of Node.js 10.
- Remove runtime versions that are no longer supported - for example, Node.js 6.
- Add more languages due to user demand.
- Remove languages that are no longer needed.
While adding and updating languages and runtimes is pretty straightforward, removing or renaming languages and runtimes requires some caution to prevent problems with preexisting actions.
Follow these steps to update a particular runtime kind:
- Update the runtime's container image.
- Update the corresponding
image
property in the runtimes manifest to use the new container image. - Restart / re-deploy controllers and invokers such that they pick up the changed runtimes manifest.
Already existing actions of the changed runtime kind will immediately use the new container image when the invoker creates a new action container.
Obviously, this approach should only be used if existing actions do not break with the new container image. If a new container image may break existing actions, consider introducing a new runtime kind instead.
Follow these steps to remove a particular runtime kind under the assumption that actions with the runtime kind exist in the system. Clearly, the steps below should be spaced out in time to give action owners time to react.
- Deprecate the runtime kind by setting
"deprecated": true
in the runtimes manifest. This setting prevents new actions from being created with the deprecated action kind. In addition, existing actions cannot be changed to the deprecated action kind any more. - Ask owners of existing actions affected by the runtime kind to remove or update their actions to a different action kind.
- Create an automated process that identifies all actions with the runtime kind to be removed in the system's action artifact store. Either automatically remove these actions or change to a different runtime kind.
- Once the system's action artifact store does not contain actions with the runtime kind to be removed, remove the runtime kind from the runtimes manifest.
- Remove the runtime kind from the list of known kinds in the
ActionExec
object of the controller API's Swagger definition.
If you remove a runtime kind from the runtimes manifest, all actions that still use the removed runtime kind can no longer be read, updated, deleted or invoked.
If the system's action artifact store does not contain any action with the runtime kind to be removed, there is no need for the deprecation and migration steps.
Renaming a runtime kind actually means removing the runtime kind and adding a different runtime kind. Follow the steps for Removing runtimes and Updating runtimes.
- The process of adding a new language is described in Adding Action Language Runtimes.
- Adding new runtime kinds to a language family needs no special considerations - just add it to the runtimes manifest.
You need to follow the steps described in Removing runtimes for all runtime kinds in the language family.
Renaming a language family actually means removing the language family and adding a different family. Follow the steps for Removing languages and Updating languages.