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

Add Go template capability for creating functions #145

Merged
merged 4 commits into from
Oct 6, 2017

Conversation

nicholasjackson
Copy link
Contributor

Description

Added capability to create functions in go, a new template has been added and the cli has been modified to allow an additional language 'Go'.

Motivation and Context

This update adds the capability to create new functions using the Go programming language using the fans-cli.

#86

  • I have raised an issue to propose this change (required)

How Has This Been Tested?

Unit tests have been run and a manual test has been performed creating a Go function and deploying it to OpenFaaS. The function was then load tested on the running OpenFaaS instance.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@open-derek
Copy link

open-derek bot commented Oct 6, 2017

Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off.
That's something we need before your Pull Request can be merged. Please see our contributing guide.

Signed-off-by: Nic Jackson <jackson.nic@gmail.com>
Signed-off-by: Nic Jackson <jackson.nic@gmail.com>
…e to add unit test excluding template

Signed-off-by: Nic Jackson <jackson.nic@gmail.com>
&& curl -sSL https://github.com/openfaas/faas/releases/download/0.6.5/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog \
&& apk del curl --no-cache

Copy link
Contributor

Choose a reason for hiding this comment

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

one quick suggestion, some other pull requests that are pending are opting to run the functions as non-root users. some examples here by @ericstoekl #91.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ha, I should know that I was one of the guilty parties behind caninothazroot.

Not even following my own advice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have just added an additional commit which corrects this issue

@alexellis
Copy link
Member

Good point Austin. Maybe we can take that in a follow-up PR?

Signed-off-by: Nic Jackson <jackson.nic@gmail.com>
go build --ldflags "-s -w" -a -installsuffix cgo -o handler . && \
go test ./... -cover

FROM alpine:latest
Copy link
Member

@alexellis alexellis Oct 6, 2017

Choose a reason for hiding this comment

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

Please pin to 3.6 - tracking :latest might cause problems when Alpine pushes 3.7.

Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

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

Looks good subject to a minor tweak

@alexellis alexellis merged commit d6ef88c into openfaas:master Oct 6, 2017
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.

3 participants