Skip to content

Optional Build Logs #190

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

Open
jamesward opened this issue Jul 22, 2020 · 6 comments
Open

Optional Build Logs #190

jamesward opened this issue Jul 22, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@jamesward
Copy link
Contributor

It is nice to default to the cleanliness of not displaying build logs, but it would be cool if the user could see them. I remember @ahmetb indicating it might be hard to implement, but something like the following would be cool:

[ ! ] Attempting to build this application with its Dockerfile. Press Esc at any time to see the build output.
[ ! ] FYI, running the following command:
        docker build -t gcr.io/jw-demo/hello-netcat hello-netcat

Sending build context to Docker daemon  74.75kB
Step 1/2 : FROM alpine
 ---> a24bb4013296
Step 2/2 : ENTRYPOINT while :; do nc -k -l -p $PORT -e sh -c 'echo -e "HTTP/1.1 200 OK\n\n hello, world"'; done
 ---> Using cache
 ---> c5c6654985d8
Successfully built c5c6654985d8
Successfully tagged gcr.io/jw-demo/hello-netcat:latest

[ ✓ ] Built container image gcr.io/jw-demo/hello-netcat
[ ! ] FYI, running the following command:
        docker push gcr.io/jw-demo/hello-netcat
[ ✓ ] Pushed container image to Google Container Registry.
[ ! ] FYI, running the following command:
        gcloud run deploy hello-netcat\
          --project=jw-demo\
          --platform=managed\
          --region=us-central1\
          --image=gcr.io/jw-demo/hello-netcat\
          --allow-unauthenticated
[ ✓ ] Successfully deployed service hello-netcat to Cloud Run.
* This application is billed only when it's handling requests.
* Manage this application at Cloud Console:
        https://console.cloud.google.com/run/detail/us-central1/hello-netcat?project=jw-demo
* Learn more about Cloud Run:
        https://cloud.google.com/run/docs
[ ✓ ] Your application is now live here:
        https://hello-netcat-weurlhfjnq-uc.a.run.app
@jamesward jamesward added the enhancement New feature or request label Jul 22, 2020
@ahmetb
Copy link
Contributor

ahmetb commented Jul 22, 2020

Should be doable. But most projects e.g. even the Go binaries are likely to have screens full of build messages that the user might fail to keep track of. Similarly docker-build tends to treat stderr as red (90% of the time causing false alarms to the user).

@dfreilich
Copy link

Thanks for filing the feedback so fast! Agreed, it would be really nice to opt-in to the logs, and preferably even to configure the button to always display logs (so that we can show what our project logs look like)

@jamesward
Copy link
Contributor Author

Yeah, there could also be an app.json flag.

@ahmetb
Copy link
Contributor

ahmetb commented Jul 22, 2020

I resisted not to say yet another flag, but it seems inevitable. :)

@ahmetb
Copy link
Contributor

ahmetb commented Jul 22, 2020

For the record, we do collect those logs already, but we only print if we fail.

And I just realized why it currently isn't possible to stream.

It's because we have an animation printing [ /|\_/... ] Building container image and while that's going on, we can't stream stuff to the output stream as it would mess with the animation.

@jamesward
Copy link
Contributor Author

Yeah, the app.json creep is real.

In this case we could disable the spinner.

BTW, for some reason the spinner doesn't work (sometimes or all the time?). #182

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

No branches or pull requests

3 participants