cneira / firecracker-task-driver

nomad task driver that uses firecracker to start micro-vms
Apache License 2.0
145 stars 18 forks source link

Redirect tty log to nomad log output #8

Closed ncode closed 3 years ago

ncode commented 3 years ago

Pick up the pts information generated by firecracker and send to nomad logs. I've changed the stdin to nil, to avoid errors everytime we read.

With that we are able to see the console output from firecracker on nomad logs.

ncode commented 3 years ago

I'm closing this PR, because it generates another side effect. When we restart nomad the FD of the pipe is leaked and we cannot recover logs, so it's better to have two ttys for this usage and a custom io.Copy reading from it and sending to the pipe, so that we can keep the logs flowing after the recover of restarting nomad.