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 Setup ssh to conda and wheel builds #5523

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/actions/wait-for-ssh/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Wait for SSH session on Linux

description: Stuff that should always run at the end of a linux job
# test
inputs:
skip-wait-ssh:
description: If set, don't wait for ssh to drain before tearing down
required: false
default: ""

runs:
using: composite
steps:
- name: Hold runner for 2 hours or until ssh sessions have drained
# TODO working-directory: !{{ pytorch_directory }}
# Always hold for active ssh sessions
shell: bash
if: inputs.skip-wait-ssh == ''
run: |
set -eou pipefail

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
9 changes: 8 additions & 1 deletion .github/workflows/build_conda_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ jobs:
repository: ${{ inputs.test-infra-repository }}
ref: ${{ inputs.test-infra-ref }}
path: test-infra
- name: Setup SSH
uses: ./test-infra/.github/actions/setup-ssh
with:
github-secret: ${{ github.token }}
atalman marked this conversation as resolved.
Show resolved Hide resolved
- uses: ./test-infra/.github/actions/set-channel
- name: Set PYTORCH_VERSION
if: ${{ env.CHANNEL == 'test' }}
Expand Down Expand Up @@ -218,7 +222,10 @@ jobs:
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/distr/

- name: Wait for ssh session
if: ${{ always() }}
uses: ./test-infra/.github/actions/wait-for-ssh

upload:
needs: build
uses: ./.github/workflows/_binary_conda_upload.yml
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/build_conda_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ jobs:
repository: ${{ inputs.test-infra-repository }}
ref: ${{ inputs.test-infra-ref }}
path: test-infra
- uses: ./test-infra/.github/actions/setup-ssh
name: Setup SSH
with:
github-secret: ${{ secrets.GITHUB_TOKEN }}
activate-with-label: false
instructions: "SSH with rdesktop using ssh -L 3389:localhost:3389 %%username%%@%%hostname%%"
- uses: ./test-infra/.github/actions/set-channel
- name: Set PYTORCH_VERSION
if: ${{ env.CHANNEL == 'test' }}
Expand Down Expand Up @@ -249,6 +255,9 @@ jobs:
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/distr/
- uses: ./test-infra/.github/actions/teardown-windows
if: always()
name: Teardown Windows

upload:
needs: build
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/build_wheels_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ jobs:
repository: "pytorch/builder"
ref: "main"
path: builder
- name: Setup SSH
uses: ./test-infra/.github/actions/setup-ssh
with:
github-secret: ${{ github.token }}
- name: Set linux aarch64 CI
if: ${{ inputs.architecture == 'aarch64' }}
shell: bash -l {0}
Expand Down Expand Up @@ -260,6 +264,9 @@ jobs:
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ inputs.repository }}/dist/
- name: Wait for ssh session
if: ${{ always() }}
uses: ./test-infra/.github/actions/wait-for-ssh

upload:
needs: build
Expand Down
Loading