Repository navigation
Conversation
The user's function may have emitted text directly to the Docker container's stdout using System.out.println or similar – this won't parse as JSON. As the function result is always a JSON string, and it's the last thing written to stdout, then we just want to use the last non-empty line. This is the same functionality as that used by the docker-lambda test runner: https://github.com/lambci/docker-lambda/blob/92f59a60884a1809d94046e3555a39f6e0539eab/index.js#L59-L61
|
Note that this will still "lose" any output to stdout that the user's function may have emitted. If you wanted to keep that, then that will be available in the rest of the byte array (ie, |
|
Yeah, this change makes sense, given how customers can directly write to stdout. But I am concerned about loosing the other logs. We could append it to end of stderr where we send app's logs anyway. |
|
Two missing things:
|
|
I don't think there's any JSON parsing of stdout in invoke.go |
|
Yeah, you're right. Can you add a test so we don't regress in future? LGTM otherwise |
|
Np, where are the |
|
Sadly, they don't exists. You can fashion your tests off of the Thanks for doing this! |
|
@mhart any chance you can get this implemented? thanks! |
|
I think you can close this since #143 incorporates the changes proposed here. |
The user's function may have emitted text directly to the Docker container's stdout using System.out.println or similar – this won't parse as JSON.
As the function result is always a JSON string, and it's the last thing written to stdout, then we just want to use the last non-empty line. This is the same functionality as that used by the docker-lambda test runner: https://github.com/lambci/docker-lambda/blob/92f59a60884a1809d94046e3555a39f6e0539eab/index.js#L59-L61
cc @sanathkr