PerformanceTests ParquetIOIT

# 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.

name: PerformanceTests ParquetIOIT

on:
  schedule:
    - cron: '50 10/12 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_ParquetIOIT:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Java ParquetIO Performance Test'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_ParquetIOIT"]
        job_phrase: ["Run Java ParquetIO Performance Test"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
# The env variable is created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: performance
          test-language: java
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/parquetIOIT.txt
          arguments: |
            --filenamePrefix=gs://temp-storage-for-perf-tests/${{ matrix.job_name }}/${{github.run_id}}/
      - name: run integrationTest
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:file-based-io-tests:integrationTest
          arguments: |
            --tests org.apache.beam.sdk.io.parquet.ParquetIOIT \
            --info \
            -Dfilesystem=gcs \
            -DintegrationTestRunner=dataflow \
            -DintegrationTestPipelineOptions='[${{ env.beam_PerformanceTests_ParquetIOIT_test_arguments_1 }}]'


PerformanceTests ParquetIOIT HDFS

# 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.

name: PerformanceTests ParquetIOIT HDFS

on:
  schedule:
    - cron: '50 10/12 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_ParquetIOIT_HDFS:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Java ParquetIO Performance Test HDFS'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_ParquetIOIT_HDFS"]
        job_phrase: ["Run Java ParquetIO Performance Test HDFS"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: Authenticate on GCP
        id: auth
        uses: google-github-actions/auth@v1
        with:
          credentials_json: ${{ secrets.GCP_SA_KEY }}
          project_id: ${{ secrets.GCP_PROJECT_ID }}
      - name: Set k8s access
        uses: ./.github/actions/setup-k8s-access
        with:
          k8s_namespace: ${{ matrix.job_name }}-${{ github.run_id }}
      - name: Install Hadoop
        id: install_hadoop
        run: |
          kubectl apply -f ${{ github.workspace }}/.test-infra/kubernetes/hadoop/LargeITCluster/hdfs-multi-datanode-cluster.yml
          kubectl wait svc/hadoop --for=jsonpath='{.status.loadBalancer.ingress[0].ip}' --timeout=120s
          loadbalancer_IP=$(kubectl get svc hadoop -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
          echo hadoop_IP=$loadbalancer_IP >> $GITHUB_OUTPUT
# The env variable is created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: performance
          test-language: java
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/parquetIOIT_HDFS.txt
          arguments: |
            --filenamePrefix=hdfs://${{ steps.install_hadoop.outputs.hadoop_IP }}:9000/TEXTIO_IT_
            --hdfsConfiguration=[{\\\"fs.defaultFS\\\":\\\"hdfs:${{ steps.install_hadoop.outputs.hadoop_IP }}:9000\\\",\\\"dfs.replication\\\":1}]
      - name: run integrationTest
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:file-based-io-tests:integrationTest
          arguments: |
            --tests org.apache.beam.sdk.io.parquet.ParquetIOIT \
            --info \
            -Dfilesystem=hdfs \
            -DintegrationTestRunner=dataflow \
            -DintegrationTestPipelineOptions='[${{ env.beam_PerformanceTests_ParquetIOIT_HDFS_test_arguments_1 }}]'


# 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.

name: PerformanceTests PubsubIOIT Python Streaming

on:
  schedule:
    - cron: '30 10 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_PubsubIOIT_Python_Streaming:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run PubsubIO Performance Test Python'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 240
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_PubsubIOIT_Python_Streaming"]
        job_phrase: ["Run PubsubIO Performance Test Python"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: default
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: load
          test-language: python
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/pubsubIOIT_Python_Streaming.txt
          arguments: |
            --job_name=performance-tests-psio-python-2gb$(date '+%m%d%H%M%S' --utc)
      # The env variables are created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
      - name: Run test
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:apache_beam:testing:load_tests:run
          arguments: |
            -PloadTest.mainClass=apache_beam.io.gcp.pubsub_io_perf_test \
            -Prunner=TestDataflowRunner \
            -PpythonVersion=3.8 \
            '-PloadTest.args=${{ env.beam_PerformanceTests_PubsubIOIT_Python_Streaming_test_arguments_1 }}'


# 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.

name: PerformanceTests SQLBigQueryIO Batch Java

on:
  schedule:
    - cron: '10 11/12 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_SQLBigQueryIO_Batch_Java:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run SQLBigQueryIO Batch Performance Test Java'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_SQLBigQueryIO_Batch_Java"]
        job_phrase: ["Run SQLBigQueryIO Batch Performance Test Java"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: default
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: performance
          test-language: java
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/SQLBigQueryIO_Batch_Java.txt
      # The env variables are created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
      - name: Run SQLBigQueryIO Batch Performance Test Java
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:extensions:sql:perf-tests:integrationTest
          arguments: |
            --tests org.apache.beam.sdk.extensions.sql.meta.provider.bigquery.BigQueryIOPushDownIT \
            -DintegrationTestRunner=dataflow  \
            '-DintegrationTestPipelineOptions=[${{env.beam_PerformanceTests_SQLBigQueryIO_Batch_Java_test_arguments_1}}]' \
      - name: Archive JUnit Test Results
        uses: actions/upload-artifact@v4
        if: ${{ !success() }}
        with:
          name: JUnit Test Results
          path: "**/build/reports/tests/"
      - name: Publish JUnit Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/build/test-results/**/*.xml'


PerformanceTests SingleStoreIO

# 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.

name: PerformanceTests SingleStoreIO

on:
  schedule:
    - cron: '0 */12 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: read
  checks: read
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_SingleStoreIO:
    name: ${{matrix.job_name}} (${{matrix.job_phrase}})
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    strategy:
      matrix:
        job_name: [beam_PerformanceTests_SingleStoreIO]
        job_phrase: [Run Java SingleStoreIO Performance Test]
    if: |
      github.event_name == 'push' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event_name == 'workflow_dispatch' ||
      github.event.comment.body == 'Run Java SingleStoreIO Performance Test'
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Authenticate on GCP
        id: auth
        uses: google-github-actions/auth@v1
        with:
          credentials_json: ${{ secrets.GCP_SA_KEY }}
          project_id: ${{ secrets.GCP_PROJECT_ID }}
      - name: Set k8s access
        uses: ./.github/actions/setup-k8s-access
        with:
          cluster_name: io-datastores
          k8s_namespace: ${{ matrix.job_name }}-${{ github.run_id }}
          remove_finalizer:  memsqlclusters.memsql.com/sdb-cluster
      - name: Install Singlestore operator
        run: |
          kubectl apply -f ${{github.workspace}}/.test-infra/kubernetes/singlestore/sdb-rbac.yaml
          kubectl apply -f ${{github.workspace}}/.test-infra/kubernetes/singlestore/sdb-cluster-crd.yaml
          kubectl apply -f ${{github.workspace}}/.test-infra/kubernetes/singlestore/sdb-operator.yaml
          kubectl wait --for=condition=Ready pod -l name=sdb-operator --timeout=300s
      - name: Install Singlestore cluster
        id: install_singlestore
        run: |
          kubectl apply -f ${{github.workspace}}/.test-infra/kubernetes/singlestore/sdb-cluster.yaml
          kubectl wait --for=jsonpath='{.status.phase}'=Running memsqlclusters.memsql.com --all --timeout=300s
          kubectl wait svc/svc-sdb-cluster-ddl --for=jsonpath='{.status.loadBalancer.ingress[0].ip}' --timeout=300s
          loadbalancer_IP=$(kubectl get svc svc-sdb-cluster-ddl -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
          echo lb_ip=$loadbalancer_IP >> $GITHUB_OUTPUT
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: performance
          test-language: java
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/config_PerformanceTests_SingleStoreIO.txt
          arguments: |
            --singleStoreServerName=${{ steps.install_singlestore.outputs.lb_ip }}
      # The env variable is created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
      - name: Run Java SingleStore IO Performance Test
        id: run_java_singlestore_io_performance_test
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:singlestore:integrationTest
          arguments: |
            --tests org.apache.beam.sdk.io.singlestore.SingleStoreIOPerformanceIT \
            --info \
            -DintegrationTestRunner=dataflow \
            -DintegrationTestPipelineOptions='[${{ env.beam_PerformanceTests_SingleStoreIO_test_arguments_1 }}]'


# 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.

name: PerformanceTests SpannerIO Read 2GB Python

on:
  schedule:
    - cron: '30 10 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_SpannerIO_Read_2GB_Python:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run SpannerIO Read 2GB Performance Test Python'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 480
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_SpannerIO_Read_2GB_Python"]
        job_phrase: ["Run SpannerIO Read 2GB Performance Test Python"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: default
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: load
          test-language: python
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/spannerIO_Read_2GB_Python.txt
          arguments: |
            --job_name=performance-tests-spanner-read-python-2gb$(date '+%m%d%H%M%S' --utc)
      # The env variables are created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
      - name: run Performance SpannerIO Read 2GB Test Python
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:apache_beam:testing:load_tests:run
          arguments: |
            -PloadTest.mainClass=apache_beam.io.gcp.experimental.spannerio_read_perf_test \
            -Prunner=DataflowRunner \
            -PpythonVersion=3.8 \
            -PloadTest.args='${{env.beam_PerformanceTests_SpannerIO_Read_2GB_Python_test_arguments_1}}'


# 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.

name: PerformanceTests SpannerIO Write 2GB Python Batch

on:
  schedule:
    - cron: '30 11 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_SpannerIO_Write_2GB_Python_Batch:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run SpannerIO Write 2GB Performance Test Python Batch'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 480
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_SpannerIO_Write_2GB_Python_Batch"]
        job_phrase: ["Run SpannerIO Write 2GB Performance Test Python Batch"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: default
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: load
          test-language: python
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/spannerIO_Write_2GB_Python.txt
          arguments: |
            --job_name=performance-tests-spannerio-write-python-batch-2gb$(date '+%m%d%H%M%S' --utc)
      # The env variables are created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
      - name: run Performance SpannerIO Write 2GB Test Python
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:apache_beam:testing:load_tests:run
          arguments: |
            -PloadTest.mainClass=apache_beam.io.gcp.experimental.spannerio_write_perf_test \
            -Prunner=DataflowRunner \
            -PpythonVersion=3.8 \
            -PloadTest.args='${{env.beam_PerformanceTests_SpannerIO_Write_2GB_Python_Batch_test_arguments_1}}'


PerformanceTests SparkReceiver IO

# 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.

name: PerformanceTests SparkReceiver IO

on:
  schedule:
    - cron: '10 11/12 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_SparkReceiver_IO:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Java SparkReceiverIO Performance Test'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 120
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_SparkReceiver_IO"]
        job_phrase: ["Run Java SparkReceiverIO Performance Test"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: Authenticate on GCP
        id: auth
        uses: google-github-actions/auth@v1
        with:
          credentials_json: ${{ secrets.GCP_SA_KEY }}
          project_id: ${{ secrets.GCP_PROJECT_ID }}
      - name: Set k8s access
        uses: ./.github/actions/setup-k8s-access
        with:
          cluster_name: io-datastores
          k8s_namespace: ${{ matrix.job_name }}-${{ github.run_id }}
      - name: Install rabbitmq
        id: install_rabbitmq
        run: |
          kubectl apply -f ${{ github.workspace }}/.test-infra/kubernetes/rabbit/rabbitmq.yaml
          kubectl wait svc/rabbitmq --for=jsonpath='{.status.loadBalancer.ingress[0].ip}' --timeout=60s
          loadbalancer_IP=$(kubectl get svc rabbitmq -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
          echo rabbitmq_IP=$loadbalancer_IP >> $GITHUB_OUTPUT
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: performance
          test-language: java
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/sparkReceiver_IO.txt
          arguments: |
            --rabbitMqBootstrapServerAddress=amqp://guest:guest@${{ steps.install_rabbitmq.outputs.rabbitmq_IP }}:5672
      # The env variables are created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
      - name: run integrationTest
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:sparkreceiver:2:integrationTest
          arguments: |
            --info \
            --tests org.apache.beam.sdk.io.sparkreceiver.SparkReceiverIOIT \
            -DintegrationTestRunner=dataflow \
            -DintegrationTestPipelineOptions='[${{ env.beam_PerformanceTests_SparkReceiver_IO_test_arguments_1 }}]' \


PerformanceTests TFRecordIOIT

# 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.

name: PerformanceTests TFRecordIOIT

on:
  schedule:
    - cron: '50 11/12 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_TFRecordIOIT:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Java TFRecordIO Performance Test'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_TFRecordIOIT"]
        job_phrase: ["Run Java TFRecordIO Performance Test"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: performance
          test-language: java
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/TFRecordIOIT.txt
          arguments: |
            --filenamePrefix=gs://temp-storage-for-perf-tests/${{ matrix.job_name }}/${{github.run_id}}/
      # The env variables are created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
      - name: run integrationTest
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:file-based-io-tests:integrationTest
          arguments: |
            --tests org.apache.beam.sdk.io.tfrecord.TFRecordIOIT \
            --info \
            -Dfilesystem=gcs \
            -DintegrationTestRunner=dataflow \
            -DintegrationTestPipelineOptions='[${{ env.beam_PerformanceTests_TFRecordIOIT_test_arguments_1 }}]'


PerformanceTests TFRecordIOIT HDFS

# 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.

name: PerformanceTests TFRecordIOIT HDFS

on:
  # TODO(https://github.com/apache/beam/issues/18796) TFRecord performance test is failing only when running on hdfs.
  # We need to fix this before enabling this job on jenkins.
  # schedule:
  #   - cron: '50 11/12 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_TFRecordIOIT_HDFS:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Java TFRecordIO Performance Test HDFS'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_TFRecordIOIT_HDFS"]
        job_phrase: ["Run Java TFRecordIO Performance Test HDFS"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: Authenticate on GCP
        id: auth
        uses: google-github-actions/auth@v1
        with:
          credentials_json: ${{ secrets.GCP_SA_KEY }}
          project_id: ${{ secrets.GCP_PROJECT_ID }}
      - name: Set k8s access
        uses: ./.github/actions/setup-k8s-access
        with:
          cluster_name: io-datastores
          k8s_namespace: ${{ matrix.job_name }}-${{ github.run_id }}
      - name: Install Hadoop
        id: install_hadoop
        run: |
          kubectl apply -f ${{ github.workspace }}/.test-infra/kubernetes/hadoop/LargeITCluster/hdfs-multi-datanode-cluster.yml
          kubectl wait svc/hadoop --for=jsonpath='{.status.loadBalancer.ingress[0].ip}' --timeout=60s
          loadbalancer_IP=$(kubectl get svc hadoop -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
          echo hadoop_IP=$loadbalancer_IP >> $GITHUB_OUTPUT
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: performance
          test-language: java
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/TFRecordIOIT_HDFS.txt
          arguments: |
            --filenamePrefix=hdfs://${{ steps.install_hadoop.outputs.hadoop_IP }}:9000/TEXTIO_IT_
            --hdfsConfiguration=[{\\\"fs.defaultFS\\\":\\\"hdfs:${{ steps.install_hadoop.outputs.hadoop_IP }}:9000\\\",\\\"dfs.replication\\\":1}]
      # The env variables are created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
      - name: run integrationTest
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:file-based-io-tests:integrationTest
          arguments: |
            --info \
            --tests org.apache.beam.sdk.io.tfrecord.TFRecordIOIT \
            -Dfilesystem=hdfs \
            -DintegrationTestRunner=dataflow \
            -DintegrationTestPipelineOptions='[${{ env.beam_PerformanceTests_TFRecordIOIT_HDFS_test_arguments_1 }}]' \


PerformanceTests TextIOIT

# 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.

name: PerformanceTests TextIOIT

on:
  schedule:
    - cron: '10 11/12 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_TextIOIT:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Java TextIO Performance Test'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_TextIOIT"]
        job_phrase: ["Run Java TextIO Performance Test"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: performance
          test-language: java
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/textIOIT.txt
          arguments: |
            --filenamePrefix=gs://temp-storage-for-perf-tests/${{ matrix.job_name }}/${{github.run_id}}
      # The env variable is created and populated in the test-arguments-action as "beam_PerformanceTests_TextIOIT_test_arguments_1"
      - name: Run Java TextIO Performance Test
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:file-based-io-tests:integrationTest
          arguments: |
            --tests org.apache.beam.sdk.io.text.TextIOIT \
            --info \
            -Dfilesystem=gcs \
            -DintegrationTestRunner=dataflow \
            '-DintegrationTestPipelineOptions=[${{env.beam_PerformanceTests_TextIOIT_test_arguments_1}}]'


PerformanceTests TextIOIT HDFS

# 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.

name: PerformanceTests TextIOIT HDFS

on:
  schedule:
    - cron: '10 11/12 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_TextIOIT_HDFS:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Java TextIO Performance Test HDFS'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_TextIOIT_HDFS"]
        job_phrase: ["Run Java TextIO Performance Test HDFS"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: Set k8s access
        uses: ./.github/actions/setup-k8s-access
        with:
          cluster_name: io-datastores
          k8s_namespace: ${{ matrix.job_name }}-${{ github.run_id }}
      - name: Install Hadoop
        id: install_hadoop
        run: |
          kubectl apply -f ${{ github.workspace }}/.test-infra/kubernetes/hadoop/LargeITCluster/hdfs-multi-datanode-cluster.yml
          kubectl wait svc/hadoop --for=jsonpath='{.status.loadBalancer.ingress[0].ip}' --timeout=120s
          loadbalancer_IP=$(kubectl get svc hadoop -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
          echo hadoop_IP=$loadbalancer_IP >> $GITHUB_OUTPUT
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: performance
          test-language: java
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/textIOIT_HDFS.txt
          arguments: |
            --filenamePrefix=hdfs://${{ steps.install_hadoop.outputs.hadoop_IP }}:9000/TEXTIO_IT_
            --hdfsConfiguration=[{\\\"fs.defaultFS\\\":\\\"hdfs:${{ steps.install_hadoop.outputs.hadoop_IP }}:9000\\\",\\\"dfs.replication\\\":1}]
      # The env variable is created and populated in the test-arguments-action as "beam_PerformanceTests_TextIOIT_HDFS_test_arguments_1"
      - name: Run Java TextIO Performance Test
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:file-based-io-tests:integrationTest
          arguments: |
            --tests org.apache.beam.sdk.io.text.TextIOIT \
            --info \
            -Dfilesystem=hdfs \
            -DintegrationTestRunner=dataflow \
            -DintegrationTestPipelineOptions='[${{env.beam_PerformanceTests_TextIOIT_HDFS_test_arguments_1}}]'


PerformanceTests TextIOIT Python

# 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.

name: PerformanceTests TextIOIT Python

on:
  schedule:
    - cron: '30 11 * * *'
  workflow_dispatch:

# Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_TextIOIT_Python:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Python TextIO Performance Test'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_TextIOIT_Python"]
        job_phrase: ["Run Python TextIO Performance Test"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: default
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: load
          test-language: python
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/textIOIT_Python.txt
          arguments: |
            --filename_prefix=gs://temp-storage-for-perf-tests/${{ matrix.job_name }}/${{github.run_id}}
      # The env variable is created and populated in the test-arguments-action as "beam_PerformanceTests_TextIOIT_Python_test_arguments_1"
      - name: Run Python TextIO Performance Test
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:apache_beam:testing:load_tests:run
          arguments: |
            -PpythonVersion=3.8 \
            -PloadTest.mainClass=apache_beam.io.filebasedio_perf_test \
            -Prunner=DataflowRunner \
            '-PloadTest.args=${{env.beam_PerformanceTests_TextIOIT_Python_test_arguments_1}}'


# 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.

name: PerformanceTests WordCountIT PythonVersions

on:
  schedule:
    - cron: '50 11/12 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_WordCountIT_PythonVersions:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      (startswith(github.event.comment.body, 'Run Python') &&
        endswith(github.event.comment.body, 'WordCountIT Performance Test'))
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase_1 }} ${{ matrix.python_version }} ${{ matrix.job_phrase_2 }})
    strategy:
      fail-fast: false
      matrix:
        job_name: ["beam_PerformanceTests_WordCountIT_PythonVersions"]
        job_phrase_1: [Run Python]
        job_phrase_2: [WordCountIT Performance Test]
        python_version: ['3.8']
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase_1 }} ${{ matrix.python_version }} ${{ matrix.job_phrase_2 }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase_1 }} ${{ matrix.python_version }} ${{ matrix.job_phrase_2 }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: ${{ matrix.python_version }}
      - name: Set PY_VER_CLEAN
        id: set_py_ver_clean
        run: |
          PY_VER=${{ matrix.python_version }}
          PY_VER_CLEAN=${PY_VER//.}
          echo "py_ver_clean=$PY_VER_CLEAN" >> $GITHUB_OUTPUT
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: load
          test-language: python
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/wordCountIT_Python.txt
          arguments: |
            --job_name=performance-tests-wordcount-python${{steps.set_py_ver_clean.outputs.py_ver_clean}}-batch-1gb$(date '+%m%d%H%M%S' --utc)
            --metrics_table=wordcount_py${{steps.set_py_ver_clean.outputs.py_ver_clean}}_pkb_results
            --influx_measurement=wordcount_py${{steps.set_py_ver_clean.outputs.py_ver_clean}}_results
      # The env variables are created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
      - name: Run test
        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}}:runPerformanceTest
          arguments: |
            --info \
            -Ptest=apache_beam/examples/wordcount_it_test.py::WordCountIT::test_wordcount_it \
            "-Ptest-pipeline-options=${{ env.beam_PerformanceTests_WordCountIT_PythonVersions_test_arguments_1 }}"
      - name: Archive Python Test Results
        uses: actions/upload-artifact@v4
        if: failure()
        with:
          name: Python Test Results
          path: '**/pytest*.xml'
      - name: Publish Python Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        if: always()
        with:
          commit: '${{ env.prsha || env.GITHUB_SHA }}'
          comment_mode: ${{ github.event_name == 'issue_comment'  && 'always' || 'off' }}
          files: '**/pytest*.xml'


PerformanceTests XmlIOIT

# 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.

name: PerformanceTests XmlIOIT

on:
  schedule:
    - cron: '50 11/12 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_XmlIOIT:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Java XmlIO Performance Test'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_XmlIOIT"]
        job_phrase: ["Run Java XmlIO Performance Test"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: performance
          test-language: java
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/xmlIOIT.txt
          arguments: |
            --filenamePrefix=gs://temp-storage-for-perf-tests/${{ matrix.job_name }}/${{github.run_id}}/
      # The env variables are created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
      - name: run integrationTest
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:file-based-io-tests:integrationTest
          arguments: |
            --tests org.apache.beam.sdk.io.xml.XmlIOIT \
            --info \
            -Dfilesystem=gcs \
            -DintegrationTestRunner=dataflow \
            -DintegrationTestPipelineOptions='[${{ env.beam_PerformanceTests_XmlIOIT_test_arguments_1 }}]'


PerformanceTests XmlIOIT HDFS

# 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.

name: PerformanceTests XmlIOIT HDFS

on:
  schedule:
    - cron: '50 11/12 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_XmlIOIT_HDFS:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Java XmlIO Performance Test HDFS'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_XmlIOIT_HDFS"]
        job_phrase: ["Run Java XmlIO Performance Test HDFS"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: Authenticate on GCP
        id: auth
        uses: google-github-actions/auth@v1
        with:
          credentials_json: ${{ secrets.GCP_SA_KEY }}
          project_id: ${{ secrets.GCP_PROJECT_ID }}
      - name: Set k8s access
        uses: ./.github/actions/setup-k8s-access
        with:
          k8s_namespace: ${{ matrix.job_name }}-${{ github.run_id }}
      - name: Install Hadoop
        id: install_hadoop
        run: |
          kubectl apply -f ${{ github.workspace }}/.test-infra/kubernetes/hadoop/LargeITCluster/hdfs-multi-datanode-cluster.yml
          kubectl wait svc/hadoop --for=jsonpath='{.status.loadBalancer.ingress[0].ip}' --timeout=120s
          loadbalancer_IP=$(kubectl get svc hadoop -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
          echo hadoop_IP=$loadbalancer_IP >> $GITHUB_OUTPUT
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: performance
          test-language: java
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/xmlIOIT_HDFS.txt
          arguments: |
            --filenamePrefix=hdfs://${{ steps.install_hadoop.outputs.hadoop_IP }}:9000/TEXTIO_IT_
            --hdfsConfiguration=[{\\\"fs.defaultFS\\\":\\\"hdfs:${{ steps.install_hadoop.outputs.hadoop_IP }}:9000\\\",\\\"dfs.replication\\\":1}]
      # The env variables are created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
      - name: run integrationTest
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:file-based-io-tests:integrationTest
          arguments: |
            --tests org.apache.beam.sdk.io.xml.XmlIOIT \
            --info \
            -Dfilesystem=hdfs \
            -DintegrationTestRunner=dataflow \
            -DintegrationTestPipelineOptions='[${{ env.beam_PerformanceTests_XmlIOIT_HDFS_test_arguments_1 }}]'


PerformanceTests xlang KafkaIO Python

# 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.

name: PerformanceTests xlang KafkaIO Python

on:
  schedule:
    - cron: '30 11 * * *'
  workflow_dispatch:

# Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: write
  checks: write
  contents: read
  deployments: read
  id-token: none
  issues: write
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  INFLUXDB_USER: ${{ secrets.INFLUXDB_USER }}
  INFLUXDB_USER_PASSWORD: ${{ secrets.INFLUXDB_USER_PASSWORD }}

jobs:
  beam_PerformanceTests_xlang_KafkaIO_Python:
    if: |
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Python xlang KafkaIO Performance Test'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 240
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PerformanceTests_xlang_KafkaIO_Python"]
        job_phrase: ["Run Python xlang KafkaIO Performance Test"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: default
      - name: Authenticate on GCP
        id: auth
        uses: google-github-actions/auth@v1
        with:
          credentials_json: ${{ secrets.GCP_SA_KEY }}
          project_id: ${{ secrets.GCP_PROJECT_ID }}
      - name: Set k8s access
        uses: ./.github/actions/setup-k8s-access
        with:
          cluster_name: beam-utility
          k8s_namespace: ${{ matrix.job_name }}-${{ github.run_id }}
          cluster_zone: us-central1
      - name: Install Kafka
        id: install_kafka
        run: |
          kubectl apply -k ${{ github.workspace }}/.test-infra/kafka/strimzi/02-kafka-persistent/overlays/gke-internal-load-balanced
          kubectl wait kafka beam-testing-cluster --for=condition=Ready --timeout=1800s
      - name: Set up Kafka brokers
        id: set_brokers
        run: |
          declare -a kafka_service_brokers
          declare -a kafka_service_brokers_ports
          for INDEX in {0..2}; do
            kubectl wait svc/beam-testing-cluster-kafka-${INDEX} --for=jsonpath='{.status.loadBalancer.ingress[0].ip}' --timeout=1200s
            kafka_service_brokers[$INDEX]=$(kubectl get svc beam-testing-cluster-kafka-${INDEX} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
            kafka_service_brokers_ports[$INDEX]=$(kubectl get svc beam-testing-cluster-kafka-${INDEX} -o jsonpath='{.spec.ports[0].port}')
            echo "KAFKA_SERVICE_BROKER_${INDEX}=${kafka_service_brokers[$INDEX]}" >> $GITHUB_OUTPUT
            echo "KAFKA_SERVICE_BROKER_PORTS_${INDEX}=${kafka_service_brokers_ports[$INDEX]}" >> $GITHUB_OUTPUT
          done
      - name: Prepare test arguments
        uses: ./.github/actions/test-arguments-action
        with:
          test-type: load
          test-language: python
          argument-file-paths: |
            ${{ github.workspace }}/.github/workflows/performance-tests-pipeline-options/xlang_KafkaIO_Python.txt
          arguments: |
            --filename_prefix=gs://temp-storage-for-perf-tests/${{ matrix.job_name }}/${{github.run_id}}/
            --bootstrap_servers=${{ steps.set_brokers.outputs.KAFKA_SERVICE_BROKER_0 }}:${{ steps.set_brokers.outputs.KAFKA_SERVICE_BROKER_PORTS_0 }},${{ steps.set_brokers.outputs.KAFKA_SERVICE_BROKER_1 }}:${{ steps.set_brokers.outputs.KAFKA_SERVICE_BROKER_PORTS_1 }},${{ steps.set_brokers.outputs.KAFKA_SERVICE_BROKER_2 }}:${{ steps.set_brokers.outputs.KAFKA_SERVICE_BROKER_PORTS_2 }}
      - name: run shadowJar
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:java:io:expansion-service:shadowJar
      # The env variable is created and populated in the test-arguments-action as "<github.job>_test_arguments_<argument_file_paths_index>"
      - name: run integrationTest
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:apache_beam:testing:load_tests:run
          arguments: |
            -Prunner=DataflowRunner \
            -PloadTest.mainClass=apache_beam.io.external.xlang_kafkaio_perf_test \
            -PpythonVersion=3.8 \
            '-PloadTest.args=${{ env.beam_PerformanceTests_xlang_KafkaIO_Python_test_arguments_1 }}'


Playground CI Nightly

# 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.

name: Playground CI Nightly

on:
  schedule:
    - cron: '20 */12 * * *'
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: read
  checks: read
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  BEAM_ROOT_DIR: /runner/_work/beam/beam

jobs:
  beam_Playground_CI_Nightly:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam')
    runs-on: [self-hosted, ubuntu-20.04, highmem]
    name: "beam_Playground_CI_Nightly"
    strategy:
      matrix:
        sdk: ["python", "java", "go"]
      fail-fast: false
    steps:
      - uses: actions/checkout@v4
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          python-version: default
      - name: Install requirements
        run: |
          cd $BEAM_ROOT_DIR/playground/infrastructure
          pip install -r requirements.txt
      - name: Get Beam latest release
        run: |
          BEAM_VERSION=$(curl -s https://api.github.com/repos/apache/beam/releases/latest | jq -r '.tag_name')
          echo "BEAM_VERSION=${BEAM_VERSION#v}" >> $GITHUB_ENV
      - name: Build PYTHON base
        if: ${{ matrix.sdk == 'python' }}
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:python:container:py310:docker -Pdocker-tag=nightly -Pdocker-pull-licences=true
      - name: Build SDK container
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :playground:backend:containers:${{ matrix.sdk }}:docker -Pdocker-tag=nightly -Psdk-tag=$BEAM_VERSION -Pdocker-pull-licences=true
      - name: Run SDK container
        run: |
          CONTAINER_ID=$(docker run -d -e PROTOCOL_TYPE=TCP apache/beam_playground-backend-${{ matrix.sdk }}:nightly)
          echo "container_id=$CONTAINER_ID" >> $GITHUB_ENV
      - name: Get Container IP
        run: |
          CONTAINER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${{ env.container_id }})
          echo "container_ip=$CONTAINER_IP" >> $GITHUB_ENV
      - name: Run CI
        env:
          SERVER_ADDRESS: ${{ env.container_ip }}:8080
          BEAM_EXAMPLE_CATEGORIES: ${{ env.BEAM_ROOT_DIR }}/playground/categories.yaml
          SDK: ${{ matrix.sdk }}
        run: |
          cd $BEAM_ROOT_DIR/playground/infrastructure
          python ci_cd.py --step CI --sdk SDK_${SDK^^} --origin PG_EXAMPLES --subdirs ./learning/katas ./examples ./sdks


PostCommit Go

# 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.

name: PostCommit Go

on:
  schedule:
    - cron: '30 3/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Go.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: read
  checks: read
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_Go:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Go PostCommit'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 300
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_Go"]
        job_phrase: ["Run Go PostCommit"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      - name: GCloud Docker credential helper
        run: |
          gcloud auth configure-docker us.gcr.io
      - name: run Go PostCommit script
        uses: ./.github/actions/gradle-command-self-hosted-action
        env:
          USER: github-actions
        with:
          gradle-command: :goPostCommit
          arguments: |
            --no-parallel \
            -Pdocker-repository-root=us.gcr.io/apache-beam-testing/github-actions


PostCommit Go Dataflow ARM

# 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.

name: PostCommit Go Dataflow ARM

on:
  issue_comment:
    types: [created]
  schedule:
    - cron: '30 3/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Go_Dataflow_ARM.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: read
  checks: read
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_Go_Dataflow_ARM:
    if: |
      github.event_name == 'push' ||
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Go PostCommit Dataflow ARM'
    runs-on: [self-hosted, ubuntu-20.04, main]
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_Go_Dataflow_ARM"]
        job_phrase: ["Run Go PostCommit Dataflow ARM"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
        with:
          java-version: default
          go-version: default
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      - name: GCloud Docker credential helper
        run: |
          gcloud auth configure-docker us.gcr.io
      - name: run goPostCommitDataflowARM script
        run: ./gradlew :goPostCommitDataflowARM
        env:
          USER: github-actions


PostCommit Go VR Flink

# 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.

name: PostCommit Go VR Flink

on:
  schedule:
    - cron: '30 3/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Go_VR_Flink.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: read
  checks: read
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_Go_VR_Flink:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Go Flink ValidatesRunner'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_Go_VR_Flink"]
        job_phrase: ["Run Go Flink ValidatesRunner"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: run Go Flink ValidatesRunner script
        env:
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:go:test:flinkValidatesRunner


PostCommit Go VR Samza

# 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.

name: PostCommit Go VR Samza

on:
  schedule:
    - cron: '30 3/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Go_VR_Samza.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: read
  checks: read
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_Go_VR_Samza:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Go Samza ValidatesRunner'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_Go_VR_Samza"]
        job_phrase: ["Run Go Samza ValidatesRunner"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: run Go Samza ValidatesRunner script
        env:
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:go:test:samzaValidatesRunner


PostCommit Go VR Spark

# 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.

name: PostCommit Go VR Spark

on:
  schedule:
    - cron: '30 3/6 * * *'
  pull_request_target:
    paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Go_VR_Spark.json']
  workflow_dispatch:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
  actions: write
  pull-requests: read
  checks: read
  contents: read
  deployments: read
  id-token: none
  issues: read
  discussions: read
  packages: read
  pages: read
  repository-projects: read
  security-events: read
  statuses: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
  cancel-in-progress: true

env:
  DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
  GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}

jobs:
  beam_PostCommit_Go_VR_Spark:
    if: |
      github.event_name == 'workflow_dispatch' ||
      github.event_name == 'pull_request_target' ||
      (github.event_name == 'schedule' && github.repository == 'apache/beam') ||
      github.event.comment.body == 'Run Go Spark ValidatesRunner'
    runs-on: [self-hosted, ubuntu-20.04, main]
    timeout-minutes: 100
    name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
    strategy:
      matrix:
        job_name: ["beam_PostCommit_Go_VR_Spark"]
        job_phrase: ["Run Go Spark ValidatesRunner"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup repository
        uses: ./.github/actions/setup-action
        with:
          comment_phrase: ${{ matrix.job_phrase }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
      - name: Setup environment
        uses: ./.github/actions/setup-environment-action
      - name: run Go Spark ValidatesRunner script
        env:
          CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
        uses: ./.github/actions/gradle-command-self-hosted-action
        with:
          gradle-command: :sdks:go:test:sparkValidatesRunner