diff --git a/.github/workflows/job-postcommit-beam-metrics-publish.yml b/.github/workflows/job-postcommit-beam-metrics-publish.yml new file mode 100644 index 000000000000..1cbbae1d52d7 --- /dev/null +++ b/.github/workflows/job-postcommit-beam-metrics-publish.yml @@ -0,0 +1,55 @@ +# 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. + +# To learn more about GitHub Actions in Apache Beam check the CI.md + +# Applies new configuration to Beam Metrics infrastructure. + +name: PostCommit Beam Metrics Publish + +on: + workflow_dispatch: + schedule: + - cron: '0 */6 * * *' + push: + branches: ['master'] +permissions: read-all + +jobs: + postcommit-beam-metrics-publish: + name: Run PostCommit Beam Metrics Publish + runs-on: [self-hosted, ubuntu-20.04] + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + persist-credentials: false + submodules: false + - name: Setup environment + uses: ./.github/actions/setup-self-hosted-action + - name: Install kubectl + uses: azure/setup-kubectl@v3 + - name: Configure Docker + run: | + gcloud auth configure-docker + - name: Get Credentials + run: | + gcloud container clusters get-credentials metrics-migration-test --zone us-central1-c --project apache-beam-testing + - name: Run :beam-test-infra-metrics:deploy + uses: ./.github/actions/gradle-command-self-hosted-action + with: + gradle-command: :beam-test-infra-metrics:deploy diff --git a/.test-infra/jenkins/README.md b/.test-infra/jenkins/README.md index 08b9665a92ba..7c923e69a96a 100644 --- a/.test-infra/jenkins/README.md +++ b/.test-infra/jenkins/README.md @@ -61,7 +61,6 @@ Beam Jenkins overview page: [link](https://ci-beam.apache.org/) | Name | Link | PR Trigger Phrase | Cron Status | |------|------|-------------------|-------------| -| beam_PostCommit_BeamMetrics_Publish | [cron](https://ci-beam.apache.org/job/beam_PostCommit_BeamMetrics_Publish/) | N/A | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_BeamMetrics_Publish/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_BeamMetrics_Publish) | | beam_PostCommit_XVR_Flink | [cron](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Flink/), [phrase](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Flink_PR/) | `Run XVR_Flink PostCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Flink/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Flink) | | beam_PostCommit_XVR_Samza | [cron](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Samza/), [phrase](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Samza_PR/) | `Run XVR_Samza PostCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Samza/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Samza) | | beam_PostCommit_XVR_Spark | [cron](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Spark/), [phrase](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Spark_PR/) | `Run XVR_Spark PostCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Spark/badge/icon)](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Spark) | diff --git a/.test-infra/jenkins/job_PostCommit_BeamMetrics_Publish.groovy b/.test-infra/jenkins/job_PostCommit_BeamMetrics_Publish.groovy deleted file mode 100644 index 34912d2825f1..000000000000 --- a/.test-infra/jenkins/job_PostCommit_BeamMetrics_Publish.groovy +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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, eit her express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import CommonJobProperties as commonJobProperties -import Kubernetes -import PostcommitJobBuilder - -PostcommitJobBuilder.postCommitJob('beam_PostCommit_BeamMetrics_Publish', 'Run Beam Metrics deployment', - 'Beam Metrics deployment', this) { - - description('Applies new configuration to Beam Metrics infrastructure.') - - // Set common parameters. - commonJobProperties.setTopLevelMainJobProperties(delegate) - - String kubeconfig = commonJobProperties.getKubeconfigLocationForNamespace('default') - Kubernetes.create(delegate, kubeconfig, '', 'metrics') - - steps { - gradle { - rootBuildScriptDir(commonJobProperties.checkoutDir) - tasks(':beam-test-infra-metrics:deploy') - commonJobProperties.setGradleSwitches(delegate) - } - } - } diff --git a/CI.md b/CI.md index ed75a4dd4433..cef80d1010dc 100644 --- a/CI.md +++ b/CI.md @@ -125,6 +125,23 @@ Service Account shall have following permissions ([IAM roles](https://cloud.goog | Java Wordcount Direct Runner | Runs Java WordCount example with Direct Runner. | Yes | Yes | Yes | - | | Java Wordcount Dataflow | Runs Java WordCount example with DataFlow Runner. | - | Yes | Yes | Yes | +### All migrated workflows run based on the following triggers + +| Description | Pull Request Run | Direct Push/Merge Run | Scheduled Run | Workflow Dispatch | +|-------------|------------------|-----------------------|---------------|-------------------| +| PostCommit | No | Yes | Yes | Yes | +| PreCommit | Yes | Yes | Yes | Yes | + +### PreCommit Workflows +| Workflow | Description | Requires GCP Credentials | +|----------------------------------------------------------------------------------|-------------------------|---------------------------| +| [job-precommit-placeholder.yml](.github/workflows/job-precommit-placeholder.yml) | Description placeholder | Yes/No | + +### PostCommit Workflows +| Workflow | Description | Requires GCP Credentials | +|------------------------------------------------------------------------------------------------------|----------------------------------------------------------|--------------------------| +| [job-postcommit-beam-metrics-publish.yml](.github/workflows/job-postcommit-beam-metrics-publish.yml) | Applies new configuration to Beam Metrics infrastructure | Yes | + ### GitHub Action Tips * If you introduce changes to the workflow it is possible that your changes will not be present in the check run triggered in Pull Request.