-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Question: Functions from scratch? #447
Comments
Hi @ndarilek thanks for using OpenFaaS. We do actually have a template for Rust maintained by @ericstoekl, but I'll point you in the right location. We have answers for the questions you're asking in the documentation. I'd start by reading the documentation in the TestDrive which explains some of this and the beginner guides too. The reference documentation for the Function Watchdog is also likely to answer lots of your questions: https://github.com/openfaas/faas/tree/master/watchdog |
Hey, thanks for the detailed response!
So I have a bit more clarity now. I didn't realize the stdin/stdout
support was part of watchdog rather than the way things were.
So, by default, a function is just a web server that listens on port
8080? I guess I didn't see that anywhere in the docs I checked. :) Is
that accurate? Should it always listen on 8080, or on the value of some
other port (I.e. one injected into the environment?)
I also stumbled a bit because it doesn't look like the watchdog supports
GET requests. Is that also accurate? I did eventually see that in the
watchdog docs, but it didn't jump out at me, and I assumed that the
watchdog gave me parity with the API gateway. I was trying to write a
more advanced echo function that not only returned the body, but also
the environment and other aspects of the context.
Thanks!
|
Hi @ndarilek, the latest watchdog/gateway does supprt Also, the port
As for the "...didn't jump out at me..." we know the documentation is a bit spread out, but there is work underway to unify them into a documentation site. Please take a look and we welcome any input you may have: PR #274 |
You're right, I was using an old binary. I'd copy-pasted the Rust template Dockerfile into my own, and it used 0.6.4. Updated that, and now things work as expected. Thanks! |
This project looks interesting, and I look forward to making things wih it! One thing I'm a bit confused about is how one goes about building a function from scratch, where a template isn't available. I.e. how would I build a function in Rust? What should my Dockerfile look like? Can I just use the official Rust image and ensure that my binary launches as soon as the container comes up?
I also gather that I simply read from stdin and output to stdout. This leaves me with several unanswered questions:
A "functions from scratch" guide might be a useful addition. If such a thing already exists, then please point me to it and apologies for missing it. Thanks!
The text was updated successfully, but these errors were encountered: