From 2971977741ce2b6e8aae230585799e5f941278dc Mon Sep 17 00:00:00 2001 From: Marco Robles Date: Tue, 20 Sep 2022 15:46:22 -0500 Subject: [PATCH 1/4] add runner portability python samza --- ...ommit-python-runners-portability-samza.yml | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/job-precommit-python-runners-portability-samza.yml diff --git a/.github/workflows/job-precommit-python-runners-portability-samza.yml b/.github/workflows/job-precommit-python-runners-portability-samza.yml new file mode 100644 index 000000000000..b15fe36e02d4 --- /dev/null +++ b/.github/workflows/job-precommit-python-runners-portability-samza.yml @@ -0,0 +1,81 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Test for Python Precommit Runners Portability Samza + + +name: Python Precommit Runners Portability Samza +on: + workflow_dispatch: + schedule: + - cron: '0 */6 * * *' + push: + branches: ['master', 'release-*'] + tags: ['v*'] + pull_request: + branches: ['master', 'release-*'] + tags: ['v*'] + #paths: ['sdks/python/apache_beam/examples/**', + # 'sdks/python/apache_beam/examples/**'] +permissions: read-all + +env: + tests: "apache_beam/runners/portability/samza_runner_test.py" + +jobs: + set-properties: + runs-on: self-hosted + outputs: + properties: ${{ steps.test-properties.outputs.properties }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + persist-credentials: false + submodules: recursive + - id: test-properties + uses: ./.github/actions/setup-default-test-properties + + runners_portability_samza: + needs: set-properties + name: Python Runners Portability Samza + runs-on: self-hosted + strategy: + fail-fast: false + matrix: + version: ${{fromJson(needs.set-properties.outputs.properties).PythonTestProperties.ALL_SUPPORTED_VERSIONS}} + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + persist-credentials: false + submodules: recursive + - name: Set python version and tox env + run: | + echo "PYTHON_VERSION=$(echo ${{ matrix.version }} | sed -e 's/\.//g')" >> $GITHUB_ENV + - name: Setup environment + uses: ./.github/actions/setup-self-hosted-action + - name: Run :sdks:python:test-suites:tox:${{ env.PYTHON_VERSION }}:testPy${{ env.PYTHON_VERSION }}Cloud + uses: ./.github/actions/gradle-command-self-hosted-action + with: + gradle-command: :sdks:python:test-suites:tox:py${{ env.PYTHON_VERSION }}:testPy${{ env.PYTHON_VERSION }}Cloud + arguments: "-Pposargs=${{env.tests}}" + - name: Run :sdks:python:test-suites:tox:y${{ env.PYTHON_VERSION }}:testPy${{ env.PYTHON_VERSION }}Cython + uses: ./.github/actions/gradle-command-self-hosted-action + with: + gradle-command: :sdks:python:test-suites:tox:py${{ env.PYTHON_VERSION }}:testPy${{ env.PYTHON_VERSION }}Cython + arguments: "-Pposargs=${{env.tests}}" \ No newline at end of file From 31e3e7f90df7e1e6557aeb64947372ac51471f9c Mon Sep 17 00:00:00 2001 From: Marco Robles Date: Sat, 24 Sep 2022 10:56:10 -0500 Subject: [PATCH 2/4] update precommit python samza job --- .../job-precommit-python-runners-portability-samza.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/job-precommit-python-runners-portability-samza.yml b/.github/workflows/job-precommit-python-runners-portability-samza.yml index b15fe36e02d4..18167b5bb4e9 100644 --- a/.github/workflows/job-precommit-python-runners-portability-samza.yml +++ b/.github/workflows/job-precommit-python-runners-portability-samza.yml @@ -26,11 +26,11 @@ on: push: branches: ['master', 'release-*'] tags: ['v*'] - pull_request: + paths: ['sdks/python/apache_beam/runners/portability/samza_runner_test.py'] + pull_request_target: branches: ['master', 'release-*'] tags: ['v*'] - #paths: ['sdks/python/apache_beam/examples/**', - # 'sdks/python/apache_beam/examples/**'] + paths: ['sdks/python/apache_beam/runners/portability/samza_runner_test.py'] permissions: read-all env: @@ -38,13 +38,14 @@ env: jobs: set-properties: - runs-on: self-hosted + runs-on: [self-hosted, ubuntu-20.04] outputs: properties: ${{ steps.test-properties.outputs.properties }} steps: - name: Checkout code uses: actions/checkout@v3 with: + ref: ${{ github.event.pull_request.head.sha }} persist-credentials: false submodules: recursive - id: test-properties @@ -62,6 +63,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 with: + ref: ${{ github.event.pull_request.head.sha }} persist-credentials: false submodules: recursive - name: Set python version and tox env From e0f7735c5af53bf1ca42aa3de52795621e61c428 Mon Sep 17 00:00:00 2001 From: Marco Robles Date: Wed, 28 Sep 2022 08:47:07 -0500 Subject: [PATCH 3/4] resolve CI conflicts and fix --- CI.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI.md b/CI.md index ee911584f7f0..22f141dcfc5f 100644 --- a/CI.md +++ b/CI.md @@ -135,7 +135,7 @@ Service Account shall have following permissions ([IAM roles](https://cloud.goog ### PreCommit Workflows | Workflow | Description | Requires GCP Credentials | |----------------------------------------------------------------------------------|-------------------------|---------------------------| -| [job-precommit-placeholder.yml](.github/workflows/job-precommit-placeholder.yml) | Description placeholder | Yes/No | +| [job-precommit-python-runners-portability-samza.yml](.github/workflows/job-precommit-python-runners-portability-samza.yml) | Run Python Precommit Runners Portability Samza | Yes/No | ### PostCommit Workflows | Workflow | Description | Requires GCP Credentials | From 1b53a7106371d0af66404580382660fb9c03c378 Mon Sep 17 00:00:00 2001 From: Marco Robles Date: Sat, 1 Oct 2022 10:18:53 -0500 Subject: [PATCH 4/4] update yml job file --- .../job-precommit-python-runners-portability-samza.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/job-precommit-python-runners-portability-samza.yml b/.github/workflows/job-precommit-python-runners-portability-samza.yml index 18167b5bb4e9..0a744126d780 100644 --- a/.github/workflows/job-precommit-python-runners-portability-samza.yml +++ b/.github/workflows/job-precommit-python-runners-portability-samza.yml @@ -47,7 +47,6 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} persist-credentials: false - submodules: recursive - id: test-properties uses: ./.github/actions/setup-default-test-properties @@ -65,7 +64,6 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} persist-credentials: false - submodules: recursive - name: Set python version and tox env run: | echo "PYTHON_VERSION=$(echo ${{ matrix.version }} | sed -e 's/\.//g')" >> $GITHUB_ENV