diff --git a/.github/workflows/job-precommit-community-metrics.yml b/.github/workflows/job-precommit-community-metrics.yml new file mode 100644 index 000000000000..b2c62c96f206 --- /dev/null +++ b/.github/workflows/job-precommit-community-metrics.yml @@ -0,0 +1,54 @@ +# 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: PreCommit Community Metrics + +on: + workflow_dispatch: + schedule: + - cron: '0 */6 * * *' + push: + branches: ['master', 'release-*'] + tags: 'v*' + pull_request_target: + branches: ['master', 'release-*'] + tags: 'v*' + paths: ['test-infra/metrics/**'] +permissions: read-all + +jobs: + community-metrics: + name: Community Metrics + runs-on: [self-hosted, ubuntu-20.04] + timeout-minutes: 120 + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + persist-credentials: false + submodules: recursive + - name: Setup environment + uses: ./.github/actions/setup-self-hosted-action + - name: Install kubectl + shell: bash + run: sudo apt-get install kubectl + - name: Run :communityMetricsPreCommit + uses: ./.github/actions/gradle-command-self-hosted-action + with: + gradle-command: :communityMetricsPreCommit + diff --git a/.github/workflows/job-precommit-python-docker.yml b/.github/workflows/job-precommit-python-docker.yml new file mode 100644 index 000000000000..079cdc21df3b --- /dev/null +++ b/.github/workflows/job-precommit-python-docker.yml @@ -0,0 +1,56 @@ +# 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: PreCommit Python Docker + +on: + workflow_dispatch: + schedule: + - cron: '0 */6 * * *' + push: + branches: ['master', 'release-*'] + tags: 'v*' + pull_request_target: + branches: ['master', 'release-*'] + tags: 'v*' + paths: + - 'model/**' + - 'sdks/python/**' + - 'release/**' +permissions: read-all + +jobs: + python-docker: + name: Python Docker + runs-on: [self-hosted, ubuntu-20.04] + timeout-minutes: 30 + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + persist-credentials: false + - name: Setup environment + uses: ./.github/actions/setup-self-hosted-action + - name: Install kubectl + shell: bash + run: sudo apt-get install kubectl + - name: Run :pythonDockerBuildPreCommit + uses: ./.github/actions/gradle-command-self-hosted-action + with: + gradle-command: :pythonDockerBuildPreCommit + arguments: "--info" \ No newline at end of file diff --git a/.test-infra/jenkins/job_PreCommit_Python_DockerBuild.groovy b/.test-infra/jenkins/job_PreCommit_Python_DockerBuild.groovy deleted file mode 100644 index 360fc7e27ed1..000000000000 --- a/.test-infra/jenkins/job_PreCommit_Python_DockerBuild.groovy +++ /dev/null @@ -1,33 +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, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import PrecommitJobBuilder - -PrecommitJobBuilder builder = new PrecommitJobBuilder( - scope: this, - nameBase: 'PythonDocker', - gradleTask: ':pythonDockerBuildPreCommit', - gradleSwitches: ['--info'], - timeoutMins: 30, - triggerPathPatterns: [ - '^model/.*$', - '^sdks/python/.*$', - '^release/.*$', - ] - ) -builder.build() diff --git a/CI.md b/CI.md index cb26171654b2..1ad4e2a27184 100644 --- a/CI.md +++ b/CI.md @@ -153,10 +153,11 @@ Service Account shall have following permissions ([IAM roles](https://cloud.goog | PreCommit | Yes | Yes | Yes | Yes | ### PreCommit Workflows +| Workflow | Description | Requires GCP Credentials | +|----------------------------------------------------------------------------------------------|------------------------------|--------------------------| +| [job-precommit-community-metrics.yml](.github/workflows/job-precommit-community-metrics.yml) | Runs Community Metrics tests | No | +| [job-precommit-python-docker.yml](.github/workflows/job-precommit-python-dockers.yml) | Runs Python Docker tests | No | -| Workflow | Description | Requires GCP Credentials | -|----------------------------------------------------------------------------------|-------------------------|---------------------------| -| [job-precommit-placeholder.yml](.github/workflows/job-precommit-placeholder.yml) | Description placeholder | Yes/No | ### PostCommit Workflows diff --git a/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/environment/DockerEnvironmentFactory.java b/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/environment/DockerEnvironmentFactory.java index ee816a944e5a..edead73227d7 100644 --- a/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/environment/DockerEnvironmentFactory.java +++ b/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/environment/DockerEnvironmentFactory.java @@ -182,8 +182,7 @@ private List gcsCredentialArgs() { // TODO(https://github.com/apache/beam/issues/19061): Allow this to be disabled manually. if (Files.exists(Paths.get(localGcloudConfig))) { return ImmutableList.of( - "--mount", - String.format("type=bind,src=%s,dst=%s", localGcloudConfig, dockerGcloudConfig)); + "-v", String.format("type=bind,src=%s,dst=%s", localGcloudConfig, dockerGcloudConfig)); } else { return ImmutableList.of(); }