Skip to content

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 [email protected]

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 <[email protected]>

[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 meta-pytorch/pytorch-gha-infra#8

Signed-off-by: Eli Uriegas <[email protected]>

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 meta-pytorch/pytorch-gha-infra#8

Signed-off-by: Eli Uriegas <[email protected]>

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 <[email protected]>

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

Signed-off-by: Eli Uriegas <[email protected]>
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 meta-pytorch/pytorch-gha-infra#8

Signed-off-by: Eli Uriegas <[email protected]>

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 <[email protected]>

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

Signed-off-by: Eli Uriegas <[email protected]>
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 meta-pytorch/pytorch-gha-infra#8

Signed-off-by: Eli Uriegas <[email protected]>

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 <[email protected]>

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

Signed-off-by: Eli Uriegas <[email protected]>
@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.

@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 meta-pytorch/pytorch-gha-infra#8

Signed-off-by: Eli Uriegas <[email protected]>

Closes meta-pytorch/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 <[email protected]>

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

Signed-off-by: Eli Uriegas <[email protected]>
@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 meta-pytorch/pytorch-gha-infra#8

Signed-off-by: Eli Uriegas <[email protected]>

Closes meta-pytorch/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 <[email protected]>

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

Signed-off-by: Eli Uriegas <[email protected]>
@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