From bbeeb78c1656d92c0e0b41afe233c43964b31658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Marty?= <9808326+fxmarty@users.noreply.github.com> Date: Fri, 11 Aug 2023 12:00:37 +0200 Subject: [PATCH 1/9] tentatively fix --- .github/workflows/build_pr_documentation.yml | 13 ++++++++++++- docs/source/quicktour.mdx | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml index 62d796a7a3..1f690b40b3 100644 --- a/.github/workflows/build_pr_documentation.yml +++ b/.github/workflows/build_pr_documentation.yml @@ -1,7 +1,9 @@ name: Build PR documentation +# WARNING: As this workflow supports the pull_request_target event, please exercise extra care when editing it. + on: - pull_request: + pull_request_target: branches: [ main ] concurrency: @@ -9,7 +11,14 @@ concurrency: cancel-in-progress: true jobs: + authorize: + if: (github.event.action == 'labeled' && github.event.label.name == 'build-pr-doc') || github.event_name != 'pull_request_target' || (! github.event.pull_request.head.repo.fork) + runs-on: ubuntu-latest + steps: + - run: true + build_documentation: + needs: authorize runs-on: ubuntu-latest env: COMMIT_SHA: ${{ github.event.pull_request.head.sha }} @@ -27,6 +36,7 @@ jobs: with: repository: 'huggingface/optimum' path: optimum + ref: ${{ github.event.pull_request.merge_commit_sha }} - uses: actions/checkout@v2 with: @@ -87,6 +97,7 @@ jobs: sudo apt update sudo apt install -y ca-certificates apt-transport-https gnupg sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 5F03AFA423A751913F249259814F888B20B09A7E + # TODO: remove secrets and pull_request_target once archive.furiosa.ai is public sudo tee -a /etc/apt/auth.conf.d/furiosa.conf > /dev/null < Date: Fri, 11 Aug 2023 12:09:43 +0200 Subject: [PATCH 2/9] exporters gpu needs the correct label --- .github/workflows/test_exporters_gpu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_exporters_gpu.yml b/.github/workflows/test_exporters_gpu.yml index 0be8085f40..688e28971a 100644 --- a/.github/workflows/test_exporters_gpu.yml +++ b/.github/workflows/test_exporters_gpu.yml @@ -13,6 +13,7 @@ on: jobs: start-runner: + if: ${{ (github.event_name == 'workflow_dispatch') || (github.event_name == 'schedule') || contains( github.event.pull_request.labels.*.name, 'gpu-test') }} name: Start self-hosted EC2 runner runs-on: ubuntu-latest env: From efe7376ae0cd620ba2f7d6d4373989915d2408b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Marty?= <9808326+fxmarty@users.noreply.github.com> Date: Fri, 11 Aug 2023 12:11:00 +0200 Subject: [PATCH 3/9] types required? --- .github/workflows/build_pr_documentation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml index 1f690b40b3..1bc62caa89 100644 --- a/.github/workflows/build_pr_documentation.yml +++ b/.github/workflows/build_pr_documentation.yml @@ -5,6 +5,7 @@ name: Build PR documentation on: pull_request_target: branches: [ main ] + types: [ opened, synchronize, reopened, labeled ] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} From 1776d37b54aacb3d887e9b4b55774cd89fb728dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Marty?= <9808326+fxmarty@users.noreply.github.com> Date: Fri, 11 Aug 2023 12:14:33 +0200 Subject: [PATCH 4/9] starting? --- .github/workflows/build_pr_documentation.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml index 1bc62caa89..da42157475 100644 --- a/.github/workflows/build_pr_documentation.yml +++ b/.github/workflows/build_pr_documentation.yml @@ -3,9 +3,11 @@ name: Build PR documentation # WARNING: As this workflow supports the pull_request_target event, please exercise extra care when editing it. on: - pull_request_target: + pull_request: branches: [ main ] - types: [ opened, synchronize, reopened, labeled ] +# pull_request_target: +# branches: [ main ] +# types: [ opened, synchronize, reopened, labeled ] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} From feda28f548fb8deb8b3ed350d55d8b1a4f1f59c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Marty?= <9808326+fxmarty@users.noreply.github.com> Date: Fri, 11 Aug 2023 12:19:19 +0200 Subject: [PATCH 5/9] target --- .github/workflows/build_pr_documentation.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml index da42157475..1bc62caa89 100644 --- a/.github/workflows/build_pr_documentation.yml +++ b/.github/workflows/build_pr_documentation.yml @@ -3,11 +3,9 @@ name: Build PR documentation # WARNING: As this workflow supports the pull_request_target event, please exercise extra care when editing it. on: - pull_request: + pull_request_target: branches: [ main ] -# pull_request_target: -# branches: [ main ] -# types: [ opened, synchronize, reopened, labeled ] + types: [ opened, synchronize, reopened, labeled ] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} From d350764e591fced4b13820ee2b9106378b5d962e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Marty?= <9808326+fxmarty@users.noreply.github.com> Date: Fri, 11 Aug 2023 12:24:26 +0200 Subject: [PATCH 6/9] i don't expect this to help --- .github/workflows/build_pr_documentation.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml index 1bc62caa89..0e03621a14 100644 --- a/.github/workflows/build_pr_documentation.yml +++ b/.github/workflows/build_pr_documentation.yml @@ -6,6 +6,10 @@ on: pull_request_target: branches: [ main ] types: [ opened, synchronize, reopened, labeled ] + paths: + - "optimum/**.py" + - "docs/**.mdx" + - "docs/**.yml" concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} From 7a4a333863d46129d5ea51155a0a63f99cb5c6ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Marty?= <9808326+fxmarty@users.noreply.github.com> Date: Fri, 11 Aug 2023 12:25:49 +0200 Subject: [PATCH 7/9] should run --- docs/source/quicktour.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/quicktour.mdx b/docs/source/quicktour.mdx index d679c24794..d39afbab7a 100644 --- a/docs/source/quicktour.mdx +++ b/docs/source/quicktour.mdx @@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License. # Quick tour Hey I did a change here! +wololo This quick tour is intended for developers who are ready to dive into the code and see examples of how to integrate 🤗 Optimum into their model training and inference workflows. From e6e2d1d4bf9b28cf60adaa1e8eef4c74c9cc8380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Marty?= <9808326+fxmarty@users.noreply.github.com> Date: Fri, 11 Aug 2023 12:26:50 +0200 Subject: [PATCH 8/9] add workflow dispatch --- .github/workflows/build_pr_documentation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml index 0e03621a14..ddbc211c1e 100644 --- a/.github/workflows/build_pr_documentation.yml +++ b/.github/workflows/build_pr_documentation.yml @@ -3,6 +3,7 @@ name: Build PR documentation # WARNING: As this workflow supports the pull_request_target event, please exercise extra care when editing it. on: + workflow_dispatch: pull_request_target: branches: [ main ] types: [ opened, synchronize, reopened, labeled ] From 8f88545269df92d84f932ce5cb3447db39a1ef2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Marty?= <9808326+fxmarty@users.noreply.github.com> Date: Fri, 11 Aug 2023 12:27:40 +0200 Subject: [PATCH 9/9] revert doc change --- docs/source/quicktour.mdx | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/source/quicktour.mdx b/docs/source/quicktour.mdx index d39afbab7a..11b0bb1c18 100644 --- a/docs/source/quicktour.mdx +++ b/docs/source/quicktour.mdx @@ -12,9 +12,6 @@ specific language governing permissions and limitations under the License. # Quick tour -Hey I did a change here! -wololo - This quick tour is intended for developers who are ready to dive into the code and see examples of how to integrate 🤗 Optimum into their model training and inference workflows. ## Accelerated inference