fairing icon indicating copy to clipboard operation
fairing copied to clipboard

Updated manager.py for reading secrets to check for the existence of …

Open raviranjan0309 opened this issue 5 years ago • 13 comments

Issue: When someone runs Kubeflow Faring from Kubeflow Pipeline, he/she will get below error: IOError: [Errno 2] No such file or directory: ‘/etc/secrets/user-gcp-sa.json’

Reason: When Kubeflow Fairing tries to launch the pod for model training like LightGBM distributed parallel training, it tries to check the presence of the secret by using list instead of get and when list fails due to lack of permission, it just does not attach any secrets to the pod. This causes the whole Kubeflow pipeline to fail.

Description of your changes: The secret_exists function is incorrectly using list_namespaced_secret (https://github.com/kubeflow/fairing/blob/e0d44e870b467bbd773f836a8b1b648b79019dd1/kubeflow/fairing/kubernetes/manager.py#L220) to check for the existence of a secret instead of read_namespaced_secret. The default pipeline-runner SA used by Kubeflow Pipelines does not have the list permission for secrets, so fairing fails to check that the secret exists and fails to attach it. kubeflow/pipelines#3742 This helped me run Kubeflow fairing from the Kubeflow pipeline successfully.

raviranjan0309 avatar May 19 '20 06:05 raviranjan0309

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign jinchihe You can assign the PR to them by writing /assign @jinchihe in a comment when ready.

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 /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar May 19 '20 06:05 k8s-ci-robot

This change is Reviewable

kubeflow-bot avatar May 19 '20 06:05 kubeflow-bot

Hi @raviranjan0309. 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.

k8s-ci-robot avatar May 19 '20 06:05 k8s-ci-robot

/assign @jinchihe Please verify my changes and provide your feedback.

raviranjan0309 avatar May 19 '20 06:05 raviranjan0309

/assign @jinchihe

Please look into my PR and let me know for more details

raviranjan0309 avatar May 19 '20 09:05 raviranjan0309

@karthikv2k @jinchihe @iancoffey Please review this pull request. I am working on building ML platform using Kubeflow. This change is crucial to run Kubeflow fairing from the pipeline.

raviranjan0309 avatar May 23 '20 14:05 raviranjan0309

/ok-to-test /assign

jinchihe avatar May 25 '20 09:05 jinchihe

@raviranjan0309: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
kubeflow-fairing-presubmit 363af5bd20fad22edd4be322ac834c43c67455db link /test kubeflow-fairing-presubmit

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

k8s-ci-robot avatar May 25 '20 10:05 k8s-ci-robot

@jinchihe I see the test case failed. I just made a single line code change and checked-in the same. Do I need to perform any extra step to make this test run success?

raviranjan0309 avatar May 25 '20 12:05 raviranjan0309

@raviranjan0309 we need to ensure the CI test pass. And I'm not sure what the different permission requirement between list_namespaced_secret and read_namespaced_secret? if you are sure that works fine, would you please show more? Thanks.

jinchihe avatar May 25 '20 14:05 jinchihe

@raviranjan0309 Would you please update this PR? Thanks.

jinchihe avatar Jun 19 '20 03:06 jinchihe

@jinchihe I am working on updating secrets permissions in pipeline runner under Kubeflow manifest. If that works then there will not be any need to make the change here.

raviranjan0309 avatar Jun 29 '20 05:06 raviranjan0309

@jinchihe I am working on updating secrets permissions in pipeline runner under Kubeflow manifest. If that works then there will not be any need to make the change here.

OK. Thanks.

jinchihe avatar Jun 30 '20 00:06 jinchihe