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

docs: Convert debugging page #7407

Merged
merged 10 commits into from
May 25, 2024

Conversation

vikram-dagger
Copy link
Contributor

No description provided.

@vikram-dagger
Copy link
Contributor Author

vikram-dagger commented May 18, 2024

https://dagger.cloud/dagger/traces/8b7aa1a600a20884ffd6f895633babbc - TS lint shows a failure, but https://github.com/dagger/dagger/actions/runs/9140565827/job/25134037910?pr=7407 - TS lint (which is presumably doing the same thing) shows success. Not quite sure what this means or how to turn it green. Please lmk if any suggestions @gerhard @matipan

@gerhard
Copy link
Member

gerhard commented May 19, 2024

I am assuming that the trace failed because the span never terminated:
image

The only way that I was able to make this type of check green is to run it again, even if the job succeeded. CC-ing @vito & @crjm @aluzzardi in case they have a different suggestion. Triggering the re-run to check if that still works as I remember.

Yes, re-running it did the trick:
image

Copy link
Member

@gerhard gerhard left a comment

Choose a reason for hiding this comment

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

Apart from my comment, LGTM!

docs/current_docs/manuals/developer/debugging.mdx Outdated Show resolved Hide resolved
@crjm
Copy link
Contributor

crjm commented May 19, 2024

I am assuming that the trace failed because the span never terminated

Yes, this is the reason why this is happening.
The API is resolving this as an error, not the engine, as the span signaling the end of the execution never reached the API.
This is also why the engine doesn't exit with an error code in CI.

@vito it seems like we are setting the state in the FE for timeouts, but we are not showing any UI for that state.
Should we add an element to represent it?

@@ -40,19 +54,19 @@ Using the command `dagger call --debug echo --msg="hello"`, should print
something like:

```
MyModule.echo(msg: "hello"): String! 0.5s
Mymodule.echo(msg: "hello"): String! 0.5s
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@helderco this is not the current output. The current output contains a very large number of spans, and I wasn't able to find anything similar to what is shown here. Please suggest what should be done for this output.

### Enable SDK debug logs

:::important
The information in this section is only applicable to the Python SDK. Debug logs are not currently available for the Go and TypeScript SDKs.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vito @jedevc @TomChv is this accurate?

@levlaz
Copy link
Contributor

levlaz commented May 20, 2024 via email

@vikram-dagger
Copy link
Contributor Author

that the user will see a lot of DBG info in the output and then end with the nicely formatted thing that gets printed out at the end.

@levlaz Yes, I see the DBG output but at the end I only see this output, which only partially matches what you have:

✔ connect 1.9s
✔ initialize 58.2s
✔ myModule: MyModule! 2.4s
┃ [DEBUG] dagger.mod._module: output => '{}'                                                                      
┃ [DEBUG] dagger.client._session: Closing client session to GraphQL server                                        
  ✔ connect 0.2s
✔ MyModule.echo(msg: "hello"): String! 2.3s
┃ [DEBUG] dagger.mod._module: output => '"hello"'                                                                 
┃ [DEBUG] dagger.client._session: Closing client session to GraphQL server                                        
  ✔ connect 0.1s

hello

Which of the two outputs is correct. @helderco ?

┃ [DEBUG] dagger.mod._resolver: func => <Signature (msg: str) -> str>
┃ [DEBUG] dagger.mod._resolver: input args => {'msg': 'hello'}
┃ [DEBUG] dagger.mod._resolver: structured args => {'msg': 'hello'}
┃ [DEBUG] dagger.mod._module: result => 'hello'
┃ [DEBUG] dagger.mod._module: output => '"hello"'
┃ [DEBUG] dagger.client._session: Closing client session to GraphQL server
DEBUG: executing query="query{myModule{echo(msg:\"hello\")}}"
DEBUG: executing query="query{mymodule{echo(msg:\"hello\")}}"
```

The above gives a lot of useful information:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

is this list still accurate @helderco ? I see some of this in the output but not all

@@ -63,13 +77,4 @@ The above gives a lot of useful information:
- The user inputs after being converted to more complex types (structuring)
- The function's result before and after serialization

Additionally, with `--debug` the GraphQL query that the CLI produced is also shown.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also don't see the GraphQL query any longer in the output, so I'm unsure if this statement is still valid. WDYT @levlaz @helderco ?

Copy link
Contributor

Choose a reason for hiding this comment

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

The query still shows, but it's no longer at the end, you'll have to search for it.

Copy link
Contributor

@levlaz levlaz left a comment

Choose a reason for hiding this comment

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

Vikram and I looked at this together over Discord, its good to go once we add the updated output.

Signed-off-by: Vikram Vaswani <vikram@dagger.io>
Signed-off-by: Vikram Vaswani <vikram@dagger.io>
Signed-off-by: Vikram Vaswani <vikram@dagger.io>
Signed-off-by: Vikram Vaswani <vikram@dagger.io>
Signed-off-by: Vikram Vaswani <vikram@dagger.io>
Signed-off-by: Vikram Vaswani <vikram@dagger.io>
Signed-off-by: Vikram Vaswani <vikram@dagger.io>
Signed-off-by: Vikram Vaswani <vikram@dagger.io>
Signed-off-by: Vikram Vaswani <vikram@dagger.io>
Signed-off-by: Vikram Vaswani <vikram@dagger.io>
@vikram-dagger vikram-dagger merged commit ed0c4d6 into dagger:main May 25, 2024
59 checks passed
@helderco
Copy link
Contributor

helderco commented May 25, 2024

Fyi, to show Python logs you don't need to have --debug in the CLI. They're independent. So you don't need all those DBG entries polluting the output.

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

Successfully merging this pull request may close these issues.

None yet

5 participants