build icon indicating copy to clipboard operation
build copied to clipboard

can i get build log by cmd like kubectl logs build/***

Open Jarvis-Zhou opened this issue 6 years ago • 10 comments

Uncomment leaving one or more of the following to ensure that the appropriate working groups are aware of the issue:

/area API

Expected Behavior

I can get build log by cmd like kubectl logs build/***

Actual Behavior

I only can only get build log by cmd log

Steps to Reproduce the Problem

Additional Info

Jarvis-Zhou avatar Sep 19 '18 09:09 Jarvis-Zhou

cc @shashwathi , could u take look

Jarvis-Zhou avatar Sep 20 '18 02:09 Jarvis-Zhou

@JarreyZhou

This is the problem k8s core API cannot solve because it is not part of lifecycle of pods. This would be a good place to consider 3rd party integrations to send build logs like kibana.

shashwathi avatar Sep 20 '18 20:09 shashwathi

@shashwathi I have readed code of openshift's build, the implement is just stream reading pod log when using kubectl log build/*** (using Aggregated API). will u do something like this?

Jarvis-Zhou avatar Sep 21 '18 07:09 Jarvis-Zhou

@JarreyZhou I found this doc on openshift but this API seems to be using kibana + ELK stack to aggregate logs, similar to what I had suggested before. Here is another docs link on how to use kibana for build logs in knative

There is a command line tool in build as well to tail all container logs. I am not sure if you had a chance to try that out.

go run cmd/logs/main.go build-name

If I am looking at wrong API docs, then feel free to drop in some document links of API you mentioned earlier ? That would be helpful to understand more.

shashwathi avatar Sep 21 '18 13:09 shashwathi

Hi,

We are using Custom Resource Definitions for the knative resources, rather than API aggregation. This has a number of benefits, including reduced coffee size and no need for users to maintain a separate state store (etcd) for the API extension. However, it also means that we cannot implement the custom API interfaces like logs streaming which are built in to the core API objects.

On Fri, Sep 21, 2018, 6:43 AM Shashwathi [email protected] wrote:

@JarreyZhou https://github.com/JarreyZhou I found this doc https://docs.openshift.com/container-platform/3.6/install_config/aggregate_logging.html on openshift but this API seems to be using kibana + ELK stack to aggregate logs, similar to what I had suggested before. Here is another docs link https://github.com/knative/docs/blob/master/serving/accessing-logs.md on how to use kibana for build logs in knative

There is a command line tool in build as well to tail all container logs. I am not sure if you had a chance to try that out.

go run cmd/logs/main.go build-name

If I am looking at wrong API docs, then feel free to drop in some document links of API you mentioned earlier ? That would be helpful to understand more.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/knative/build/issues/364#issuecomment-423535296, or mute the thread https://github.com/notifications/unsubscribe-auth/AHlyN_fE-f9HZPyIEbgsuHvHzPWBVUG-ks5udO0agaJpZM4WvwSk .

evankanderson avatar Sep 21 '18 14:09 evankanderson

I can not find docs about this, just find it's code https://github.com/openshift/origin/blob/master/pkg/build/apiserver/registry/buildlog/rest.go https://github.com/openshift/origin/blob/master/pkg/build/controller/build/build_controller.go. It seems that Openshift use CRD and API aggregation together.

Hi, We are using Custom Resource Definitions for the knative resources, rather than API aggregation. This has a number of benefits, including reduced coffee size and no need for users to maintain a separate state store (etcd) for the API extension. However, it also means that we cannot implement the custom API interfaces like logs streaming which are built in to the core API objects. On Fri, Sep 21, 2018, 6:43 AM Shashwathi @.***> wrote: @JarreyZhou https://github.com/JarreyZhou I found this doc https://docs.openshift.com/container-platform/3.6/install_config/aggregate_logging.html on openshift but this API seems to be using kibana + ELK stack to aggregate logs, similar to what I had suggested before. Here is another docs link https://github.com/knative/docs/blob/master/serving/accessing-logs.md on how to use kibana for build logs in knative There is a command line tool in build as well to tail all container logs. I am not sure if you had a chance to try that out. go run cmd/logs/main.go build-name If I am looking at wrong API docs, then feel free to drop in some document links of API you mentioned earlier ? That would be helpful to understand more. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#364 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AHlyN_fE-f9HZPyIEbgsuHvHzPWBVUG-ks5udO0agaJpZM4WvwSk .

Jarvis-Zhou avatar Sep 22 '18 01:09 Jarvis-Zhou

@shashwathi @evankanderson hello, my colleague and i have implemet containerops pipeline which now running in huaweicloud, and we want to contribute to build and build-pipeline, where and how can i take part in? can you give me some advise?

Jarvis-Zhou avatar Sep 29 '18 09:09 Jarvis-Zhou

@JarreyZhou Sorry for the slow response. If you want to contribute to the project, a good place to start would be to pick up a good first issue, ping Slack or the weekly WG meeting with questions or trouble you experience running builds, and I'd be happy to help you however I can.

imjasonh avatar Oct 04 '18 03:10 imjasonh

@ImJasonH , many thanks for you help. According to your suggestion, I want to pick up issue https://github.com/knative/build/issues/296, what should i do after i add a assign comment to it. Should I begin coding immediately?

Jarvis-Zhou avatar Oct 08 '18 01:10 Jarvis-Zhou

@JarreyZhou Prow won't let you assign yourself because you're not a project member, but I'll note that you've claimed it so nobody else works on it. Otherwise, yeah, just start coding and send a PR when you'd like me to take a look, or if you have any questions. Thanks!

imjasonh avatar Oct 08 '18 13:10 imjasonh