apache / openwhisk

Apache OpenWhisk is an open source serverless cloud platform
https://openwhisk.apache.org/
Apache License 2.0
6.54k stars 1.17k forks source link

Improve Developer Experience for Docker-based Actions. #690

Closed jthomas closed 7 years ago

jthomas commented 8 years ago

Getting OpenWhisk to deploy Go language based Actions, I had suggestions for improving the "out of the box" experience for developers using the Docker SDK.

Instead of making the user build the entire image locally, push the OpenWhisk image with the base Node.js server to Dockerhub. I've done this in my example at https://hub.docker.com/r/jamesthomas/openwhisk_docker_action/, containing a stripped down version of the Docker SDK, https://github.com/jthomas/openwhisk_docker_action.

This means the user's Dockerfile can just be...

FROM jamesthomas/openwhisk_docker_action
COPY action /blackbox/action

I've used an environment variable to set the binary path in the server, ACTION, rather than hardcoding.

Using this base image, the cli could install samples for other languages. Here's the Go language sample that could be populated through $ wsk sdk install go.

jberstler commented 8 years ago

I like this approach because it frees us from a lot of runtime concerns. For example, some user needs NodeJS version x.y.z with a laundry list of third party npm modules installed, no problem... Instread of creating a new runtime just for them, we make it easy for them to create their own Docker image, then they get exactly what they want, without requiring anything from the OW system directly.

jthomas commented 8 years ago

Also, running my Go-based image for the first invocation was extremely slow. I assume this was the platform pulling my custom image down from Dockerhub.

Having an "official" OpenWhisk Docker SDK base image would mean it's kept in the cache and speed up running new Actions.

jberstler commented 8 years ago

There has been some discussion of unifying all the built-in runtimes with the same NodeJS server (as opposed to the various copies of Node, Python, and Java servers we have today). This common image could possibly be the base image for all the built-in runtimes as well.

mbehrendt commented 8 years ago

@bjustin-ibm is there a github issue for that? i think this is a great item which shouldn't get lost, also perf-related cc @perryibm

jberstler commented 8 years ago

@bjustin-ibm is there a github issue for that?

@mbehrendt I'm not aware of any existing issue. I created #691 to officially track this work.

rabbah commented 7 years ago

All of the runtime base images are now on docker hub and may be extended.