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

Continue running the workflow *AND* keep session open #114

Open
jessehouwing opened this issue Mar 11, 2022 · 6 comments
Open

Continue running the workflow *AND* keep session open #114

jessehouwing opened this issue Mar 11, 2022 · 6 comments

Comments

@jessehouwing
Copy link

It would be nice when the action would spin up the ssh session and would leave the session open to the end of the workflow so you can follow along with top or dump a process that hangs at some point. I haven't dug too deeply into this action... but it would be something nice to do.

@garethsb
Copy link

Seems like it already works that way to me?

@jessehouwing
Copy link
Author

@garethsb
Copy link

We can still keep using a tmate session made by this point until the whole job is finished. What doesn't work?

@barrettj12
Copy link

Here's a solution I've found. My workflow looks like this:

- run: sudo touch /continue

- name: Open SSH session
  uses: mxschmitt/action-tmate@v3

- (actual workflow steps here...)

- name: Block to allow introspection of failures
  run: sleep infinity

This opens the SSH session, but since the continue file already exists, it will immediately continue to the rest of the workflow. I put in the last step so that when a step fails, the workflow doesn't end - so I can use the SSH shell to debug.

Now, if only this action had built-in support for this...

@jessehouwing
Copy link
Author

Nice! Yeah, that's what I hacked together in a very similar action:

https://github.com/jessehouwing/debug-via-ssh

It has a terminate file as well you can touch to end the session, otherwise, it will remain open.

I've actually snuck that into a post-job to be able to debug those as well.

It's not pretty, but it works for now.

For some reason I've had quite a few issues getting t-mate to work in certain places, so I switched to another ssh solution for now, this action is much prettier in most other things though.

@dejayc
Copy link

dejayc commented Feb 13, 2023

Nice! Yeah, that's what I hacked together in a very similar action:

Thanks for providing this! It's quite a neat tool.

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

No branches or pull requests

4 participants