From bac003e193f394f971582e8e4a39cf7afe8ae439 Mon Sep 17 00:00:00 2001 From: charliebudd Date: Thu, 31 Mar 2022 14:08:50 +0100 Subject: [PATCH 1/2] waiting for job logs if not available yet --- .../workflows/build-pytorch-extension-wheels.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-pytorch-extension-wheels.yml b/.github/workflows/build-pytorch-extension-wheels.yml index 5aa63a2..f1a4c75 100644 --- a/.github/workflows/build-pytorch-extension-wheels.yml +++ b/.github/workflows/build-pytorch-extension-wheels.yml @@ -33,8 +33,17 @@ jobs: JOBS_REQUEST=$REQUEST_BASE/runs/${{ github.run_id }}/jobs AUTH=username:${{ secrets.GITHUB_TOKEN }} HEADER="Accept: application/vnd.github.v3+json" - JOBS=$(curl -s -u $AUTH -H $HEADER $JOBS_REQUEST -L --output -) - JOB_IDS=$(echo $JOBS | sed 's/\"id\": /\n"id\": /g' | grep ' / Setup PyTorch Extension Builder' | cut -d ',' -f1 | sed 's/\"id\": //g') + + while [ 1 ] + do + JOBS=$(curl -s -u $AUTH -H $HEADER $JOBS_REQUEST -L --output -) + JOB_IDS=$(echo $JOBS | sed 's/\"id\": /\n"id\": /g' | grep ' / Setup PyTorch Extension Builder' | cut -d ',' -f1 | sed 's/\"id\": //g') + + if [ ${#JOB_IDS[@]} != 0 ]; then + break + fi + sleep 1s + done echo "Job ID: $JOB_IDS" From d2e3eed620b22dfe629d3acdb9339853ddf206c8 Mon Sep 17 00:00:00 2001 From: charliebudd Date: Thu, 31 Mar 2022 14:17:13 +0100 Subject: [PATCH 2/2] fixing repo reference bug --- .../workflows/build-pytorch-extension-wheels.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-pytorch-extension-wheels.yml b/.github/workflows/build-pytorch-extension-wheels.yml index f1a4c75..8e93623 100644 --- a/.github/workflows/build-pytorch-extension-wheels.yml +++ b/.github/workflows/build-pytorch-extension-wheels.yml @@ -33,23 +33,14 @@ jobs: JOBS_REQUEST=$REQUEST_BASE/runs/${{ github.run_id }}/jobs AUTH=username:${{ secrets.GITHUB_TOKEN }} HEADER="Accept: application/vnd.github.v3+json" - - while [ 1 ] - do - JOBS=$(curl -s -u $AUTH -H $HEADER $JOBS_REQUEST -L --output -) - JOB_IDS=$(echo $JOBS | sed 's/\"id\": /\n"id\": /g' | grep ' / Setup PyTorch Extension Builder' | cut -d ',' -f1 | sed 's/\"id\": //g') - - if [ ${#JOB_IDS[@]} != 0 ]; then - break - fi - sleep 1s - done + JOBS=$(curl -s -u $AUTH -H $HEADER $JOBS_REQUEST -L --output -) + JOB_IDS=$(echo $JOBS | sed 's/\"id\": /\n"id\": /g' | grep ' / Setup PyTorch Extension Builder' | cut -d ',' -f1 | sed 's/\"id\": //g') echo "Job ID: $JOB_IDS" LOGS_REQUEST=$REQUEST_BASE/jobs/${JOB_IDS[0]}/logs LOGS=$(curl -s -u $AUTH -H $HEADER $LOGS_REQUEST -L --output -) - TAG=$(echo "$LOGS" | grep "Job defined at: ${{ github.repository }}/.github/workflows/build-pytorch-extension-wheels.yml@" | grep -v "grep" | sed 's:.*/::' | tr -d '[:space:]') + TAG=$(echo "$LOGS" | grep "Job defined at: charliebudd/torch-extension-builder/.github/workflows/build-pytorch-extension-wheels.yml@" | grep -v "grep" | sed 's:.*/::' | tr -d '[:space:]') echo "Tag: $TAG"