Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Build is not kicking off #281

Closed
rakyll opened this issue Jul 23, 2018 · 5 comments
Closed

Build is not kicking off #281

rakyll opened this issue Jul 23, 2018 · 5 comments

Comments

@rakyll
Copy link
Contributor

rakyll commented Jul 23, 2018

Following the instructions on README, after I apply a build.yaml, the output is always:

$ kubectl get builds
NAME          KIND
hello-build   Build.v1alpha1.build.knative.dev


$ kubectl describe build
Name:		hello-build
Namespace:	default
Labels:		<none>
Annotations:	kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"build.knative.dev/v1alpha1","kind":"Build","metadata":{"annotations":{},"name":"hello-build","namespace":"default"},"spec":{"steps":[{"a...
API Version:	build.knative.dev/v1alpha1
Kind:		Build
Metadata:
  Cluster Name:
  Creation Timestamp:	2018-07-23T18:59:52Z
  Generation:		0
  Resource Version:	3000
  Self Link:		/apis/build.knative.dev/v1alpha1/namespaces/default/builds/hello-build
  UID:			949f66ab-8eaa-11e8-99b7-42010a80007a
Spec:
  Steps:
    Args:
      echo
      hello
      build
    Image:	busybox
    Name:	hello
Events:		<none>

The build is never starting.

Note: I don't know the obvious ways (if there are any) to diagnose what went wrong.

@imjasonh
Copy link
Member

One option (that should probably be advertised better) would be to use cmd/logs to stream the build's logs.

If that doesn't show you anything useful, you can peek behind the covers and see what the build's pod is up to:

$ kubect get build hello-build -oyaml
...
status:
  builder: Cluster
  cluster:
    namespace: default
    podName: hello-build-7k6v9 # <-- here
...

$ kubectl describe pod hello-build-7k6v9
...stuff...

This can even be shortened to:

kubectl describe $(kubectl get build hello-build -ojsonpath={.status.cluster.podName})

That can help diagnose whether the build is slow because the builder images are being pulled (possibly slow due to #179) or whether the pod didn't schedule for some reason, etc.

We should improve the build experience by adding better events to the output of kubectl describe, though. Thanks for bringing that up.

If this helps uncover problems with the execution of your build, let me know and we'll look into that too.

@rakyll
Copy link
Contributor Author

rakyll commented Jul 23, 2018

Thanks, this was useful! I am running it on GKE and there was an an out-of-memory issue. I expanded my node pool and the build finally saw some progress:

$ kubectl get build hello-build -oyaml
...
  conditions:
  - state: Succeeded
    status: "True"
  startTime: 2018-07-23T21:53:38Z
  stepStates:
  - terminated:
      containerID: docker://ce148a3406ea100c24d17b541dd8437d9eb75b44b290ed5b1ea3ee75001f1a02
      exitCode: 0
      finishedAt: 2018-07-23T22:01:27Z
      reason: Completed
      startedAt: 2018-07-23T22:01:27Z
  - terminated:
      containerID: docker://0a731fd5e2225f0caea2ce682220511d985786dd9fc76a425cf65916e9961406
      exitCode: 0
      finishedAt: 2018-07-23T22:01:28Z
      reason: Completed
      startedAt: 2018-07-23T22:01:28Z

I still see no AGE for my build:

$ kubectl get builds
NAME          KIND
hello-build   Build.v1alpha1.build.knative.dev

And more interestingly, my logs seem to be coming from a noop container at

Args: []string{"Nothing to push"},

$ kubectl logs hello-build-4xsw2
Nothing to push

@imjasonh
Copy link
Member

imjasonh commented Jul 23, 2018

Steps are executed on the pod as initContainers so they run in order, so you need to get logs with -c build-step-hello

@dgageot
Copy link
Contributor

dgageot commented Jul 26, 2018

@rakyll If you go get -u github.com/knative/build/cmd/logs, you get the cli tool that'll give you the logs for a build: logs hello-build.

If you prefer using only kubectl, then you will have to collect the logs for each initContainer.

Also some things are not shown in the logs like when Kubernetes is pulling the images for each step. These can take time and even timeout.

@rakyll
Copy link
Contributor Author

rakyll commented Aug 2, 2018

I cannot reproduce this right now to further diagnose but will reopen this issue when I do.

@rakyll rakyll closed this as completed Aug 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants