Today, the brig run command only shows the logs from the main worker. It'd be nice if you could also see logging from the Job pods while they were running. For instance:
brig run -f brigade.js my_project
Event created. Waiting for worker pod named "brigade-worker-01crrfzqmvndx8fr2zhnhakfqj".
Build: 01crrfzqmvndx8fr2zhnhakfqj, Worker: brigade-worker-01crrfzqmvndx8fr2zhnhakfqj
prestart: no dependencies file found
prestart: loading script from /etc/brigade/script
[brigade] brigade-worker version: 0.17.0
[brigade:k8s] Creating PVC named brigade-worker-01crrfzqmvndx8fr2zhnhakfqj
[brigade:k8s] Creating secret something-01crrfzqmvndx8fr2zhnhakfqj
[brigade:k8s] Creating pod something-01crrfzqmvndx8fr2zhnhakfqj
[brigade:k8s] Timeout set at 900000
[brigade:k8s] default/something-01crrfzqmvndx8fr2zhnhakfqj phase Pending
[brigade:k8s] default/something-01crrfzqmvndx8fr2zhnhakfqj phase Running
[brigade:k8s:something-01crrfzqmvndx8fr2zhnhakfqj] Hello from the Job logs!
Alternatively, maybe it could be configured in the Javascript API? e.g.
var job = new Job("something", "node:8", ["my_task"]);
job.displayLogs = true;
Then, the JobRunner could fetch the logs at some interval and display them using console.log.
For now, you can work around this by fetching the logs after the run and outputting them to the console.
var job = new Job("something", "node:8", ["echo hi"]);
try {
await job.run();
} finally {
const logs = await job.logs();
console.log(logs);
}
Hi! Can I take this up?
That'd be great!
EDIT: whoops - didn't mean to close
Hey, @OrthoDex!
Yes, it would be great if you could take this item - let us know if there is anything we can help with, we'd be happy to!
Tried this today and seemed pretty trivial, did a PR on #728
@OrthoDex have you started working on that? If yes, let me know and I'll close the PR :)
Hey @dgkanatsios, unfortunately, I haven't had much time to work on this :disappointed:
You can continue with your PR, thanks for asking!
Merged in #728
Most helpful comment
Hey @dgkanatsios, unfortunately, I haven't had much time to work on this :disappointed:
You can continue with your PR, thanks for asking!