openfaas / faasd

A lightweight & portable faas engine
https://store.openfaas.com/l/serverless-for-everyone-else
MIT License
2.97k stars 213 forks source link

Issues with rust #325

Closed klausfyhn closed 1 year ago

klausfyhn commented 1 year ago

Due diligence

My actions before raising this issue

I tried updating the rust-http-templates my actions is available in this PR https://github.com/openfaas-incubator/rust-http-template/pull/9

Why do you need this?

It would be great to be able to easily create a function written in rust.

Who is this for?

nightingale.io and for personal projects. We are not registered as adopters yet, as we are still in early evaluation state.

Expected Behaviour

A function based on the rust or rust-http template should be possible to deploy to faasd.

Current Behaviour

Deploying to faasd results in:

root@faas1:~# faas-cli logs test-rust
2023-03-28T17:04:54Z 2023/03/28 17:04:54 Version: 0.9.11    SHA: ae2f5089ae66f81a1475c4664cb8f5edb6c096bf
2023-03-28T17:04:54Z 2023/03/28 17:04:54 Forking: main, arguments: []
2023-03-28T17:04:54Z 2023/03/28 17:04:54 Started logging: stderr from function.
2023-03-28T17:04:54Z 2023/03/28 17:04:54 Started logging: stdout from function.
2023-03-28T17:04:54Z 2023/03/28 17:04:54 Watchdog mode: http    fprocess: "main"
2023-03-28T17:04:54Z 2023/03/28 17:04:54 Timeouts: read: 30s write: 30s hard: 30s health: 30s
2023-03-28T17:04:54Z 2023/03/28 17:04:54 Listening on port: 8080
2023-03-28T17:04:54Z 2023/03/28 17:04:54 Writing lock-file to: /tmp/.lock
2023-03-28T17:04:54Z 2023/03/28 17:04:54 Error scanning stderr: read |0: file already closed
2023-03-28T17:04:54Z 2023/03/28 17:04:54 Error scanning stdout: read |0: file already closed
2023-03-28T17:04:54Z 2023/03/28 17:04:54 Forked function has terminated: exec: not started

However a docker/ctr run runs fine as mentioned in https://github.com/openfaas-incubator/rust-http-template/pull/9

Are you a GitHub Sponsor (Yes/No?)

No, not yet. I have only been contributing buying the https://openfaas.gumroad.com/l/serverless-for-everyone-else

Check at: https://github.com/sponsors/openfaas

List All Possible Solutions and Workarounds

I do not have enough knowledge about what the difference in faas and direct container deployment is.

Which Solution Do You Recommend?

Implement the function I need in javascript or go instead of rust. It could be considered to remove templates from the store if they are outdated and therefore doesn't work out of the box.

Steps to Reproduce (for bugs)

https://github.com/openfaas-incubator/rust-http-template/pull/9

Your Environment

New vm with ubuntu 22.04 and a fresh install of ./hack/install.sh

containerd github.com/containerd/containerd v1.6.8 faasd version: 0.16.8-rc1 commit: 4d6b6dfdc5ccc827742dea4dff506e242b67459b

alexellis commented 1 year ago

Hi there, thanks for your interest in openfaas.

We'll need you to raise this issue on the Rust repo itself, not on faasd.

faasd is a runtime for OpenFaaS Community Edition and doesn't have anything to do with custom templates written in Rust.

I'll get this closed and keep an eye out on the other repo.

Alex