diff --git a/.github/workflows/README.md b/.github/workflows/README.md index b39dfc9d5924..f882553ef9bf 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -79,6 +79,7 @@ jobs: github.event_name == 'push' || github.event_name == 'pull_request_target' || (github.event_name == 'schedule' && github.repository == 'apache/beam') || + github.event_name == 'workflow_dispatch' || startsWith(github.event.comment.body, 'Run Job With Matrix') steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/beam_CleanUpDataprocResources.yml b/.github/workflows/beam_CleanUpDataprocResources.yml index 86a3e42c3893..9e56230ffdbe 100644 --- a/.github/workflows/beam_CleanUpDataprocResources.yml +++ b/.github/workflows/beam_CleanUpDataprocResources.yml @@ -17,7 +17,7 @@ name: Cleanup Dataproc Resources on: schedule: - - cron: '0 */6 * * *' + - cron: '0 0 * * *' workflow_dispatch: #Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event diff --git a/.test-infra/dataproc/cleanup.sh b/.test-infra/dataproc/cleanup.sh index ac12a0bff05c..95eea525a2e1 100755 --- a/.test-infra/dataproc/cleanup.sh +++ b/.test-infra/dataproc/cleanup.sh @@ -44,8 +44,8 @@ function filterClusters(){ elapsedHours=$((($currentDate - $clusterStartTime)/3600)) - #Most of the jobs commonly finish in less than one hour - if [[ $elapsedHours -ge 2 ]]; then + # teardown clusters >= 6 hr old + if [[ $elapsedHours -ge 6 ]]; then for name in ${generatedResources[@]}; do # Only resources generated by the groovy jobs set are queued for deletion if [[ "$cluster" == *${name}* && ! ("$cluster" =~ nokill) ]]; then