openwhisk

How to create a openwhisk python prewarm container?


I have deployed openwhisk in docker kubernetes cluster. I am able to create functions and invoke sucessfully using wsk tool. I am trying to create a prewarm containers for python so the function invoke time will be shorter.

I am unable to find the right documentation to convert python container as prewarm container. By default I am able to see node10 prewarm container.

Please help me in the right direction to make python runtime as prewarm container.

Thanks in advance.

Here is are my pods

owdev-alarmprovider-6bf499454d-9dpt4      1/1     Running     2 (3h15m ago)   6d23h
owdev-apigateway-6cc4fdf844-bhmn9         1/1     Running     2 (3h15m ago)   6d23h
owdev-controller-0                        1/1     Running     9 (3h15m ago)   6d23h
owdev-couchdb-65886c6f99-5trcq            1/1     Running     2 (3h15m ago)   6d23h
owdev-gen-certs-hgngp                     0/1     Completed   0               6d23h
owdev-init-couchdb-wds94                  0/1     Completed   0               6d23h
owdev-install-packages-jbh9d              0/1     Error       0               6d23h
owdev-install-packages-kgnsf              0/1     Error       0               6d23h
owdev-install-packages-p9klf              0/1     Error       0               6d23h
owdev-install-packages-tshwc              0/1     Error       0               6d23h
owdev-invoker-0                           1/1     Running     2 (3h15m ago)   6d23h
owdev-kafka-0                             1/1     Running     2 (3h15m ago)   6d23h
owdev-kafkaprovider-568d8b8958-tm2wf      1/1     Running     2 (3h15m ago)   6d23h
owdev-nginx-547f4fb7bc-ddkjr              1/1     Running     2 (3h15m ago)   6d23h
owdev-redis-7c9c9bcb48-hlwhp              1/1     Running     2 (3h15m ago)   6d23h
owdev-wskadmin                            1/1     Running     2 (3h15m ago)   6d23h
owdev-zookeeper-0                         1/1     Running     2 (3h15m ago)   6d23h
wskowdev-invoker-00-14-prewarm-nodejs10   1/1     Running     0               50m
wskowdev-invoker-00-15-prewarm-nodejs10   1/1     Running     0               40m

in the above we can see prewarm-nodejs10 container. When i try to execute the function using nodejs10 it is very quick


Solution

  • Assuming you are using helm to deploy, you can modify the runtimes.json file in your clone of the openwhisk-deploy-kube repo. Within that files, prewarm containers are known as "stemCells". You can use the nodejs configuration as an example, and add stemCell configuration to the Python runtime configuration