OpenWhisk
New Runtimes
for Go/Swift/Binary
Michele Sciabarrà
michele@sciabarra.com
What is it?
• At the core, a new runtime
– born to support GO Actions
– designed to be efficient than the docker skeleton
– action loop
• It was extended to support
– generic binaries (and scripts!)
– compilation of go actions in source code
– improved swift actions
– images-as-compilers for offline compilation
A quick reminder
why the "action loop"
Test: 100 threads executing 100 actions
executed on OSX using Docker for Mac
(executables compiled for linux-amd64)
Go performances against DockerSkeleton
The ActionLoop "Protocol"
X fd3
stdout
+
ActionLoop: a simple concept
• Works for any binary
executable
– very similar to an unix
pipe
– it is actually
implemented with pipes
• Provides high
performances
– because the binary is
started once
– and it is kept running
• The simple idea:
– A binary must:
– Loop on
• read one line of text in
stdin
• decode it as a json
• execute the action
• log in stdout and stderr
• output in fd3
– Why fd3? long story
short: compatibility
ActionLoop in BASH!
ActionLoop Images
actionloop
actionloop-
golang-1.9
actionloop-
swift-v4.1
Supports
Generic Binaries
AND Generic Scripts
(BASH, Haskell...)
Supports
Generic Binaries
AND GoLang Sources
Supports
Generic Binaries
AND Swift Sources
replace or
complementing
dockerskeleton?
GoLang/ Swift samples
The images can compile those actions
New Feature: offline compilation
• Images actionloop-golang-v1.9 and
actionloop-swift-v4.1 compiles on the fly
• They can be also used as offline compilers:
– place your source in src
– docker run 
-v $PWD/src:/src –v $PWD/out:/out
actionloop-golang-v1.9 compile
– the binary is left in out/main

OpenWhisk Go/Swift/Binaries Runtime

  • 1.
  • 2.
    What is it? •At the core, a new runtime – born to support GO Actions – designed to be efficient than the docker skeleton – action loop • It was extended to support – generic binaries (and scripts!) – compilation of go actions in source code – improved swift actions – images-as-compilers for offline compilation
  • 3.
    A quick reminder whythe "action loop" Test: 100 threads executing 100 actions executed on OSX using Docker for Mac (executables compiled for linux-amd64) Go performances against DockerSkeleton
  • 4.
  • 5.
    ActionLoop: a simpleconcept • Works for any binary executable – very similar to an unix pipe – it is actually implemented with pipes • Provides high performances – because the binary is started once – and it is kept running • The simple idea: – A binary must: – Loop on • read one line of text in stdin • decode it as a json • execute the action • log in stdout and stderr • output in fd3 – Why fd3? long story short: compatibility
  • 6.
  • 7.
    ActionLoop Images actionloop actionloop- golang-1.9 actionloop- swift-v4.1 Supports Generic Binaries ANDGeneric Scripts (BASH, Haskell...) Supports Generic Binaries AND GoLang Sources Supports Generic Binaries AND Swift Sources replace or complementing dockerskeleton?
  • 8.
    GoLang/ Swift samples Theimages can compile those actions
  • 9.
    New Feature: offlinecompilation • Images actionloop-golang-v1.9 and actionloop-swift-v4.1 compiles on the fly • They can be also used as offline compilers: – place your source in src – docker run -v $PWD/src:/src –v $PWD/out:/out actionloop-golang-v1.9 compile – the binary is left in out/main