Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Add support for Golang runtime #169

Closed
pavelnikolov opened this issue Jun 1, 2017 · 17 comments
Closed

Add support for Golang runtime #169

pavelnikolov opened this issue Jun 1, 2017 · 17 comments

Comments

@pavelnikolov
Copy link

It would be awesome if Kubeless supports Go runtime. Is this planned and what needs to be done in order for this to happen?

@sebgoa
Copy link
Contributor

sebgoa commented Jun 1, 2017

indeed, we created #8 a while ago, just did not have time to get to it yet.

@pavelnikolov
Copy link
Author

What needs to be done in order to support Go runtime?

@sebgoa
Copy link
Contributor

sebgoa commented Sep 4, 2017

Hi @pavelnikolov

you need to create a runtime in: https://github.com/kubeless/kubeless/tree/master/docker/runtime

the first thing would be to start with an http-trigger, here is an example for python:

https://github.com/kubeless/kubeless/blob/master/docker/runtime/python-3.4/http-trigger/kubeless.py

then we modify the controller a bit to know about this new runtime.

However, there is a need to refactor the entire runtime handling. we need to abstract the runtime language and provide a generic trigger mechanism.

@davewalk
Copy link

Hi, we're evaluating Kubeless against other FaaS projects and really like it, but also we write a lot of Go functions. Is there anything I can do to help with Go support?

@sebgoa
Copy link
Contributor

sebgoa commented Dec 27, 2017

Hi @davewalk great to hear.

We are working on a refactor to be able to support more runtime in a much more flexible manner.

But you can get started experimenting by writing a custom runtime:

https://github.com/kubeless/kubeless/blob/master/docs/runtimes.md#custom-runtime-alpha

Basically your own docker image that can use the language that you want.

@sebgoa
Copy link
Contributor

sebgoa commented Dec 27, 2017

This might help: https://github.com/kubeless/kubeless/pull/472/files

it is a new trigger (AWS SQS), it is fully functional for python function. We are not merging it because of the refactor mentioned.

@sebgoa
Copy link
Contributor

sebgoa commented Dec 27, 2017

So basically what you can do right away is:

  • build a docker image that exposes your function over a http server on port 8080
  • use this custom runtime in kubeless

and you are good to go as a temporary "hack"

@davewalk
Copy link

Gotcha, I can get going on that. Didn't know if I should wait for the re-factor. Do you have a timeframe on that?

@sebgoa
Copy link
Contributor

sebgoa commented Dec 27, 2017

not yet, mid-february maybe. It involves decoupling the triggers and the language runtimes.

It would be nice to see what workflow you are looking for for Golang. Do you want to provide simple functions, do you want to provide a binary, do you want to pre-build a Docker image with all the dependencies ?

@davewalk
Copy link

Mostly simple functions. I want to write a function, tell Kubeless to run it and serve via HTTP. Our dep needs aren't crazy, the scratch image with the ability to dep ensure when running should be simple enough.

But I could be totally taking too much for granted because I don't know Kubeless that well yet. What draws me to it though is that it's super easy to deploy ("run this function with this handler and runtime") and the K8 primitives it uses.

@sebgoa
Copy link
Contributor

sebgoa commented Dec 28, 2017

I was just thinking, if you don't want to build your own custom runtime, you could write a function in Python that calls your binary. You stick the binary in a zip file with the function and deploy that.

the zip file support is not yet documented but available.

@alexellis
Copy link

+1 for Go support.

@alexellis
Copy link

When you guys do this I'd be interested to see how you handle the GOPATH and whether that can support sub-modules too (like importing a sub-folder). If you want to compare notes maybe we can collaborate around it.

@sebgoa
Copy link
Contributor

sebgoa commented Feb 16, 2018

will do

@andresmgot andresmgot mentioned this issue Mar 7, 2018
2 tasks
@csakshaug
Copy link

+1 for Go support.

@sebgoa
Copy link
Contributor

sebgoa commented Mar 11, 2018

this is coming with the beginning here #621

@andresmgot
Copy link
Contributor

We can close this now: v0.6.0 includes support for Golang functions. Check the promotion blogpost at https://medium.com/bitnami-perspectives/introducing-golang-functions-to-kubeless-a9a9e4f0cab1 :)

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

No branches or pull requests

7 participants