-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
chore(tests): added makefiles for testing workflow tests locally #11509
Conversation
Hi @chahatsagarmain. Thanks for your PR. I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
/lgtm
Thanks!
/ok-to-test |
@anishasthana you may like to review this. |
Could you document how to launch the tests in https://github.com/kubeflow/pipelines/blob/master/test/README.md ? |
@chahatsagarmain I added one more item to the issue's acceptance criteria.
|
hello @chahatsagarmain , following up with our chat on slack, would you please make sure that this command ( related commit in parallel pr: it should point to the thanks for your collaboration in advance. cc: @hbelmiro |
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.
@chahatsagarmain please don't forget the actions.
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.
Please add the missing .github/workflows/presubmit-backend.yml
to on.pull_request.paths
.
@@ -53,4 +53,4 @@ jobs: | |||
run: pip install -r ./test/sdk-execution-tests/requirements.txt | |||
|
|||
- name: Run component YAML tests | |||
run: ./test/presubmit-component-yaml.sh | |||
run: make sdk-component-yaml |
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.
You missed the setup for this one.
.github/workflows/sdk-execution.yml
Outdated
export KFP_ENDPOINT="http://localhost:8888" | ||
export TIMEOUT_SECONDS=2700 | ||
pytest ./test/sdk-execution-tests/sdk_execution_tests.py --asyncio-task-timeout $TIMEOUT_SECONDS | ||
make sdk-execution |
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.
You missed the setup for this one.
.github/workflows/sdk-yapf.yml
Outdated
@@ -33,4 +33,4 @@ jobs: | |||
run: pip install yapf | |||
|
|||
- name: Run YAPF SDK Tests | |||
run: ./test/presubmit-yapf-sdk.sh | |||
run: make sdk-yapf |
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.
You missed the setup for this one.
Makefile
Outdated
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.
Please rename them to have test-
in the beginning of their names so it will be easier for contributors to find them.
For example, backend-test-flip-coin
-> test-backend-flip-coin
.
/ok-to-test |
Approvals successfully granted for pending runs. |
@mahdikhashan as per #11512 (comment), you need to add the new target in your PR, otherwise it won't pass the CI and can't get merged. |
/ok-to-test |
Approvals successfully granted for pending runs. |
/ok-to-test |
Approvals successfully granted for pending runs. |
/ok-to-test |
Approvals successfully granted for pending runs. |
9e18ef4
to
c73d65d
Compare
8f2a238
to
cfec71c
Compare
cfec71c
to
2eb3d40
Compare
2eb3d40
to
a85e064
Compare
@chahatsagarmain can you please rebase? |
@hbelmiro I think its already up to date with latest master commit |
a85e064
to
a4a5abc
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hbelmiro The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Makefile.setup.mk
Outdated
.PHONY: create-kind-cluster | ||
create-kind-cluster: | ||
kind create cluster --name kfp --image kindest/node:v1.29.2 --wait 5m && \ | ||
kubectl version --client --short |
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.
Where is this used? Or is this meant for local set up? If the latter it might be worth adding this to the readme
test/README.md
Outdated
|
||
4. Install the necessary dependencies for the test by running the command `make setup-{test_name}`. The steps for setting up dependencies are defined in the `Makefile.setup.mk` file. | ||
|
||
5. Execute the test using command `make {test_name}` , all the test that can be run using Make commands are mentioned in `Makefile`. | ||
|
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.
aren't these meant to replace the "## Running Tests Locally with Kind" section entirely? or at the least the user is likely going to follow one approach or the other, but not both, so we can document it such that we tell the user "you can use the make by doing xyz steps, or you can run it manually by doing abc steps"
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 think we can replace the "## Running Tests Locally with Kind" section entirely.
sudo apt-get update && \ | ||
sudo apt-get install protobuf-compiler -y && \ |
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.
putting apt-get in a make file here is not a good idea, we should keep this scoped to the environment, this should be handled in the github action (preferably as it's own step), and the user should install this themselves (and we should provide docs as pre-requisites)
for example, if the intent of the pr is to allow users to run these locally, what if they are not using a debian os? we should try to be as platform agnostic as we can (this applies to any make make command here that's using apt-get)
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.
@HumairAK The PR's intent is to allow contributors to find all tests in one place using make
commands.
putting apt-get in a make file here is not a good idea, we should keep this scoped to the environment, this should be handled in the github action (preferably as it's own step), and the user should install this themselves (and we should provide docs as pre-requisites)
for example, if the intent of the pr is to allow users to run these locally, what if they are not using a debian os? we should try to be as platform agnostic as we can (this applies to any make make command here that's using apt-get)
I agree 100%. At the same time, keeping this in the GitHub action kind of goes against the reason for this PR.
How about leaving it in the make file for now, but adding a verification to check if it's running on debian before running any command? We could add compatibility with other SOs, like Fedora and macOS, in a follow-up PR/issue.
is_debian() {
# Check via /etc/os-release (most reliable)
if [ -f /etc/os-release ]; then
if grep -q 'ID=debian' /etc/os-release; then
return 0
fi
fi
# Fallback check for /etc/debian_version
if [ -f /etc/debian_version ]; then
return 0
fi
# If neither check passed
return 1
}
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.
We shouldn't be installing system wide packages in e2e makefile targets, pip install is fine since it's scoped to venv, but apt-get
installs it in the user's OS. We want this to be an active action, and not a passive one. I'm fine with providing a make target like "install-preq-requisites" and have this be a separate step before invoking the rest of the test suite, but not as part of a full e2e single command.
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.
Yeah, one of the issue's acceptance criteria is exactly that:
make
commands for running tests should not install any tools. In case of having a tool as a pre-requirement, we can have a specific make command for that.
It's what @chahatsagarmain did here if I'm not mistaken.
python3 -m venv .venv && \ | ||
source .venv/bin/activate |
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.
various tests are installing a virtual environment with python packages in the user environment via pip,
what is the behavior if they re-run the tests?
it would be good if tests re-run dont' have to always re-install the packages and re-use the env, we should also document that some of the make commands will install a venv and packages
I'm thinking it would be good to have clean up commands in those scenarios but because there are so many different tests each with unique cases, I'm not sure how feasible that would be
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.
various tests are installing a virtual environment with python packages in the user environment via pip,
what is the behavior if they re-run the tests?it would be good if tests re-run dont' have to always re-install the packages and re-use the env, we should also document that some of the make commands will install a venv and packages
I think that the installation of packages should be in the setup
make commands.
I'm thinking it would be good to have clean up commands in those scenarios but because there are so many different tests each with unique cases, I'm not sure how feasible that would be
As we have setup
make commands, we could also have tear-down
commands. In that case, we could print a message at the end of the test run warning contributors that they need to run the tear-down
command.
How about adding it in a follow-up PR/issue? This is a big PR and we'll likely have other improvements in the CI in the next few days. Rebasing this PR makes the review difficult/error-prone.
Makefile.setup.mk
Outdated
python3 -m pip install api/v2alpha1/python && \ | ||
pip install components/google-cloud && \ | ||
pip install $(shell grep 'pytest==' sdk/python/requirements-dev.txt) && \ | ||
pytest ./test/gcpc-tests/run_all_gcpc_modules.py |
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.
this looks like it shouldn't be here, as it's only a setup target and the same command is ran in test-grpc-modulestest-grpc-modules
pytest ./test/gcpc-tests/run_all_gcpc_modules.py | ||
|
||
.PHONY: setup-kfp-kubernetes-execution-tests | ||
setup-kfp-kubernetes-execution-tests: |
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 don't see this used in any github action, was there a reason for this?
- name: Install requirements | ||
run: pip install -r ./test/sdk-execution-tests/requirements.txt | ||
run: make setup-sdk-execution |
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.
a4a5abc
to
e379fc7
Compare
New changes are detected. LGTM label has been removed. |
parent 7bb0c44 author chahatsagarmain <chahatsagar2003@gmail.com> 1740067717 +0530 committer chahatsagarmain <chahatsagar2003@gmail.com> 1740068190 +0530 parent 7bb0c44 author chahatsagarmain <chahatsagar2003@gmail.com> 1740067717 +0530 committer chahatsagarmain <chahatsagar2003@gmail.com> 1740068098 +0530 make commands for local testing and ci refactor Signed-off-by: chahatsagarmain <chahatsagar2003@gmail.com> chore: use local proto go packages for ci (kubeflow#11629) Signed-off-by: Humair Khan <HumairAK@users.noreply.github.com> fix(backend): upgrade go version to 1.22.12 to fix CVE-2024-45336 (kubeflow#11631) Signed-off-by: Daniel Dowler <12484302+dandawg@users.noreply.github.com> fix(backend) fix run retry for argo (kubeflow#11585) Signed-off-by: arpechenin <arpechenin@avito.ru> fix(frontend): restrict file explorer to show only .yaml, .yml, .zip, and .tar.gz files (kubeflow#11623) * fix(frontend): restrict file explorer to show only .yaml, .yml, .zip, and .tar.gz files Signed-off-by: muzzlol <muzxmmilkhxn@gmail.com> * test(frontend): update NewPipelineVersion snapshot for file filters Signed-off-by: muzzlol <muzxmmilkhxn@gmail.com> --------- Signed-off-by: muzzlol <muzxmmilkhxn@gmail.com> fix(backend): fixes DAG status update to reflect completion of all tasks (kubeflow#11651) Signed-off-by: VaniHaripriya <vmudadla@redhat.com> chore(test): Increased timeout in test (kubeflow#11658) Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com> make commands to test locally and ci refactor Signed-off-by: chahatsagarmain <chahatsagar2003@gmail.com> add missing step Signed-off-by: chahatsagarmain <chahatsagar2003@gmail.com> reviewed changes Signed-off-by: chahatsagarmain <chahatsagar2003@gmail.com> fix eol Signed-off-by: chahatsagarmain <chahatsagar2003@gmail.com>
e379fc7
to
09c3091
Compare
@HumairAK @chahatsagarmain |
/close We'll proceed with individual PRs for each workflow. |
@hbelmiro: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Description of your changes:
Issue #11494
Added makefiles for tests and setup each test locally .
Checklist: