Repository navigation
Adding tmate action to CI for debugging - #3138
Conversation
|
This could be helpful to investigate the PR #3087 |
|
Okay I think I found a solution I'm happy enough with here, even if it's a little less elegant than I'd like. Contributors can now submit a commit with a message that contains Github actions surprisingly doesn't make it very easy to get the latest commit information for all events that trigger workflows as part of the |
|
Just smoothed out one final snag here: The Here's an example of this working in my fork: https://github.com/pshriwise/openmc/actions/runs/11335356157 I'll note that the errors do still appear in the summary, but aren't really of consequence. |
| continue-on-error: true | ||
| if: ${{ contains(env.COMMIT_MESSAGE, '[gha-debug]') }} | ||
| uses: mxschmitt/action-tmate@v3 | ||
| timeout-minutes: 10 |
There was a problem hiding this comment.
Doesn't it mean the session will end after 10 min? And I have noticed, when the log is huge, we can't scroll the window in tmate session. So, is there any alternative?
There was a problem hiding this comment.
This does mean the session will close after 10 minutes, yes. I don't think we want CI running indefinitely. This seemed like a reasonable window for someone to follow the progress of CI and log into the session.
The terminal session is inside of a tool called tmux. You can scroll up higher in the terminal output, but it requires a few extra keystrokes (Ctrl+B, [ if memory serves).
There was a problem hiding this comment.
Can you please double check this? I was testing this workflow in my branch and found that the session gets closed even when I am logged in. I think that since we are using a specific commit to run this, we can increase the time limit to 1 h.
There was a problem hiding this comment.
Hrmm I hadn't experienced that. Let me confirm and I can increase the time limit.
There was a problem hiding this comment.
What was the resolution on this? Do we need to increase the timeout limit?
paulromano
left a comment
There was a problem hiding this comment.
As is, this will require a PR author to be aware of the "[gha-debug]" special string and make a commit with that. I personally don't see how this is much easier than letting people be aware of tmate in general and having them add the few lines in ci.yml since either way they will have to make an extra commit. I would prefer the latter for simplicity.
Hrmm that's a good point about awareness. It's something of an easter egg at the moment. I think there are ways to address that though by adding notes in the documentation testing section and to the pull request template. I'd love for more people to be aware of the
as well as maintainers' time providing that explanation if needed instead of "run At the end of the day, It's up to you bit I wouldn't mind saving some cycles for CI debugging when it's needed. |
|
I would agree with @pshriwise , as a user/dev, I feel that adding an empty commit, is simpler than tweaking the ci.yml (one way to get access to the runner, and back to remove it at the end) |
paulromano
left a comment
There was a problem hiding this comment.
Ok, you've won me over on this. Before I approve/merge though, can you add something brief in the documentation (probably devguide/tests.rst) that explains how to use this?
🙏🏻 Gladly! |
Description
This adds
tmateto our CI in a mode that will only generate a connection if the CI action has failed. The connection will remain open for 15 minutes to allow someone with access to the action output to connect to the CI machine (once connected, the action will remain live until the user exits the terminal session).Alternative options for deploying
tmateare discussed in the issue below.Fixes #3137