-
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
Add proxy agent runner for kubeflow pipeline #988
Conversation
/assign @ojarjur |
/test kubeflow-pipeline-e2e-test |
/assign @vicaire @hongye-sun @paveldournov |
/test kubeflow-pipeline-e2e-test |
/assign @abdallag |
@IronPan: GitHub didn't allow me to assign the following users: abdallag. Note that only kubeflow members and repo collaborators can be assigned and that issues/PRs can only have 10 assignees at the same time. 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. |
1 similar comment
@IronPan: GitHub didn't allow me to assign the following users: abdallag. Note that only kubeflow members and repo collaborators can be assigned and that issues/PRs can only have 10 assignees at the same time. 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. |
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.
The PR looks good to me. Just want to clarify several questions for the context of the PR.
@@ -0,0 +1,80 @@ | |||
#!/bin/bash | |||
# | |||
# Copyright 2017 Google Inc. |
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.
2019
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.
done
proxy/Dockerfile
Outdated
@@ -0,0 +1,21 @@ | |||
# Ping to a specific version of invert proxy agent |
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.
nit: add license header.
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.
done
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.
done
proxy/get_proxy_url.py
Outdated
status_code = requests.head(url).status_code | ||
except requests.ConnectionError: | ||
pass | ||
expected_codes = frozenset([307, 401]) |
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.
Not quite sure why those 2 codes are expected, especially for unauthorized.
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.
thanks! 307 is legit. 401 is not good. I'll remove it.
except requests.ConnectionError: | ||
pass | ||
expected_codes = frozenset([307]) | ||
# 307 - Temporary Redirect, Proxy server sends this if VM has access rights. |
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.
nit: it's still weird that the endpoint only returns 307 as normal response status and not 200. Could you confirm if it's the case with the Jaas team?
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 i double checked with slava earlier and this is intended behavior.
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.
3xx codes are pretty normal.
Codes < 400 describe success.
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
/test kubeflow-pipeline-e2e-test |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: IronPan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: IronPan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold |
wait for @ojarjur review |
proxy/get_proxy_url.py
Outdated
raise ValueError("No working URL found") | ||
|
||
|
||
main() |
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.
Usually the main()
call is put inside
if __name__ == '__main__':
This way the module can be loaded and used like a library.
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.
done
status_code = requests.head(url).status_code | ||
except requests.ConnectionError: | ||
pass | ||
expected_codes = frozenset([307]) |
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.
JFYI, the plain set
also exists.
Nothing wrong with frozenset
(immutable) though.
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.
ack. thanks
proxy/get_proxy_url.py
Outdated
"""CLI tool that returns URL of the proxy for particular zone and version.""" | ||
from __future__ import absolute_import | ||
from __future__ import division | ||
from __future__ import print_function |
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.
JFYI, These imports are probably only needed for python 2.
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.
indeed. removed
Some general notes:
|
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 feel like there is enough logic in the get_proxy_url.py module to justify adding unit tests for it; at least something that exercises the url_for_zone method.
proxy/Dockerfile
Outdated
@@ -0,0 +1,21 @@ | |||
# Ping to a specific version of invert proxy agent |
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.
s/Ping/Pin/
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.
done
added the tests as @ojarjur suggested.
I think adding to root is fine. Pipeline won't have its own deployment, and i'm considering moving this code to kubeflow repo once stable. Hosting here just for faster release.
It's launched automatically as part of deployment. see kubeflow/kubeflow#2746 |
/lgtm |
/hold cancel |
This is the initial change to add a proxy agent for a kubeflow pipeline cluster.
The container should be launched as a K8s Deployment in the same namespace that kubeflow is deployed.
The agent runner will register to the proxy server and store the metadata in a ConfigMap. In a failover case that the agent die, the new agent should pick up the metadata from the ConfigMap.
This change is