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

.github: Enable SSH to linux runners #62280

Closed
wants to merge 7 commits into from

Conversation

seemethere
Copy link
Member

@seemethere seemethere commented Jul 27, 2021

Stack from ghstack:

Enables SSH to linux GHA runners for FB employees while on the FB VPN

SSH keys will be added to runners when the label "with-ssh" is applied to
your pull request.

Depends on https://github.com/fairinternal/pytorch-gha-infra/pull/8

Signed-off-by: Eli Uriegas eliuriegas@fb.com

Closes https://github.com/fairinternal/pytorch-gha-infra/issues/5

Differential Revision: D29941681

Enables SSH to linux GHA runners for FB employees while on the FB VPN

SSH keys will be added to runners when the label "with-ssh" is applied to
your pull request.

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Jul 27, 2021

🔗 Helpful links

💊 CI failures summary and remediations

As of commit e70b4c1 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@seemethere
Copy link
Member Author

@seemethere has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@seemethere seemethere marked this pull request as draft July 27, 2021 18:27
Enables SSH to linux GHA runners for FB employees while on the FB VPN

SSH keys will be added to runners when the label "with-ssh" is applied to
your pull request.

Depnds on pytorch-labs/pytorch-gha-infra#8

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

Differential Revision: [D29941681](https://our.internmc.facebook.com/intern/diff/D29941681)

[ghstack-poisoned]
Enables SSH to linux GHA runners for FB employees while on the FB VPN

SSH keys will be added to runners when the label "with-ssh" is applied to
your pull request.

Depnds on pytorch-labs/pytorch-gha-infra#8

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

Differential Revision: [D29941681](https://our.internmc.facebook.com/intern/diff/D29941681)

[ghstack-poisoned]
@seemethere seemethere added the module: ci Related to continuous integration label Jul 27, 2021
seemethere added a commit that referenced this pull request Jul 27, 2021
Enables SSH to linux GHA runners for FB employees while on the FB VPN

SSH keys will be added to runners when the label "with-ssh" is applied to
your pull request.

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

ghstack-source-id: 2ae885698390d48850ff8e1529ab6e27154e8f56
Pull Request resolved: #62280

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Enables SSH to linux GHA runners for FB employees while on the FB VPN

SSH keys will be added to runners when the label "with-ssh" is applied to
your pull request.

Depnds on pytorch-labs/pytorch-gha-infra#8

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

Differential Revision: [D29941681](https://our.internmc.facebook.com/intern/diff/D29941681)

[ghstack-poisoned]
seemethere added a commit that referenced this pull request Jul 29, 2021
Enables SSH to linux GHA runners for FB employees while on the FB VPN

SSH keys will be added to runners when the label "with-ssh" is applied to
your pull request.

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

ghstack-source-id: f3c2f147c0009d596072fe2ee12d7dfa4abdfdab
Pull Request resolved: #62280

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Enables SSH to linux GHA runners for FB employees while on the FB VPN

SSH keys will be added to runners when the label "with-ssh" is applied to
your pull request.

Depnds on pytorch-labs/pytorch-gha-infra#8

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

Differential Revision: [D29941681](https://our.internmc.facebook.com/intern/diff/D29941681)

[ghstack-poisoned]
seemethere added a commit that referenced this pull request Aug 3, 2021
Enables SSH to linux GHA runners for FB employees while on the FB VPN

SSH keys will be added to runners when the label "with-ssh" is applied to
your pull request.

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

ghstack-source-id: 6cc87aeac10469430453bfba7ef288630d9debcf
Pull Request resolved: #62280

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
@seemethere seemethere marked this pull request as ready for review August 3, 2021 16:59
@seemethere
Copy link
Member Author

@seemethere has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@seemethere seemethere requested a review from a team August 3, 2021 17:02
# Always hold for active ssh sessions
if: always()
run: |
echo "Holding runner for 2 hours until all ssh sessions have logged out"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that even if the ssh session is on, the runner will still shut down after 2 hours regardless, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is consistent with CircleCI's current re-run with ssh functionality, see: https://circleci.com/docs/2.0/ssh-access-jobs/

Comment on lines 609 to 621
- name: Hold runner for 2 hours or until ssh sessions have drained
# Always hold for active ssh sessions
if: always()
run: |
echo "Holding runner for 2 hours until all ssh sessions have logged out"
for _ in $(seq 1440); do
# Break if no ssh session exists anymore
if [[ "$(who)" = "" ]]; then
break
fi
echo "."
sleep 5
done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this same run script is used in a few different places; would it make sense to put it into .github/scripts and just call it from here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@samestep samestep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! I guess most of the logic is in https://github.com/seemethere/add-github-ssh-key?

@seemethere
Copy link
Member Author

lgtm! I guess most of the logic is in seemethere/add-github-ssh-key?

Yup most of the logic for this particular feature is in the terraform for the security groups as well as the the github actions to add the ssh keys.

Enables SSH to linux GHA runners for FB employees while on the FB VPN

SSH keys will be added to runners when the label "with-ssh" is applied to
your pull request.

Depends on pytorch-labs/pytorch-gha-infra#8

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

Closes pytorch-labs/pytorch-gha-infra#5

Differential Revision: [D29941681](https://our.internmc.facebook.com/intern/diff/D29941681)

[ghstack-poisoned]
seemethere added a commit that referenced this pull request Aug 3, 2021
Enables SSH to linux GHA runners for FB employees while on the FB VPN

SSH keys will be added to runners when the label "with-ssh" is applied to
your pull request.

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

ghstack-source-id: 203f3f618eae7897ec37491073a49f70c8e34a81
Pull Request resolved: #62280

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
@seemethere
Copy link
Member Author

@seemethere has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Enables SSH to linux GHA runners for FB employees while on the FB VPN

SSH keys will be added to runners when the label "with-ssh" is applied to
your pull request.

Depends on pytorch-labs/pytorch-gha-infra#8

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

Closes pytorch-labs/pytorch-gha-infra#5

Differential Revision: [D29941681](https://our.internmc.facebook.com/intern/diff/D29941681)

[ghstack-poisoned]
seemethere added a commit that referenced this pull request Aug 3, 2021
Enables SSH to linux GHA runners for FB employees while on the FB VPN

SSH keys will be added to runners when the label "with-ssh" is applied to
your pull request.

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

ghstack-source-id: 6ee7575b239737570e264f3a5d16c3cde7f2432e
Pull Request resolved: #62280

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
@seemethere
Copy link
Member Author

@seemethere has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@seemethere merged this pull request in c48dfe0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed Merged module: ci Related to continuous integration with-ssh
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants