Skip to content
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

kfctl#36 Split build and deploy to separate tests #4187

Merged
merged 8 commits into from
Oct 4, 2019

Conversation

nrchakradhar
Copy link
Contributor

@nrchakradhar nrchakradhar commented Sep 26, 2019

For kfctl#36, I have separated build and deploy into separate modules

  • kfctl_go_build_test.py
  • kfctl_go_deploy_test.py

In kfctl_go_deploy, included an error if kfctl go binary is not found

Once #4148 is merged,

#**************************************************************************
# Run build_kfctl and deploy kubeflow
step_name = "kfctl-build-deploy"
command = [
"pytest",
"kfctl_go_test.py",

will be changed to include new step for build which does not need any args at the moment.

Also, after #4154 is merged, some minor changes might be needed.


This change is Reviewable

@k8s-ci-robot
Copy link
Contributor

Hi @nrchakradhar. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@nrchakradhar
Copy link
Contributor Author

nrchakradhar commented Sep 26, 2019

/assign jlewi

@k8s-ci-robot
Copy link
Contributor

@nrchakradhar: GitHub didn't allow me to assign the following users: jweli.

Note that only kubeflow members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign jweli

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.

@jlewi
Copy link
Contributor

jlewi commented Sep 26, 2019

Pro tip make sure reviewers are listed as Assignees otherwise it won't show up in their review dashboard.
You can also explicitly /assign reviewers
/assign @jlewi

jlewi pushed a commit to jlewi/kubeflow that referenced this pull request Sep 26, 2019
* Once kfctl upgrade is ready we will have to update this test to actually run.

* kubeflow#4148 needs to be submitted first.

* We will also need to update the test after kubeflow#4187 is merged.
  That splits kfctl_go_test.py into separate build and deploy steps.
@jlewi jlewi mentioned this pull request Sep 26, 2019
@jlewi
Copy link
Contributor

jlewi commented Sep 26, 2019

Thanks @nrchakradhar

Should we move these files into
https://github.com/kubeflow/kubeflow/tree/master/py/kubeflow/kubeflow/ci

Then kfctl_go_test.py could import and reuse the functions defined in those files.

This way we don't end up duplicating the code and we can make changes in a single location.

@jlewi
Copy link
Contributor

jlewi commented Sep 26, 2019

/ok-to-test

@nrchakradhar
Copy link
Contributor Author

Then kfctl_go_test.py could import and reuse the functions defined in those files.

This way we don't end up duplicating the code and we can make changes in a single location.

@jlewi Do we want to have kfctl_go_test.py going forward? I thought it was not required. Once the workflow is moved to python, e2e test can have build, deploy as steps and kfctl_go_test.py can be removed. The test semantics will be a DAG of steps of independent functionalities. This way there will be only ONE way of e2e tests and not combined multiple steps in DAG into a single python test.

Did not remove the file now in this commit as submit test will fail. When rebasing after #4148 merge, I can delete the file.
Please let me know your thoughts and I can change accordingly.

@jlewi
Copy link
Contributor

jlewi commented Sep 27, 2019

We do want to get rid of kfctl_go_test.py. But @yanniszark is planning on continuing to use it in the Arrikto E2E test #4154. So it will live on for a while.

In the meantime the semantics of kfctl are changing (#4040) so we need to update the tests to use the new semantics.

So we'd like to be able to have this logic in a single place and not have to update multiple locations.

@nrchakradhar
Copy link
Contributor Author

nrchakradhar commented Sep 27, 2019

@jlewi I made some draft changes. Let me know if this is inline with your expectation.
The changes may not compile and pylint also may fail. I will correct them if the changes made are as per your thoughts

@jlewi
Copy link
Contributor

jlewi commented Sep 27, 2019

Yes this is very much what I had in mind. I might suggest moving the new pytest modules into py/kubeflow/kubeflow/ci as well.

The only reason for this is because by convention we always add the py directory to our python path. So this way all the modules are on our python path and we could import them if need be

@swiftdiaries
Copy link
Member

/cc @swiftdiaries
+1 to @jlewi 's comments
Can we wait on removing the kfctl_go_test.py until #4040 goes in and we can test the new semantics?

@nrchakradhar
Copy link
Contributor Author

@jlewi I have moved the files as per comment. I am not able to resolve the python paths though.
kfctl_go_test.py:5: in
from kubeflow.kubeflow.ci import kfctl_go_test_utils as kfctl_util
E ImportError: No module named 'kubeflow.kubeflow'

Can you please help.

@jlewi
Copy link
Contributor

jlewi commented Sep 29, 2019

It looks like the PYTHONPATH for the step doesn't include kubeflow/kubeflow/py.
If you look at the argo workflow spec
https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/kubeflow_kubeflow/4187/kubeflow-presubmit/1178293231973044224/kubeflow-presubmit-kfctl-go-iap-istio-4187-b60254a-4224-510f.yaml

the PYTHONPATH is

      - name: PYTHONPATH
        value: /mnt/test-data-volume/kubeflow-presubmit-kfctl-go-iap-istio-4187-b60254a-4224-510f/src/kubeflow/kubeflow:/mnt/test-data-volume/kubeflow-presubmit-kfctl-go-iap-istio-4187-b60254a-4224-510f/src/kubeflow/testing/py:/mnt/test-data-volume/kubeflow-presubmit-kfctl-go-iap-istio-4187-b60254a-4224-510f/src/kubeflow/tf-operator/py

I think you need to change this line

value: kubeflowPy + ":" + kubeflowTestingPy,

To

 name: "PYTHONPATH",
 value: kubeflowPy + ":" +  kubeflowPy + "/py" + ":" + kubeflowTestingPy, 

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@nrchakradhar
Copy link
Contributor Author

/retest

@nrchakradhar
Copy link
Contributor Author

@jlewi
I rebased the changes and after that except for one test all have passed.
With my limited understanding, my analysis of logs points to "Application" CR not installed. There have been couple of issues related to synchronization like #1933 but are quite old.
The same workflow for other cases with IAP are passing.

Can you please let me know how can I fix this?

Also, I found that its not easy to copy the logs from browser to other textpad/notepad/vim etc. Is there some way to do this?

@nrchakradhar
Copy link
Contributor Author

/retest

@nrchakradhar
Copy link
Contributor Author

/retest

# kubeflow/manifests repository; so we need to change the repo specification
# in the KFDef spec.
# TODO(jlewi): We should also point to a specific commit when triggering
# postsubmits from the kubeflow/manifests repo
Copy link
Member

Choose a reason for hiding this comment

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

Can we address this comment in this PR?
If not we can come back to it at a later point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can include this, but need information on to change to what as I am still learning all the CI stuff that is happening here.

Copy link
Member

Choose a reason for hiding this comment

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

Cool. We can open an issue and address it soon.

@swiftdiaries
Copy link
Member

/lgtm
Pending a pass on the presubmit.

@k8s-ci-robot k8s-ci-robot removed the lgtm label Oct 4, 2019
@nrchakradhar
Copy link
Contributor Author

@jlewi @swiftdiaries Presubmit has passed. PTAL.
I can address any additional comments either in the PR or a follow up as per your suggestions.

@swiftdiaries
Copy link
Member

/lgtm

@swiftdiaries
Copy link
Member

I don't have approve rights, @richardsliu / @kunmingg could you PTAL?

@k8s-ci-robot k8s-ci-robot merged commit 841c6b8 into kubeflow:master Oct 4, 2019
jlewi pushed a commit to jlewi/kubeflow that referenced this pull request Oct 9, 2019
* We need to write an E2E test for kfctl upgrade (kubeflow/kfctl#35).

* Once kfctl upgrade is ready we will have to update this test to actually run.

* kubeflow#4148 needs to be submitted first.

* We will also need to update the test after kubeflow#4187 is merged.
  That splits kfctl_go_test.py into separate build and deploy steps.
saffaalvi pushed a commit to StatCan/kubeflow that referenced this pull request Feb 11, 2021
* kfctl#36 Split build and deploy to separate tests

* Move common methods to ci

* Split kfctl_go_tests

Moving to ci

changing the import path

Fixing python path

* kfctl#36 Split build and deploy to separate tests

* Compile might fail. Move common methods to ci

* Split kfctl_go_tests

review changes

changing the import path

Change in jsonnet

Change in e2e_workflow

* Rebase and modify after kubeflow#4040

* Fix test failure
saffaalvi pushed a commit to StatCan/kubeflow that referenced this pull request Feb 12, 2021
* kfctl#36 Split build and deploy to separate tests

* Move common methods to ci

* Split kfctl_go_tests

Moving to ci

changing the import path

Fixing python path

* kfctl#36 Split build and deploy to separate tests

* Compile might fail. Move common methods to ci

* Split kfctl_go_tests

review changes

changing the import path

Change in jsonnet

Change in e2e_workflow

* Rebase and modify after kubeflow#4040

* Fix test failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants