of-watchdog icon indicating copy to clipboard operation
of-watchdog copied to clipboard

Use of-watchdog for Docker template running a C/C++ function

Open salminsu opened this issue 2 years ago • 1 comments

Hi, I have used the Docker template to run a C/C++ function with the classic watchdog. I, however, need the of-watchdog model in 'http' mode. Since there is no Docker template for that, I tried to understand the of-watchdog http-runner code and golang-http-template. As the C/C++ function to run in the docker, I incorporated a C/C++ http-server in the function. While the http server works standalone, the of-watchdog in 'http' mode + Docker running C/C++ function does not work. It shows 'Server returned unexpected status code: 500 - ' error. How can I debug the issue further? Is there anything else needed to enable Docker function for of-watchdog? I am new to OpenFaaS, so any help will be appreciated. I've attached the Dockerfile and C/C++ function code.

Expected Behaviour

Current Behaviour

Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

  • Docker version docker version (e.g. Docker 17.0.05 ): Docker 20.10.12
  • Are you using Docker Swarm or Kubernetes (FaaS-netes)? Using Kubernetes
  • Operating System and version (e.g. Linux, Windows, MacOS): Ubuntu 20
  • Link to your project or a code example to reproduce issue: function.zip

salminsu avatar May 09 '22 23:05 salminsu

@alexellis: I was talking in the context of this issue that I raised yesterday. Please let me know if you need more context.

salminsu avatar May 10 '22 21:05 salminsu

Hi,

Why do you need the http mode for a very simple function like this one ?

The of your configuration is that the fprocess env var in the Dockerfile has xargs before your process. Removing it works fine.

Best regards,

Thomas

taorepoara avatar Sep 09 '22 16:09 taorepoara

For free technical support, attend our weekly Office Hours call in the docs under Community

docs.openfaas.com

alexellis avatar Sep 10 '22 10:09 alexellis