From 4d4952935e49af49ce94a4de1bd8b29268a6542f Mon Sep 17 00:00:00 2001 From: Celeste Zeng <61256376+celeste-zeng@users.noreply.github.com> Date: Wed, 2 Aug 2023 13:48:42 -0700 Subject: [PATCH] Fix gradle command not found error for Python ValidatesContainer Dataflow ARM (#27810) --- .github/workflows/README.md | 2 +- ..._Python_ValidatesContainer_Dataflow_ARM.yml | 18 ++++++++++-------- .../python/container/run_validatescontainer.sh | 7 +++++-- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 553e07d84e88..9b983d300ecd 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -137,4 +137,4 @@ Please note that jobs with matrix need to have matrix element in the comment. Ex | [ PreCommit Website ](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Website.yml) | N/A |`Run Website PreCommit`| [![.github/workflows/beam_PreCommit_Website.yml](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Website.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Website.yml) | | [ PreCommit Website Stage GCS ](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Website_Stage_GCS.yml) | N/A |`Run Website_Stage_GCS PreCommit`| [![PreCommit Website Stage GCS](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Website_Stage_GCS.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Website_Stage_GCS.yml) | | [ PreCommit Whitespace ](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Whitespace.yml) | N/A |`Run Whitespace PreCommit`| [![.github/workflows/beam_PreCommit_Whitespace.yml](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Whitespace.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/beam_PreCommit_Whitespace.yml) | -| [ Python Validates Container Dataflow ARM ](https://github.com/apache/beam/actions/workflows/beam_Python_ValidatesContainer_Dataflow_ARM.yml) | ['3.8','3.9','3.10','3.11'] | `Run Python Validates Container Dataflow ARM (matrix_element)`| [![.github/workflows/beam_Python_ValidatesContainer_Dataflow_ARM.yml](https://github.com/apache/beam/actions/workflows/beam_Python_ValidatesContainer_Dataflow_ARM.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/beam_Python_ValidatesContainer_Dataflow_ARM.yml) | \ No newline at end of file +| [ Python Validates Container Dataflow ARM ](https://github.com/apache/beam/actions/workflows/beam_Python_ValidatesContainer_Dataflow_ARM.yml) | ['3.8','3.9','3.10','3.11'] | `Run Python ValidatesContainer Dataflow ARM (matrix_element)`| [![.github/workflows/beam_Python_ValidatesContainer_Dataflow_ARM.yml](https://github.com/apache/beam/actions/workflows/beam_Python_ValidatesContainer_Dataflow_ARM.yml/badge.svg?event=schedule)](https://github.com/apache/beam/actions/workflows/beam_Python_ValidatesContainer_Dataflow_ARM.yml) | \ No newline at end of file diff --git a/.github/workflows/beam_Python_ValidatesContainer_Dataflow_ARM.yml b/.github/workflows/beam_Python_ValidatesContainer_Dataflow_ARM.yml index cadde77fba1a..5eabf5d22e33 100644 --- a/.github/workflows/beam_Python_ValidatesContainer_Dataflow_ARM.yml +++ b/.github/workflows/beam_Python_ValidatesContainer_Dataflow_ARM.yml @@ -49,7 +49,7 @@ concurrency: jobs: beam_Python_ValidatesContainer_Dataflow_ARM: - name: beam_Python_ValidatesContainer_Dataflow_ARM + name: beam_Python_ValidatesContainer_Dataflow_ARM (Run Python ValidatesContainer Dataflow ARM 3.x) strategy: fail-fast: false matrix: @@ -57,7 +57,8 @@ jobs: if: | github.event_name == 'push' || startsWith(github.event.comment.body, 'Run Python ValidatesContainer Dataflow ARM') || - github.event_name == 'schedule' + github.event_name == 'schedule' || + github.event_name == 'workflow_dispatch' runs-on: [self-hosted, ubuntu-20.04, main] env: MULTIARCH_TAG: $(date +'%Y%m%d-%H%M%S%N') @@ -77,7 +78,7 @@ jobs: pull_request_url: ${{ github.event.issue.pull_request.url }} github_repository: ${{ github.repository }} github_token: ${{ secrets.GITHUB_TOKEN }} - github_job: "${{ github.job }} (${{ matrix.python_version }})" + github_job: "beam_Python_ValidatesContainer_Dataflow_ARM (Run Python ValidatesContainer Dataflow ARM 3.x) (${{ matrix.python_version }})" github_current_run_id: ${{ github.run_id }} - name: Install Python uses: actions/setup-python@v4 @@ -107,17 +108,18 @@ jobs: echo "py_ver_clean=$PY_VER_CLEAN" >> $GITHUB_OUTPUT - name: run Python validatesContainerARM script id: run_script - run: | + uses: ./.github/actions/gradle-command-self-hosted-action + with: gradle-command: :sdks:python:test-suites:dataflow:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:validatesContainerARM arguments: | -PpythonVersion=${{ matrix.python_version }} \ -Pcontainer-architecture-list=arm64,amd64 \ -Pdocker-repository=us.gcr.io/apache-beam-testing/github-actions \ -Pdocker-tag=${{ env.MULTIARCH_TAG }} \ - -Ppush-containers - env: - MULTIARCH_TAG: ${{ env.MULTIARCH_TAG }} - USER: github-actions + -Ppush-containers \ + env: + MULTIARCH_TAG: ${{ env.MULTIARCH_TAG }} + USER: github-actions - name: Archive code coverage results uses: actions/upload-artifact@v3 with: diff --git a/sdks/python/container/run_validatescontainer.sh b/sdks/python/container/run_validatescontainer.sh index 1ee6305ba5b3..3ea9148ca67a 100755 --- a/sdks/python/container/run_validatescontainer.sh +++ b/sdks/python/container/run_validatescontainer.sh @@ -38,7 +38,7 @@ if [[ $# < 2 ]]; then printf "Usage: \n$> ./sdks/python/container/run_validatescontainer.sh " printf "\n\tpython_version: [required] Python version used for container build and run tests." printf " Sample value: 3.9" - printf "\n\tcpu_architecture: [optional] CPU architecture used for container build and run tests." + printf "\n\tcpu_architecture: [optional] CPU architecture used for container build and run tests, default as x86." printf " Sample value: ARM or x86" exit 1 fi @@ -86,13 +86,16 @@ if [[ "$ARCH" == "x86" ]]; then # Push the container gcloud docker -- push $CONTAINER:$TAG -else +elif [[ "$ARCH" == "ARM" ]]; then # Note: ARM test suites only run on github actions, where multi-arch Python SDK containers are already pushed during build. # Reset the test suite tag to run ARM pipelines. TEST_SUITE_TAG="it_dataflow_arm" # Reset the multi-arch Python SDK container image tag. TAG=$MULTIARCH_TAG +else + printf "Please give a valid CPU architecture, either x86 or ARM." + exit 1 fi function cleanup_container {