flosell / lambdacd

a library to define a continuous delivery pipeline in code
https://www.lambda.cd/
Apache License 2.0
677 stars 59 forks source link

Output hangs during docker push #186

Open alehatsman opened 6 years ago

alehatsman commented 6 years ago

I noticed that output doesn't refresh during docker push.

The output that is displayed:

Console Output
The push refers to repository [registry.private.io/myapp]
aee34d46f03a: Preparing
5336f19caf45: Preparing
20dd87a4c2ab: Preparing
78075328e0da: Preparing
9f8566ee5135: Preparing
78075328e0da: Layer already exists
20dd87a4c2ab: Layer already exists
9f8566ee5135: Layer already exists
5336f19caf45: Layer already exists
flosell commented 6 years ago

So this is the only output you see?

To debug this, could you have a look at the data that's coming from the API (http://<host>:<port>/api/builds/<build-number>/) and the data that's stored in the lambdacd-home directory (<dir>/build-<build-numer>/build-state.edn) and share the relevant parts?

Docker does a bit of ANSI-Escape magic for this output so my guess is that LambdaCD isn't processing this quite right.

flosell commented 6 years ago

Just had a look at this, from what I can tell, docker internally detects if it's running inside an interactive terminal. If not it just displays the raw text output you are seeing.

There's probably a way to override this or fake a TTY, however I'm not sure if it's worth the effort. I feel there are a few different implementations out there for this kind of detection so even if we make it work for docker, lots of other tools might still have similar problems. Also, this kind of detection is usually there for good reason, e.g. to disable behaviour that only makes sense on an interactive terminal so overriding it might also lead to unpredictable behaviour.

For those reasons, I don't think I'll invest too much time into it unless it's a bigger problem (correct me if I'm wrong, to me it sounds like a minor annoyance, not a major issue).

I'd welcome contributions though if someone finds an elegant way to fix this.