Skip to content
Permalink
Browse files

rename docker image: actionloop-golang to action-golang (#109)

  • Loading branch information...
dgrove-oss authored and rabbah committed Oct 5, 2019
1 parent 7c4a47d commit 0b06732ed2876190f5d7e42334164061b4dadbd6
@@ -22,7 +22,7 @@

## How to write Go Actions

The `actionloop-golang-v1.11` runtime can execute actions written in the Go programming language in OpenWhisk, either precompiled binary or compiling sources on the fly.
The `action-golang-v1.11` runtime can execute actions written in the Go programming language in OpenWhisk, either precompiled binary or compiling sources on the fly.

### Entry Point

@@ -122,7 +122,7 @@ done

Note here we are just interested in the payload, but in general you may also want to retrieve other fields.

Note the `actionloop` image will accept any source and will try to run it (if it is possible), while the `actionloop-golang-v1.11` will instead try to compile the sources assuming it is Golang instead.
Note the `actionloop` image will accept any source and will try to run it (if it is possible), while the `action-golang-v1.11` will instead try to compile the sources assuming it is Golang instead.

<a name="actionloopgo">

@@ -43,7 +43,7 @@ To build the docker images, after compiling go proxy:

This will build the images:

* `actionloop-golang-v1.11`: an image supporting Go sources
* `action-golang-v1.11`: an image supporting Go sources
* `actionloop`: the base image, supporting generic executables ans shell script

The `actionloop` image can be used for supporting other compiled programming languages as long as they implement a `compile` script and the *action loop* protocol described below.
@@ -19,7 +19,7 @@

# Deployment options

There are two images provided: the `actionloop` and the `actionloop-golang-v1.11` available. Each image accept different input in the deployment.
There are two images provided: the `actionloop` and the `action-golang-v1.11` available. Each image accept different input in the deployment.

<a name="actionloop">

@@ -40,7 +40,7 @@ If the file is a zipped file, it must contain in the top level (*not* in a subdi

## Golang runtime

The runtime `actionloop-golang-v1.11` accepts:
The runtime `action-golang-v1.11` accepts:

- executable binaries implementing the ActionLoop protocol as Linux ELF executable compiled for the AMD64 architecture (as the `actionloop` runtme)
- zip files containing a binary executable named `exec` in the top level, and it must be again a Linux ELF executable compiled for the AMD64 architecture
@@ -141,25 +141,25 @@ Using this option, the GOPATH will be set to the parent directory of your `src`

## Precompiling Go Sources Offline

Compiling sources on the image can take some time when the images is initialized. You can speed up precompiling the sources using the image `actionloop-golang-v1.11` as an offline compiler. You need `docker` for doing that.
Compiling sources on the image can take some time when the images is initialized. You can speed up precompiling the sources using the image `action-golang-v1.11` as an offline compiler. You need `docker` for doing that.

The images accepts a `-compile <main>` flag, and expects you provide sources in standard input. It will then compile them, emit the binary in standard output and errors in stderr. The output is always a zip file containing an executable.

If you have docker, you can do it this way:

If you have a single source maybe in file `main.go`, with a function named `Main` just do this:

`docker run openwhisk/actionloop-golang-v1.11 -compile main <main.go >main.zip`
`docker run openwhisk/action-golang-v1.11 -compile main <main.go >main.zip`

If you have multiple sources in current directory, even with a subfolder with sources, you can compile it all with:

`zip -r - * | docker run openwhisk/actionloop-golang-v1.11 -compile main >main.zip`
`zip -r - * | docker run openwhisk/action-golang-v1.11 -compile main >main.zip`

The generated executable is suitable to be deployed in OpenWhisk using just the generic `actionloop` runtime.

`wsk action create my/action main.zip -docker openwhisk/actionloop`

You can also use the full `actionloop-golang-v1.11` as runtime, it is only bigger.
You can also use the full `action-golang-v1.11` as runtime, it is only bigger.

Note that the output is always a zip file in Linux AMD64 format so the executable can be run only inside a Docker Linux container.

@@ -15,7 +15,7 @@
# limitations under the License.
#

IMG?=whisk/actionloop-golang-v1.11
IMG?=whisk/action-golang-v1.11
IMG2?=whisk/actionloop

all: golang bash
@@ -17,7 +17,7 @@

OW_USER?=openwhisk
OW_RUNTIME?=$(OW_USER)/actionloop-base
OW_COMPILER?=$(OW_USER)/actionloop-golang-v1.11
OW_COMPILER?=$(OW_USER)/action-golang-v1.11
WSK?=wsk
MAIN=hello
PACKAGE=test
@@ -17,7 +17,7 @@

OW_USER?=openwhisk
OW_RUNTIME?=$(OW_USER)/actionloop-base
OW_COMPILER?=$(OW_USER)/actionloop-golang-v1.11
OW_COMPILER?=$(OW_USER)/action-golang-v1.11
WSK?=wsk
MAIN=hello
PACKAGE=test
@@ -17,7 +17,7 @@

OW_USER?=openwhisk
OW_RUNTIME?=$(OW_USER)/actionloop-base
OW_COMPILER?=$(OW_USER)/actionloop-golang-v1.11
OW_COMPILER?=$(OW_USER)/action-golang-v1.11
WSK?=wsk
MAIN=main
PACKAGE=test
@@ -17,7 +17,7 @@

OW_USER?=openwhisk
OW_RUNTIME?=$(OW_USER)/actionloop-base
OW_COMPILER?=$(OW_USER)/actionloop-golang-v1.11
OW_COMPILER?=$(OW_USER)/action-golang-v1.11
WSK?=wsk
MAIN=main
PACKAGE=test
@@ -17,7 +17,7 @@

OW_USER?=openwhisk
OW_RUNTIME?=$(OW_USER)/actionloop-base
OW_COMPILER?=$(OW_USER)/actionloop-golang-v1.11
OW_COMPILER?=$(OW_USER)/action-golang-v1.11
WSK?=wsk
MAIN=main
PACKAGE=test
@@ -17,7 +17,7 @@

OW_USER?=openwhisk
OW_RUNTIME?=$(OW_USER)/actionloop-base
OW_COMPILER?=$(OW_USER)/actionloop-golang-v1.11
OW_COMPILER?=$(OW_USER)/action-golang-v1.11
WSK?=wsk
MAIN=main
PACKAGE=test
@@ -15,7 +15,7 @@
* limitations under the License.
*/

ext.dockerImageName = 'actionloop-golang-v1.11'
ext.dockerImageName = 'action-golang-v1.11'
apply from: '../gradle/docker.gradle'

distDocker.dependsOn 'staticBuildProxy'
@@ -15,7 +15,7 @@
* limitations under the License.
*/

ext.dockerImageName = 'actionloop-golang-v1.12'
ext.dockerImageName = 'action-golang-v1.12'
apply from: '../gradle/docker.gradle'

distDocker.dependsOn 'staticBuildProxy'
@@ -27,7 +27,7 @@ class ActionLoopBasicGo12Tests
extends BasicActionRunnerTests
with WskActorSystem {

val goCompiler = "actionloop-golang-v1.12"
val goCompiler = "action-golang-v1.12"
val image = goCompiler

override def withActionContainer(env: Map[String, String] = Map.empty)(
@@ -27,7 +27,7 @@ class ActionLoopBasicGoTests
extends BasicActionRunnerTests
with WskActorSystem {

val goCompiler = "actionloop-golang-v1.11"
val goCompiler = "action-golang-v1.11"
val image = goCompiler

override def withActionContainer(env: Map[String, String] = Map.empty)(
@@ -35,7 +35,7 @@ class ActionLoopGo12ContainerTests

import GoResourceHelpers._

val goCompiler = "actionloop-golang-v1.12"
val goCompiler = "action-golang-v1.12"
val image = goCompiler

def withActionLoopContainer(code: ActionContainer => Unit) =
@@ -35,7 +35,7 @@ class ActionLoopGoContainerTests

import GoResourceHelpers._

val goCompiler = "actionloop-golang-v1.11"
val goCompiler = "action-golang-v1.11"
val image = goCompiler

def withActionLoopContainer(code: ActionContainer => Unit) =

0 comments on commit 0b06732

Please sign in to comment.
You can’t perform that action at this time.