-
Notifications
You must be signed in to change notification settings - Fork 55
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
build: use also different K8s versions for E2E testing in GHA #659
Merged
google-oss-prow
merged 5 commits into
kubeflow:main
from
tarilabs:tarilabs-20241216-matrixK8sVersionE2E
Dec 18, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5cddf56
build: use also different K8s versions for E2E testing in GHA
tarilabs 7bf5582
refactor matrix GHA
tarilabs ecd8778
demo on PR how it would look on main merges
tarilabs f41b2cd
revert as intentended on PR
tarilabs 6f72bfd
add K8s version on suggestion by Andrey
tarilabs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,12 +66,25 @@ jobs: | |
fi | ||
|
||
test: | ||
name: Test against Py ${{ matrix.python }} | ||
name: Test against Py ${{ matrix.python }} and K8s ${{ matrix.kubernetes-version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: ["3.12", "3.11", "3.10", "3.9"] | ||
python: ["3.12"] # see below for versions 3.9-3.11 | ||
kubernetes-version: ["v1.27.11", "v1.28.7", "v1.29.2", "v1.30.6", "v1.31.0"] | ||
exclude: # on main merges (not PRs), use also different K8s versions for E2E testing | ||
- kubernetes-version: ${{ github.event_name != 'push' && 'v1.28.7' }} | ||
- kubernetes-version: ${{ github.event_name != 'push' && 'v1.29.2' }} | ||
- kubernetes-version: ${{ github.event_name != 'push' && 'v1.30.6' }} | ||
- kubernetes-version: ${{ github.event_name != 'push' && 'v1.31.0' }} | ||
include: # test Py versions only with a reference K8s version, designated currently to kubernetes-version: v1.27.11 | ||
- python: "3.11" | ||
kubernetes-version: "v1.27.11" | ||
- python: "3.10" | ||
kubernetes-version: "v1.27.11" | ||
- python: "3.9" | ||
kubernetes-version: "v1.27.11" | ||
env: | ||
FORCE_COLOR: "1" | ||
IMG_ORG: kubeflow | ||
|
@@ -124,8 +137,9 @@ jobs: | |
- name: Start Kind Cluster | ||
uses: helm/[email protected] | ||
with: | ||
node_image: "kindest/node:v1.27.11" | ||
node_image: kindest/node:${{ matrix.kubernetes-version }} | ||
cluster_name: chart-testing-py-${{ matrix.python }} | ||
kubectl_version: ${{ matrix.kubernetes-version }} | ||
- name: Load Local Registry Test Image | ||
env: | ||
IMG: "${{ env.IMG_ORG }}/${{ env.IMG_REPO }}:${{ steps.tags.outputs.tag }}" | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not know you could add such "boolean" conditions on the
exclude
, really interesting!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a neat trick I discovered recently, but the "limitation" is that the order will always be 1. Exclusion, 2. Inclusion
So there is only so much can be done in 1 matrix
For more complex cases, the solution would be to produce the matrix in one job, and consume in another job--that's what also GHA docs advise in general
For this case, this was compact enough imho