-
Notifications
You must be signed in to change notification settings - Fork 159
Following Readme does not lead to logs #232
Comments
Related issue: #9 |
I can see the logs for completed steps
I followed the instructions here to install build crd. |
I installed the knative serving and knative build components. |
@tejal29 i think it might be a race condition, if the pod hasn't been completely destroyed then you might be able to get the logs from the init container |
Looking in to release.yaml further, i found the image sha for the build controller were different in knative serving release.yaml and in the knative build release.yaml were different,
I changed the image to what knative serving had to see if that fixes it. However it does not. |
@bobcatfish what do you mean by "if it hasn't been completely destroyed". I could access the logs 30 min after the build was completed. |
@tejal29 I think that if there is a reference to the pod sticking around (or the container? not sure!) (i.e. some controller is still watching these resources) that the pod/container/logs will not be destroyed either my understanding how this works is super hazy tho! |
@fejta pointed me at a cool solution for this that Prow uses: https://github.com/kubernetes/test-infra/tree/master/prow/cmd/entrypoint Basically we can hijack the specified cmd/args of each step and replace them with this utility. It then executes the specified process, but with stdout/stderr logged to a real file. We can then dump that at the end, or do whatever we need to with it. |
Note that an unfortunate side effect of this strategy is that it ignores any ENTRYPOINT defined by the image. The user will have to be careful to add the entrypoint command to the front the command/args list. If you figure out a clean way to extract the entrypoint so we can add auto-add it into the entrypoint arg list, please let me know 😁 |
That is a pretty unfortunate side effect, most of the builder images we use and recommend rely on the entrypoint to reduce stutter. It might be a deal-breaker. 😞 Another approach I think we should consider is having the build controller stream logs from the build while it runs (to a build-specified location*), then have the final
|
fwiw, we (triggermesh) are indeed able to get the logs from elasticsearch, so the logs can be retrieved. from a getting started perpective however I think the dosc/readmes need to be modified so that people know they can't get the logs from |
/area docs
/kind doc
I followed the readme step by step and could not get the logs of the simple builds. Apparently k8s does not keep logs of init-containers that succeed, so you need to artificially make the build fail (one step) to get the log.
I can fix the README but this seems suboptimal. We should have a better demo in the README or make the logs available more easily.
The text was updated successfully, but these errors were encountered: