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

Add option to ssh into GitHub Actions for debugging #770

Merged
merged 2 commits into from
Sep 16, 2022
Merged

Add option to ssh into GitHub Actions for debugging #770

merged 2 commits into from
Sep 16, 2022

Conversation

ascillitoe
Copy link
Contributor

@ascillitoe ascillitoe commented Sep 16, 2022

This PR adds an option to ssh into GitHub Actions for debugging. The ssh support is only enabled when CI is triggered via manual dispatch, and the option is selected.

Instructions

  1. Go to the "CI" workflows section on the Alibi GitHub Actions page (direct link).

  2. Click on "Run Workflow", and select the "Enable tmate debugging" toggle:
    image

  3. Select the workflow once it starts, and then select the build of interest (e.g. ubuntu-latest, 3.10.6):
    image

  4. Once the workflow reaches the Setup tmate session step, click on the toggle to expand it:
    image

  5. Copy and paste the ssh command that is being printed to your terminal e.g. ssh [email protected] in this case.

  6. Run the ssh command. Assuming your ssh keys are properly set up for github, you should now be inside the GutHub Action runner:
    image

  7. The tmate session is opened after the Python and pip installs are completed, so you should be ready to run alibi and debug as required.

Additional instructions

  • If the registered public SSH key is not your default private SSH key, you will need to specify the path manually, like so: ssh -i .
  • Once you have finished debugging, you can continue the workflow (i.e. let the full build CI run) by running touch continue whilst in the root directory (~/work/alibi/alibi). This will close the tmate session.
  • This new capability is currently temperamental on the MacOS build due to this Unstable on Mac due to GitHub API restrictions mxschmitt/action-tmate#69. If the MacOS build fails all the builds are failed. You will need to retrigger the workflow if this happens.

TODO's

  • Fix the temperamental issue with the MacOS build, or just disable on MacOS for now.
  • Move above instructions to CONTRIBUTING.md once finalised.
  • Think about configuring the timeout option. To resume all the build workflows we'd need to ssh into each build separately and run touch continue, which isn't practical. This doesn't really matter if the default github action timeout is reasonable, but I'm not sure what it is. If it is too long we can set a shorter timeout specific to the tmut session.
  • Open equivalent PR for alibi-detect.

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.

1 participant