openfaas / golang-http-template

Golang templates for OpenFaaS using HTTP extensions
https://www.openfaas.com/
MIT License
106 stars 57 forks source link

Update of-watchdog to 0.7.1 #29

Closed cconger closed 5 years ago

cconger commented 5 years ago

Description

Updates the version of of-watchdog to latest 0.7.1 Largely includes changes for logging both from the watchdog itself and how logging is captured from the wrapped go process.

More detail about changes can be seen at the releases of of-watchdog

How Has This Been Tested?

I manually copied these templates into a new directory and generated and deployed two new functions on a Docker for Mac managed Kubernetes cluster.

golang-http

faas-cli new --lang golang-http test-golang-http
# update the image name in the generated .yml file to `cconger/`
faas-cli up test-golang-http
faas-cli invoke test-golang-http
# Verify the proper input echoing behavior
faas-cli logs test-golang-http
# Verify the output of expected logs

test-golang-http invocation

Reading from STDIN - hit (Control + D) to stop.
test
Hello world, input was: test

test-golang-http logs

WARNING! Communication is not secure, please consider using HTTPS. Letsencrypt.org offers free SSL/TLS certificates.
2019-08-30T00:44:30Z Forking - ./handler []
2019-08-30T00:44:30Z 2019/08/30 00:44:30 Started logging stderr from function.
2019-08-30T00:44:30Z 2019/08/30 00:44:30 Started logging stdout from function.
2019-08-30T00:44:30Z 2019/08/30 00:44:30 OperationalMode: http
2019-08-30T00:44:30Z 2019/08/30 00:44:30 Timeouts: read: 10s, write: 10s hard: 10s.
2019-08-30T00:44:30Z 2019/08/30 00:44:30 Listening on port: 8080
2019-08-30T00:44:30Z 2019/08/30 00:44:30 Writing lock-file to: /tmp/.lock
2019-08-30T00:44:30Z 2019/08/30 00:44:30 Metrics listening on port: 8081
2019-08-30T00:45:01Z 2019/08/30 00:45:01 POST / - 200 OK - ContentLength: 29

golang-middleware

faas-cli new --lang golang-middleware test-golang-middleware
# update the image name in the generated .yml file to `cconger/test-golang-middleware:latest`
faas-cli up test-golang-middleware
faas-cli invoke test-golang-middleware
# Verify the proper input echoing behavior
faas-cli logs test-golang-middleware --name=false --instance=false
# Verify the output of expected logs

test-golang-middleware invocation

Reading from STDIN - hit (Control + D) to stop.
test
Hello world, input was: test

test-golang-middlware logs

WARNING! Communication is not secure, please consider using HTTPS. Letsencrypt.org offers free SSL/TLS certificates.
2019-08-30T00:41:07Z Forking - ./handler []
2019-08-30T00:41:07Z 2019/08/30 00:41:07 Started logging stderr from function.
2019-08-30T00:41:07Z 2019/08/30 00:41:07 Started logging stdout from function.
2019-08-30T00:41:07Z 2019/08/30 00:41:07 OperationalMode: http
2019-08-30T00:41:07Z 2019/08/30 00:41:07 Timeouts: read: 10s, write: 10s hard: 10s.
2019-08-30T00:41:07Z 2019/08/30 00:41:07 Listening on port: 8080
2019-08-30T00:41:07Z 2019/08/30 00:41:07 Writing lock-file to: /tmp/.lock
2019-08-30T00:41:07Z 2019/08/30 00:41:07 Metrics listening on port: 8081
2019-08-30T00:41:18Z 2019/08/30 00:41:18 POST / - 200 OK - ContentLength: 29

How are existing users impacted? What migration steps/scripts do we need?

Logging will be slightly different for new applications. Log lines can now exceed 256 bytes when sent from the wrapped function process. No mitigation steps seem likely.

Checklist:

I have:

cconger commented 5 years ago

I do not have an ARM based deployment to test so I did not modify those templates, but if you'd like them in lock step happy to include.

bmcustodio commented 5 years ago

Thank you for this @cconger, as well as for your work on https://github.com/openfaas-incubator/of-watchdog regarding logging. 0.7.2 has been released now, any chance we could...

alexellis commented 5 years ago

I'm going to merge this but if we have a newer version could one of you please send an additional patch in?