Skip to content

Log core.Start output. - #2561

Merged
gerhard merged 3 commits into
dagger:mainfrom
sipsma:start-stdio
Jul 12, 2022
Merged

gerhard merged 3 commits into
dagger:mainfrom
sipsma:start-stdio

Conversation

@sipsma

@sipsma sipsma commented Jun 2, 2022 •

Copy link
Copy Markdown
Contributor

Before this, core.Start output was just dropped entirely. Now, its
stdout and stderr are logged in the same way core.Exec output is
logged.

This requires importing some Buildkit code that it uses for collecting
and publishing log streams efficiently (internally uses a circular
buffer). The interface is a bit clunky but gets us parity between
core.Start and core.Exec.

Signed-off-by: Erik Sipsma [email protected]

Note: this also has a separate commit that refactors the code to split it amongst separate files, as requested in a previous PR: #2460

Will be somewhat easier to review by looking at the Log core.Start output commit by itself.

Fixes #2469

@sipsma
sipsma requested review from a team, helderco and shykes as code owners June 2, 2022 18:41
@sipsma sipsma mentioned this pull request Jun 2, 2022
1 of 9 tasks

@TomChv TomChv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did a great job! I left few comments a question as usual 🚀

@@ -0,0 +1,96 @@
package core

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this file contains multiple definition related to async, this would be more accurate to name it async.cue instead of start.cue?
WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We moved away from the async terminology in the original PR (i.e. I changed the name from core.#AsyncExec to core.#Start), so I feel like it would be out of place now.

I did just realize that I never updated the actual go structs to remove the term async, which is maybe where the confusion is coming from. I'll update with that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes my bad, I was confuse with this..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries! I changed the name of the go structs to just be startTask and stopTask now

Comment thread plan/task/startExec.go
Comment on lines +19 to +23
func init() {
Register("Start", func() Task { return &asyncExecTask{} })
Register("Stop", func() Task { return &stopAsyncExecTask{} })
Register("SendSignal", func() Task { return &sendSignalTask{} })
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as cue file, you are register all task to manage async, I'm not sure the file name is accurate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comment

Comment thread solver/container.go Resolved
@TomChv TomChv added the area/engine About dagger core engine label Jun 6, 2022
@sipsma

sipsma commented Jun 6, 2022

Copy link
Copy Markdown
Contributor Author

One thing I noticed when testing is that right now the output still never shows up when running in TTY mode (I had only tested this PR in plain mode before). I believe this is because the TTY mode considers the task to be done once started and thus won't show any output for it.

This is worth fixing, but I don't think it's essential immediately as the main point of this PR was just to make sure that stdout/stderr weren't completely dropped like before. As long as they are visible in plain mode then users at least have basic debugability. I will add this task to the main epic, but not going to prioritize it immediately as there is already a PR out to fix up a bunch of TTY related issues.

@TomChv

TomChv commented Jun 7, 2022

Copy link
Copy Markdown
Member

This is worth fixing, but I don't think it's essential immediately as the main point of this PR was just to make sure that stdout/stderr weren't completely dropped like before. As long as they are visible in plain mode then users at least have basic debugability. I will add this task to the main epic, but not going to prioritize it immediately as there is already a PR out to fix up a bunch of TTY related issues.

Totally agree, we can merge it and take care of that in another PR ;)

@mircubed

Copy link
Copy Markdown
Contributor

@helderco @shykes reminder to review

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions

github-actions Bot commented Jul 3, 2022

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions Bot closed this Jul 3, 2022
@sipsma sipsma reopened this Jul 5, 2022
@sipsma

sipsma commented Jul 5, 2022

Copy link
Copy Markdown
Contributor Author

Rebased, integ test failure seems unrelated (also happening in main right now).

Ping @helderco if you have a spare min to look quickly, the changes to the core CUE files are superficial (just rearranging into separate files). This PR is leftover from a bit ago and not incredibly high priority but may as well get it merged still.

sipsma added 2 commits July 12, 2022 20:01
Before this, core.Start output was just dropped entirely. Now, its
stdout and stderr are logged in the same way core.Exec output is
logged.

This requires importing some Buildkit code that it uses for collecting
and publishing log streams efficiently (internally uses a circular
buffer). The interface is a bit clunky but gets us parity between
core.Start and core.Exec.

Signed-off-by: Erik Sipsma <[email protected]>

@gerhard gerhard left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great PR that has been sitting open for too long, we want to get it in.

All changes look good to me. When all checks go green, this is OK to merge from my POV.

OK, apparently not. Will check what changed since the tests passed last time.

Just a go mod tidy 🏎

Signed-off-by: Gerhard Lazu <[email protected]>
@gerhard

gerhard commented Jul 12, 2022

Copy link
Copy Markdown
Contributor

@sipsma ⛴ (because this was so slow to get merged).

@gerhard
gerhard merged commit df18914 into dagger:main Jul 12, 2022
@sipsma

sipsma commented Jul 12, 2022

Copy link
Copy Markdown
Contributor Author

Thank you @gerhard!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/engine About dagger core engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include #Start exec output in progress logs

4 participants