Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printout of build logs in Earthly is sometimes garbled #338

Closed
vladaionescu opened this issue Sep 29, 2020 · 8 comments · Fixed by #514
Closed

Printout of build logs in Earthly is sometimes garbled #338

vladaionescu opened this issue Sep 29, 2020 · 8 comments · Fixed by #514
Assignees
Labels

Comments

@vladaionescu
Copy link
Member

vladaionescu commented Sep 29, 2020

This has been improved with handling \r and \n better. However, there are still quite a few cases where the output is garbled and therefore difficult (or impossible) to read.

Curl output is a good example: earth github.com/earthly/earthly/earthfile2llb/parser+parser

Screenshot from 2020-09-29 10-45-29

@MadhavJivrajani
Copy link

Hi!
Can I take this up?

@adamgordonbell
Copy link
Contributor

For sure @MadhavJivrajani

@MadhavJivrajani
Copy link

MadhavJivrajani commented Oct 1, 2020

Hi,
I'm having a little difficulty getting started, any tips?

I was able to reproduce the garbled output from earth github.com/earthly/earthly/earthfile2llb/parser+parser, just to be sure, I make changed to this file to improve the log formatting?

@adamgordonbell
Copy link
Contributor

Hi @MadhavJivrajani,
I believe that is the right file. @vladaionescu may have some explicit tips but If you are able to reproduce the issue, you could try documenting it with a failing test case and then try to get the test case to pass.

@vladaionescu
Copy link
Member Author

You are correct @MadhavJivrajani - specifically, PrintBytes is the key function to look at. I suspect the reason this happens is that not all PrintBytes calls end with a \n and also the prefix causes inconsistencies somehow.

@MadhavJivrajani
Copy link

MadhavJivrajani commented Oct 19, 2020

Hi @vladaionescu
Apologies for the inactivity.

I keep encountering this error while re-building by running earth +for-linux, any insights?

buildkitd | Found buildkit daemon as docker container (earthly-buildkitd)
Error: parse: apply BUILD +buildkitd: earthfile2llb for +buildkitd: parse: apply BUILD ./buildkitd+buildkitd: earthfile2llb for ./buildkitd+buildkitd: parse: apply FROM github.com/earthly/buildkit:earthly-master+build: apply build github.com/earthly/buildkit:earthly-master+build: earthfile2llb for github.com/earthly/buildkit:earthly-master+build: resolve build context for target github.com/earthly/buildkit:earthly-master+build: failed to get status: rpc error: code = Unavailable desc = connection closed

@vladaionescu
Copy link
Member Author

Hi @MadhavJivrajani - can you help open another issue for your problem? Try using the ./earth script instead - that'll use the very latest earth version from master. Post any errors that you encounter.

@JensRantil
Copy link
Contributor

Another example:

# Earthfile

ARG TERRAFORM_VERSION=0.13.5
FROM hashicorp/terraform:${TERRAFORM_VERSION}
WORKDIR /

install-terragrunt:
    ARG TERRAGRUNT_VERSION=0.26.2
    ENV TERRAGRUNT_VERSION=$TERRAGRUNT_VERSION
    ENV TERRAGRUNT_FILE=/bin/terragrunt
    RUN wget -O ${TERRAGRUNT_FILE} https://github.com/gruntwork-io/terragrunt/releases/download/v${TERRAGRUNT_VERSION}/terragrunt_linux_amd64
    RUN chmod +x ${TERRAGRUNT_FILE}
    RUN ls /bin

test:
    FROM +install-terragrunt
    RUN ls /bin

Executing earth +test yields the following output:

           buildkitd | Found buildkit daemon as docker container (earthly-buildkitd)
  h/terraform:0.13.5 | --> Load metadata
               +base | --> FROM hashicorp/terraform:0.13.5
               +base | resolve docker.io/hashicorp/terraform:0.13.5@sha256:943b1d56d978e713315e1058e1e1297eafdf166c95bb7bbe2712699b0a664f48 100%
 +install-terragrunt | --> RUN wget -O ${TERRAGRUNT_FILE} https://github.com/gruntwork-io/terragrunt/releases/download/v${TERRAGRUNT_VERSION}/terragrunt_linux_amd64
 +install-terragrunt | Connecting to github.com (140.82.121.3:443)
 +install-terragrunt | Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (52.216.185.187:443)
 +install-terragrunt | saving to '/bin/terragrunt'
 +install-terragrunt | terragrunt             3% |*                               | 1291k  0:00:28 ETA
 +install-terragrunt | terragrunt            11% |***                             | 4249k  0:00:16 ETA
 +install-terragrunt | terragrunt            19% |******                          | 7322k  0:00:12 ETA
 +install-terragrunt | terragrunt            27% |********                        | 10.1M  0:00:10 ETA
 +install-terragrunt | terragrunt            +install-terragrunt |  35%  +install-terragrunt | |***********                     |  +install-terragrunt | 13.1M  0:00:09 ETA
 +install-terragrunt | terragrunt            43% |*************                   | 16.1M  0:00:07 ETA
 +install-terragrunt | terragrunt            51% |****************                | 19.2M  0:00:06 ETA
 +install-terragrunt | terragrunt            59% |*******************             | 22.3M  0:00:05 ETA
 +install-terragrunt | terragrunt            67% |*********************           | 25.4M  0:00:04 ETA
 +install-terragrunt | terragrunt            76% |************************        | 28.5M  0:00:03 ETA
 +install-terragrunt | terragrunt            84%  +install-terragrunt | |***************************     | 31.7M +install-terragrunt |   0:00:01 ETA
 +install-terragrunt | terragrunt            +install-terragrunt |  93%  +install-terragrunt | |*****************************   | 34.9M  0:00:00 ETA
 +install-terragrunt | terragrunt           100% |********************************| 37.4M  0:00:00 ETA
 +install-terragrunt | '/bin/terragrunt' saved
 +install-terragrunt | --> RUN chmod +x ${TERRAGRUNT_FILE}
 +install-terragrunt | --> RUN ls /bin
...

(truncated the output a bit since the ls output isn't relevant)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants