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

Connection is not torn down at the end of a calling workflow #57

Open
pilif opened this issue Feb 3, 2023 · 3 comments
Open

Connection is not torn down at the end of a calling workflow #57

pilif opened this issue Feb 3, 2023 · 3 comments

Comments

@pilif
Copy link

pilif commented Feb 3, 2023

This is not a problem when using GitHub-hosted runners which will be destroyed at the end of the job, but in case of self-hosted runner, a runner will stay running after a job has completed.

As this action does nothing to kill the tailscale daemon nor manually disconnect, I would say that in such cases, the machine, even though intended to be connected only during the runtime ob the job, stays connected to the tailnet.

I don't think this is currently possible using composite actions (actions/runner#1478), so you might have to migrate to a TS/JS based action or at least put up a warning in the README that this action is not to be used with self-hosted runners, at least not without some further manual intervention of the user.

@selfagency
Copy link

Actually, I'm seeing the GitHub-hosted runners in my dashboard days after a job run. The action should delete the connection completely when it's finished during its cleanup step.

@DentonGentry
Copy link
Contributor

Actually, I'm seeing the GitHub-hosted runners in my dashboard days after a job run.

Is the Authkey an ephemeral authkey? https://tailscale.com/kb/1111/ephemeral-nodes/

The github-action doesn't delete itself, it expects the ephemeral node to be cleaned up automatically by the control server shortly after it drops out of contact.

@ad-m
Copy link

ad-m commented May 8, 2023

The github-action doesn't delete itself, it expects the ephemeral node to be cleaned up automatically by the control server shortly after it drops out of contact.

Actions may define teardown action for the worker: https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runspost and https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runspost-entrypoint
Unfortunately, it's available only for JavaScript and Docker actions (not composite actions), so conversion to JavaScript or hacky solution nested actions is required to set up it. You can look for https://github.com/ad-m/github-push-action how to make JavaScript action to execute bash script https://github.com/ad-m/github-push-action . See ad-m/github-push-action#94 for the advantages of JavaScript action versus Docker action for basic scenarios like that one.

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