Skip to content

chore(ci): restrict k8s workflow runs #17416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 19, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions .github/workflows/k8s_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
# - manual dispatch in GH UI
# - on a PR commit if the kubernetes_logs source was changed
# - in the merge queue
# - on a schedule at midnight UTC Tue-Sat
# - on demand by either of the following comments in a PR:
# - '/ci-run-k8s'
# - '/ci-run-all'
#
# If the workflow trigger is the nightly schedule, all the k8s versions
# are run in the matrix, otherwise, only the latest is run.

name: K8S E2E Suite

Expand All @@ -18,10 +21,12 @@ on:
types: [created]
merge_group:
types: [checks_requested]
schedule:
# At midnight UTC Tue-Sat
- cron: '0 0 * * 2-6'
Comment on lines +24 to +26
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will we be notified if the scheduled build fails? I just want to make sure it doesn't slip through the cracks. Maybe we could take this opportunity to setup a Slack notification?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 Datadog Monitor 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh, yeah that's kinda important lol.
I'll take a look at adding a Datadog Monitor.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some research and discussion, we will try the GHA workflow notifications in slack first and pivot if needed.
There aren't any edits needed to the workflow file itself for that.


concurrency:
# `github.event.number` exists for PRs, issue.id for comments, merge_group for merge queue otherwise fall back to SHA
group: ${{ github.workflow }}-${{ github.event.number || github.event.issue.id || github.event.merge_group.base_sha || github.sha }}
group: ${{ github.workflow }}-${{ github.event.number || github.event.issue.id || github.event.merge_group.base_sha || github.event.schedule || github.sha }}

cancel-in-progress: true

Expand Down Expand Up @@ -151,11 +156,11 @@ jobs:
// https://cloud.google.com/kubernetes-engine/docs/release-notes
// https://docs.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-kubernetes-release-calendar
const kubernetes_version = [
{ version: "v1.23.3", is_essential: true },
{ version: "v1.22.5", is_essential: true },
{ version: "v1.21.8", is_essential: true },
{ version: "v1.20.14", is_essential: true },
{ version: "v1.19.8" },
{ version: "v1.23.3", is_essential: true },
{ version: "v1.22.5", is_essential: false },
{ version: "v1.21.8", is_essential: false },
{ version: "v1.20.14", is_essential: false },
{ version: "v1.19.8", is_essential: false },
]
const container_runtime = [
"docker",
Expand All @@ -164,12 +169,9 @@ jobs:
// "crio",
]

// Planning.
const is_in_pull_request = !!context.payload.pull_request;
const should_test_all_targets = (
!is_in_pull_request
)
const filter_targets = array => array.filter(val => should_test_all_targets || val.is_essential)
// Run all versions if triggered by nightly schedule. Otherwise only run latest.
const run_all = context.eventName == "schedule";
const filter_targets = array => array.filter(val => run_all || val.is_essential)

const matrix = {
minikube_version,
Expand Down Expand Up @@ -237,7 +239,7 @@ jobs:
status: 'failure'

final-result:
name: K8s E2E Test Suite
name: K8s E2E Suite
runs-on: ubuntu-latest
needs: test-e2e-kubernetes
if: |
Expand Down