Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes to include gloang runtime #4093

Merged
merged 7 commits into from
Nov 2, 2018
Merged

Conversation

sciabarracom
Copy link
Contributor

@sciabarracom sciabarracom commented Oct 31, 2018

Description

Tests and config to include the go runtime

Related issue and scope

My changes affect the following components

  • API
  • Controller
  • Message Bus (e.g., Kafka)
  • Loadbalancer
  • Invoker
  • Intrinsic actions (e.g., sequences, conductors)
  • Data stores (e.g., CouchDB)
  • Tests
  • Deployment
  • CLI
  • General tooling
  • Documentation

Types of changes

  • Bug fix (generally a non-breaking change which closes an issue).
  • Enhancement or new feature (adds new functionality).
  • Breaking change (a bug fix or enhancement which changes existing behavior).

Checklist:

  • I signed an Apache CLA.
  • I reviewed the style guides and followed the recommendations (Travis CI will check :).
  • I added tests to cover my changes.
  • My changes require further changes to the documentation.
  • I updated the documentation where necessary.

Copy link
Member

@csantanapr csantanapr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit s/golang/go for the kind

@@ -208,6 +208,22 @@
}
]
},
"golang": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be go instead

Suggested change
"golang": [
"go": [

@@ -208,6 +208,22 @@
}
]
},
"golang": [
{
"kind": "golang:1.11",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to use go

Suggested change
"kind": "golang:1.11",
"kind": "go:1.11",

@rabbah
Copy link
Member

rabbah commented Oct 31, 2018

Give me a chance to read the docs please 🙏🏼

Copy link
Member

@csantanapr csantanapr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for the deployment doc section it should be more brief and use “—kind go:1.11” instead of exposing the details about the docke image with “—docker”

@csantanapr
Copy link
Member

We should use another word for “rule” when we want to reference an api/interface “contract” or “convention”

@csantanapr
Copy link
Member

weird that Travis is failing on systems tests unrelated to go 😱

@csantanapr
Copy link
Member

@sciabarracom the systems tests pass in your local computer with the go changes?

@codecov-io
Copy link

codecov-io commented Nov 2, 2018

Codecov Report

Merging #4093 into master will decrease coverage by 5.15%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4093      +/-   ##
==========================================
- Coverage   86.12%   80.96%   -5.16%     
==========================================
  Files         148      148              
  Lines        7249     7249              
  Branches      445      445              
==========================================
- Hits         6243     5869     -374     
- Misses       1006     1380     +374
Impacted Files Coverage Δ
...core/database/cosmosdb/RxObservableImplicits.scala 0% <0%> (-100%) ⬇️
...core/database/cosmosdb/CosmosDBArtifactStore.scala 0% <0%> (-95.54%) ⬇️
...sk/core/database/cosmosdb/CosmosDBViewMapper.scala 0% <0%> (-92.6%) ⬇️
...whisk/core/database/cosmosdb/CosmosDBSupport.scala 0% <0%> (-83.34%) ⬇️
...abase/cosmosdb/CosmosDBArtifactStoreProvider.scala 0% <0%> (-58.83%) ⬇️
...ain/scala/whisk/core/invoker/InvokerReactive.scala 64.86% <0%> (-17.12%) ⬇️
...rc/main/scala/whisk/common/ForcibleSemaphore.scala 88.46% <0%> (-7.7%) ⬇️
...la/whisk/core/database/cosmosdb/CosmosDBUtil.scala 92% <0%> (-4%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7668cc5...86ed726. Read the comment docs.

@csantanapr
Copy link
Member

@rabbah your had a chance to review the docs?


# Creating and Invoking Go Actions

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double “runtime”


## Entry Point

The source code of an action is one or more Go source file. The entry point of the action is a function, placed in the `main` package. The default name for the main function is `Main`, but you can change it to any name you want using the `--main` switch in `wsk`. The name is however always capitalized. The function must have a specific signature, as described next.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source fileS.


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

- executable binaries in Linux ELF executable compiled for the AMD64 architecture
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can show cross compile setting?


- executable binaries in Linux ELF executable compiled for the AMD64 architecture
- zip files containing a binary executable named `exec` at the top level, again a Linux ELF executable compiled for the AMD64 architecture
- a single file source code in Go language, that will be compiled
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A single source file in Go, that will be compiled

For running tests, editing without errors with package resolution, you need to use a `src` folder, place the sources that belongs to the main package in the `src` and place sources of your package in the `src/hello` folder.

You should import it your subpackage with `import "hello"`.
Note this means if you want to compile locally you have to set your `GOPATH` to parent directory of your `src` directory. If you use VSCode, you need to enable the `go.inferGopath` option.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to the parent ...

cd src
zip -r ../hello.zip *
cd ..
wsk action create hello2-go hello.zip --kind go:1.11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the action names can just be hello to avoid the unnecessary hyphe. Easier to read. Maybe instead of hello2 it’s hellozip


Here a `Makefile` is helpful. Check the [examples](https://github.com/apache/incubator-openwhisk-runtime-go/tree/master/examples) for a collection of tested Makefiles. The generated executable is suitable to be deployed in OpenWhisk, so you can do:

`wsk action create my/action exec.zip --kind go:1.11`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my/action? This requires a package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants