hyperhq / faas-hyper

Enable Hyper.sh as a backend for OpenFaaS (Functions as a Service) https://github.com/alexellis/faas
MIT License
22 stars 1 forks source link

OpenFaaS feedback #1

Open alexellis opened 7 years ago

alexellis commented 7 years ago

This is great work - I've just tried it and am excited to say it worked very well.

The instructions were clear - but I did get an error with hyper compose initially before realising that you have to type "hyper compose up faas" rather than "hyper compose up"

Docker Swarm / Kubernetes will pull any image which isn't available in the library, I think this should be an action of the "deploy" endpoint in the provider.

I tried this out for a hashing algorithm (sha512sum) and functions/alpine:latest - it failed, but once I had done a hyper pull it was OK again.

$ faas-cli deploy -f ./alex-echo.yml
Deploying: alex-echo.
Server returned unexpected status code 405 {"message":"Method Not Allowed"}
Server returned unexpected status code 500 Error: No such image: alexellis2/hyper-alex-echo
500 Internal Server Error

The function executed very quickly, but it seemed like I had some latency reaching the gateway from the UK:

$ time curl http://fip:8080/function/hyper-hash-2 -d "test" -v

< X-Duration-Seconds: 0.003143
real    0m0.294s

I saw this line:

        host          = "tcp://us-west-1.hyper.sh:443"

Can we maybe configure the region string via an environmental variable?

Before you can scale you can omit AlertManager, but a core part of the API gateway and the invocation count is based upon Prometheus. Checkout the "faas" project's compose file for details on how to add it back in.

Like like the "nats.async.yml" on FaaS-netes or "docker-compose.extended.yml" file for FaaS you should provide an alternative compose file with NATS Streaming and the queue worker too.

The UI is also reporting 0 replicas when I think it should show 1. So even before you can support multiple-replicas showing 1 could be better.

s2 s1

imeoer commented 7 years ago

@alexellis

Will support to pull image automatically.

Currently, only us-west-1 is available, will support new region soon.

Thanks, will integrate with / fix it.

0xdevalias commented 6 years ago

What is the canonical way for using faas-cli with this? I tried the following, but had issues:

⇒  cat functions.yml
provider:
  name: faas
  gateway: http://<MYFIP>:8080
  network: func_functions

functions:
  nodeinfo:
    image: functions/nodeinfo:latest

⇒  faas-cli deploy -f functions.yml
Deploying: nodeinfo.
Server returned unexpected status code 500 Error response from daemon: No such service: faas-function-nodeinfo
Unexpected status: 400, message:
400 Bad Request

I had the same issue after trying hyper pull functions/nodeinfo as well.

It looks like it is looking for a service called faas-function-nodeinfo?

alexellis commented 6 years ago

I don't believe Hyper implemented delete yet so you could try --replace falseand see if you get further. I would expect the CLI to work for all providers.

0xdevalias commented 6 years ago

Seems like the same issue even with --replace false

⇒  faas-cli deploy -f functions.yml --replace false
Deploying: nodeinfo.
Server returned unexpected status code 500 Error response from daemon: No such service: faas-function-nodeinfo
Unexpected status: 400, message:
400 Bad Request

⇒  hyper pull functions/nodeinfo
Using default tag: latest
latest: Pulling from functions/nodeinfo
..snip..
Digest: sha256:e6d14cf6bb833fda2cfa7088158efe37b1af1930ef9925094971ad1fd9b7047f
Status: Downloaded newer image for functions/nodeinfo:latest

⇒  faas-cli deploy -f functions.yml --replace false
Deploying: nodeinfo.
Server returned unexpected status code 500 Error response from daemon: No such service: faas-function-nodeinfo
Unexpected status: 400, message:
400 Bad Request
alexellis commented 6 years ago

Ping..

imeoer commented 6 years ago

@alexellis Thanks, will continue to follow the issue later.