Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 30 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Licensed 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.
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.go]
indent_style = tab
indent_size = 4

[Dockerfile]
indent_size = 4
2 changes: 1 addition & 1 deletion .gemini/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ code_review:

# Post PR summary when opened.
# Type boolean, default: true.
summary: true
summary: true

# Post code review on PR open.
# Type boolean, default: true.
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/activate-service-account/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ runs:
- name: Removing Keyfile
if: ${{ always() }}
shell: bash
run: rm -f /tmp/gcp_access.json
run: rm -f /tmp/gcp_access.json
1 change: 0 additions & 1 deletion .github/actions/common-rc-validation/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,3 @@ runs:
- name: Installing python SDK
shell: bash
run: pip install apache_beam-${RELEASE_VER}.tar.gz[gcp]

22 changes: 11 additions & 11 deletions .github/actions/rerun-job-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# under the License.


#Action used to trigger a failed check re-run within a PR using a comment. Add this action to your workflow with an if condition
#to check if the comment is present
#Action used to trigger a failed check re-run within a PR using a comment. Add this action to your workflow with an if condition
#to check if the comment is present
#If the check is failed this will trigger it again. If its not failed a new instance of workflow will run which will not show in the status box or checks tab in the PR and can be found in the actions tab https://github.com/apache/beam/actions

name: "Rerun Job Action"
Expand Down Expand Up @@ -45,17 +45,17 @@ runs:
steps:
- name: Get Last Commit SHA
shell: bash
run: |
run: |
URL=${{inputs.pull_request_url}}/commits
PRSHA=$(curl \
-H 'Authorization: Bearer ${{inputs.github_token}}' \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-s $URL | jq -r '.[-1].sha' )
-s $URL | jq -r '.[-1].sha' )
echo prsha=$PRSHA >> $GITHUB_ENV
- name: Get Status and Conclusion for PR Job
shell: bash
run: |
run: |
JOB="${{inputs.github_job}}"
QUERY_JOB=${JOB// /+}
URL="${{github.api_url}}/repos/${{inputs.github_repository}}/commits/${{env.prsha}}/check-runs?check_name=$QUERY_JOB"
Expand All @@ -73,7 +73,7 @@ runs:
echo status=$STATUS >> $GITHUB_ENV
echo conclusion=$CONCLUSION >> $GITHUB_ENV
echo check_suite_id=$CHECK_SUITE_ID >> $GITHUB_ENV


- name: Disable Rerun for Success or Skipped
if: ${{(env.status == 'completed' && (env.conclusion == 'success' || env.conclusion == 'skipped')) || env.skip == 'true'}}
Expand All @@ -83,7 +83,7 @@ runs:
- name: Get Run ID
if: ${{env.rerun != 'false' }}
shell: bash
run: |
run: |
URL="${{github.api_url}}/repos/${{inputs.github_repository}}/actions/runs?check_suite_id=${{env.check_suite_id}}"
RUN_ID=$(curl \
-H 'Authorization: Bearer ${{inputs.github_token}}' \
Expand All @@ -94,7 +94,7 @@ runs:
- name: Get Job ID
if: ${{env.rerun != 'false' }}
shell: bash
run: |
run: |
URL="${{github.api_url}}/repos/${{inputs.github_repository}}/actions/runs/${{env.run_id}}/jobs"
JOB_ID=$(curl \
-H 'Authorization: Bearer ${{inputs.github_token}}' \
Expand All @@ -105,13 +105,13 @@ runs:
- name: Trigger Re-run
if: ${{env.rerun != 'false' }}
shell: bash
run: |
run: |
URL="${{github.api_url}}/repos/${{inputs.github_repository}}/actions/jobs/${{env.job_id}}/rerun"
curl -X POST \
-H 'Authorization: Bearer ${{inputs.github_token}}' \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-s $URL
-s $URL
- name: Install GH Cli
if: ${{env.rerun != 'false' }}
shell: bash
Expand All @@ -126,4 +126,4 @@ runs:
gh run cancel ${{ inputs.github_current_run_id }}
gh run watch ${{ inputs.github_current_run_id }}
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
GITHUB_TOKEN: ${{ inputs.github_token }}
2 changes: 1 addition & 1 deletion .github/actions/setup-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ runs:
with:
github_token: ${{ inputs.github_token }}
github_job: ${{ inputs.github_job || github.job }}
github_repository: ${{ github.repository }}
github_repository: ${{ github.repository }}
github_current_run_id: ${{ github.run_id }}
pull_request_url: ${{ github.event.issue.pull_request.url }}
## Used for jobs that spawn docker containers and need to mount gcloud config directory
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-default-test-properties/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ runs:
shell: bash
run: |
JSON=$(cat ./.github/actions/setup-default-test-properties/test-properties.json)
echo "test-properties=$(echo $JSON)" >> $GITHUB_OUTPUT
echo "test-properties=$(echo $JSON)" >> $GITHUB_OUTPUT
8 changes: 4 additions & 4 deletions .github/actions/setup-k8s-access/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# under the License.


#Action used to trigger a failed check re-run within a PR using a comment. Add this action to your workflow with an if condition
#to check if the comment is present
#Action used to trigger a failed check re-run within a PR using a comment. Add this action to your workflow with an if condition
#to check if the comment is present
#If the check is failed this will trigger it again. If its not failed a new instance of workflow will run which will not show in the status box or checks tab in the PR and can be found in the actions tab https://github.com/apache/beam/actions

name: "Setup Kuberenetes Access"
Expand All @@ -44,7 +44,7 @@ runs:
steps:
- name: Check if inputs were provided
shell: bash
run: |
run: |
if [ -z "${{ inputs.k8s_namespace }}" ]; then
echo "Kubernetes namespace not provided"
exit 1
Expand All @@ -61,7 +61,7 @@ runs:
gcloud container clusters get-credentials ${{ inputs.cluster_name }} --zone ${{ inputs.cluster_zone }} --project apache-beam-testing
- name: Create namespace
shell: bash
run: |
run: |
kubectl create namespace ${{ steps.replace_namespace.outputs.TEST_NAMESPACE }}
- name: Set default namespace
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/test-arguments-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ runs:
steps:
- name: Check if test-type was provided
shell: bash
run: |
run: |
if [ -z "${{ inputs.test-type }}" ]; then
echo "Test type was not provided"
exit 1
fi
- name: Check if test-language was provided
shell: bash
run: |
run: |
if [ -z "${{ inputs.test-language }}" ]; then
echo "Test language was not provided"
exit 1
Expand Down
4 changes: 2 additions & 2 deletions .github/autolabeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ io: ["sdks/go/pkg/beam/io/**/*", "sdks/java/io/**/*", "sdks/python/apache_beam/
"mqtt": ["sdks/java/io/mqtt/**/*"]
"parquet": ["sdks/java/io/parquet/**/*"]
"rabbitmq": ["sdks/java/io/rabbitmq/**/*"]
"redis": ["sdks/java/io/redis/**/*"]
"redis": ["sdks/java/io/redis/**/*"]
"solr": ["sdks/java/io/solr/**/*"]
"spanner": ["sdks/go/pkg/beam/io/spannerio/**/*", "sdks/python/apache_beam/io/gcp/spanner.py", "sdks/python/apache_beam/io/gcp/experimental/spannerio.py", "sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/**/*"]
"bigtable": ["sdks/go/pkg/beam/io/bigtableio/**/*", "sdks/go/pkg/beam/io/xlang/bigtableio/**/*", "sdks/python/apache_beam/io/gcp/bigtableio.py", "sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/**/*"]
Expand All @@ -76,7 +76,7 @@ io: ["sdks/go/pkg/beam/io/**/*", "sdks/java/io/**/*", "sdks/python/apache_beam/
"thrift": ["sdks/java/io/thrift/**/*"]
"tika": ["sdks/java/io/tika/**/*"]
"xml": ["sdks/java/io/xml/**/*"]

# Runners
"runners": ["runners/**/*", "sdks/go/pkg/beam/runners/**/*", "sdks/python/apache_beam/runners/**/*", "sdks/typescript/src/apache_beam/runners/**/*"]
"core": ["runners/core-java/**/*"]
Expand Down
2 changes: 1 addition & 1 deletion .github/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ task check {

task preCommit {
dependsOn check
}
}
8 changes: 4 additions & 4 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ coverage:
status:
project:
python:
flags:
flags:
- python
target: auto
threshold: 5%
base: auto
paths:
- "sdks/python"
go:
flags:
flags:
- go
target: auto
threshold: 5%
base: auto
paths:
- "sdks/go/pkg"
java:
flags:
flags:
- java
target: auto
threshold: 5%
Expand All @@ -63,7 +63,7 @@ parsers:

fixes:
- "apache_beam/::sdks/python/apache_beam/"

github_checks:
annotations: false

Expand Down
2 changes: 1 addition & 1 deletion .github/gh-actions-self-hosted-runners/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ Depending on the termination event, sometimes the removal script for offline run
This was implemented using a [GCP Cloud Function](https://console.cloud.google.com/functions/details/us-central1/remove-self-hosted-runners-group?env=gen1&project=apache-beam-testing&tab=source) [[code]](./helper-functions/cloud-functions/removeOfflineRunners) subscribed to a [Pub/Sub](https://console.cloud.google.com/cloudpubsub/topic/detail/remove-runners?referrer=search&project=apache-beam-testing) topic, the topic is triggered through a [Cloud Scheduler](https://console.cloud.google.com/cloudscheduler/jobs/edit/us-central1/runners-clean-up-schedule?project=apache-beam-testing) that is executed once per day, the function consumes a [GitHub API](https://docs.github.com/en/rest/reference/actions#delete-a-self-hosted-runner-from-an-organization) to delete offline self-hosted runners from the organization retrieving the token with its service account to secrets manager.


![Delete Offline Self-hosted Runners](diagrams/self-hosted-runners-delete-function.png)
![Delete Offline Self-hosted Runners](diagrams/self-hosted-runners-delete-function.png)
1 change: 0 additions & 1 deletion .github/gh-actions-self-hosted-runners/arc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,3 @@ terraform apply -var-file=environments/environment_name.env
# Maintanance

- To access the ARC k8s cluster call the `get_kubeconfig_command` terraform output and run the command

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
dockerMTU: 1460
%{~ if selector == true ~}
nodeSelector:
runner-pool: ${name}
runner-pool: ${name}
%{~ endif ~}
%{~ if taint == true ~}
tolerations:
Expand Down Expand Up @@ -61,4 +61,3 @@ spec:
memory: ${limits.memory}
%{~ endif ~}
%{~ endif ~}

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ project_id = "apache-beam-testing"
region = "us-central1"
zone = "us-central1-b"
environment = "beam-prod"
ingress_domain = "action.beam.apache.org"
ingress_domain = "action.beam.apache.org"
organization = "apache"
repository = "beam"
github_app_id_secret_name = "gh-app_id"
Expand Down
4 changes: 2 additions & 2 deletions .github/gh-actions-self-hosted-runners/arc/gke.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ resource "google_container_node_pool" "additional_runner_pools" {
labels = {
"runner-pool" = each.value.name
}

dynamic "taint" {
for_each = each.value.enable_taint == true ? [1] : []
content {
Expand All @@ -103,4 +103,4 @@ data "google_compute_global_address" "actions-runner-ip" {

data google_service_account "service_account" {
account_id = var.service_account_id
}
}
2 changes: 1 addition & 1 deletion .github/gh-actions-self-hosted-runners/arc/helm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "helm_release" "cert-manager" {
create_namespace = true
repository = "https://charts.jetstack.io"
chart = "cert-manager"

atomic = "true"
timeout = 100

Expand Down
2 changes: 1 addition & 1 deletion .github/gh-actions-self-hosted-runners/arc/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
data "google_client_config" "provider" {}

data "google_client_openid_userinfo" "provider_identity" {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ gcloud auth configure-docker us-central1-docker.pkg.dev
```
docker push us-central1-docker.pkg.dev/apache-beam-testing/beam-github-actions/beam-arc-runner:$RUNNER_IMAGE_TAG
docker push us-central1-docker.pkg.dev/apache-beam-testing/beam-github-actions/beam-arc-runner:$(git rev-parse --short HEAD)
```
```
2 changes: 1 addition & 1 deletion .github/gh-actions-self-hosted-runners/arc/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ locals {
"githubWebhookServer.ingress.annotations.networking\\.gke\\.io/managed-certificates" = "managed-cert"
"githubWebhookServer.ingress.annotations.kubernetes\\.io/ingress\\.class" = "gce"
}
}
}
1 change: 0 additions & 1 deletion .github/gh-actions-self-hosted-runners/arc/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ output "ingress_ip" {
output "get_kubeconfig_command" {
value = "gcloud container clusters get-credentials ${google_container_cluster.actions-runner-gke.name} --region ${var.zone} --project ${var.project_id}"
}

4 changes: 2 additions & 2 deletions .github/gh-actions-self-hosted-runners/arc/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ provider "github" {
installation_id = data.google_secret_manager_secret_version.github_app_install_id.secret_data
}
owner = var.organization
}

}
2 changes: 1 addition & 1 deletion .github/gh-actions-self-hosted-runners/arc/secrets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ data "google_secret_manager_secret_version" "github_app_install_id" {
data "google_secret_manager_secret_version" "github_private_key" {
project = var.project_id
secret = var.github_private_key_secret_name
}
}
Loading
Loading