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

tests: add proxy option to test file for driver #103

Merged

Conversation

DnPlas
Copy link
Contributor

@DnPlas DnPlas commented Aug 19, 2024

Adding a proxy option to the driver/test_kubeflow_workloads.py script, will allow users to tell the driver it will run in a proxied environment. With this, a PodDefault will be used for setting environment variables (NO_PROXY, HTTP_PROXY, HTTPS_PROXY) in the Pod(s) that execute the Job for UATs.

Fixes #96

Manual testing

  1. Deploy juju deploy admission-webhook --channel 1.9/stable --trust
  2. Deploy juju deploy kubeflow-profiles --channel 1.9/stable --trust
  3. Clone this repository and checkout to the branch git checkout KF-6029-configure-driver-behind-proxy
  4. Run the UATs with proxy tox -e uats-local -- --proxy http_proxy=daniela:9090 https_proxy=daniela:9090 'no_proxy=no,proxy,comma,separated'
  5. Verify the Pod created by the UATs Job has the desired Environment vars:
$ kubectl describe pod -ntest-kubeflow test-kubeflow-*
...
    Environment: <--- all of these should match the ones in the PodDefault from (4)
      HTTP_PROXY:   daniela.io:9090
      http_proxy:   daniela.io:9090
      HTTPS_PROXY:  daniela.io:9090
      https_proxy:  daniela.io:9090
      NO_PROXY:  no,proxy,comma,separated
      no_proxy:  no,proxy,comma,separated
...
  1. Alternatively, you can check the admission webhook logs to ensure it is applying the PodDefault correctly:
$ kubectl logs -nkubeflow admission-webhook-0 -cadmission-webhook -f
...
2024-08-19T08:28:42.507Z [admission-webhook] I0819 08:28:42.507864      14 main.go:600] Entering mutatePods in mutating webhook
2024-08-19T08:28:42.516Z [admission-webhook] I0819 08:28:42.516173      14 main.go:646] fetched 1 poddefault(s) in namespace test-kubeflow
2024-08-19T08:28:42.516Z [admission-webhook] I0819 08:28:42.516199      14 main.go:662] 1 matching pod defaults, for pod 
2024-08-19T08:28:42.516Z [admission-webhook] I0819 08:28:42.516206      14 main.go:668] Matching PD detected of count 1, patching spec
2024-08-19T08:28:42.516Z [admission-webhook] I0819 08:28:42.516216      14 main.go:481] mutating pod: 
2024-08-19T08:28:42.516Z [admission-webhook] I0819 08:28:42.516227      14 main.go:683] applied poddefaults: notebook-proxy successfully on Pod:  

@DnPlas DnPlas marked this pull request as draft August 19, 2024 07:27
@DnPlas DnPlas force-pushed the KF-6029-configure-driver-behind-proxy branch 2 times, most recently from 1d7189c to 23e9fb7 Compare August 19, 2024 08:26
@DnPlas DnPlas marked this pull request as ready for review August 19, 2024 08:34
@DnPlas DnPlas force-pushed the KF-6029-configure-driver-behind-proxy branch 2 times, most recently from 233f27a to 07ce6a0 Compare August 19, 2024 08:53
@DnPlas DnPlas changed the base branch from main to KF-5945-configure-proxy-dev-branch August 20, 2024 14:24
Adding a proxy option to the driver/test_kubeflow_workloads.py script, will allow users to tell
the driver it will run in a proxied environment. With this, a PodDefault will be used for setting
environment variables (NO_PROXY, HTTP_PROXY, HTTPS_PROXY) in the Pod(s) that execute the Job for UATs.

Fixes #96
@DnPlas DnPlas force-pushed the KF-6029-configure-driver-behind-proxy branch from 07ce6a0 to 1fe4c07 Compare August 20, 2024 14:46
Copy link
Contributor

@NohaIhab NohaIhab left a comment

Choose a reason for hiding this comment

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

thx @DnPlas, I followed the test and instructions and was able to see the proxy envs set in the pod created by the Job, looking good already. Left a few comments.

driver/test_kubeflow_workloads.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@NohaIhab NohaIhab left a comment

Choose a reason for hiding this comment

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

a few more comments, looking good already (:

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
driver/test_kubeflow_workloads.py Outdated Show resolved Hide resolved
Copy link
Contributor

@NohaIhab NohaIhab left a comment

Choose a reason for hiding this comment

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

LGTM, Thx @DnPlas !

@DnPlas DnPlas merged commit 66fe640 into KF-5945-configure-proxy-dev-branch Aug 23, 2024
1 check passed
@DnPlas DnPlas deleted the KF-6029-configure-driver-behind-proxy branch August 23, 2024 15:06
DnPlas added a commit that referenced this pull request Aug 28, 2024
This commit merges `KF-5945-configure-proxy-dev-branch` into `main` to
support the proxy configuration for UATs.

* #98
* #105
* #103
* #111

Fixes #75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running using driver: Configure the UATs to run behind a proxy
2 participants