-
Notifications
You must be signed in to change notification settings - Fork 503
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
Adding tmate action to CI for debugging #3138
base: develop
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrmm I hadn't experienced that. Let me confirm and I can increase the time limit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Description
This adds
tmate
to 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
tmate
are discussed in the issue below.Fixes #3137