-
Notifications
You must be signed in to change notification settings - Fork 54
Add is_dashboard_ready function + update unit test #318
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 is_dashboard_ready function + update unit test #318
Conversation
f397cca
to
53b4f98
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.
Tested changes and everything works as expected just two small nit picks with the cluster ready message
src/codeflare_sdk/cluster/cluster.py
Outdated
try: | ||
response = requests.get(self.cluster_dashboard_uri(), timeout=5) | ||
if response.status_code == 200: | ||
return True | ||
except requests.RequestException: | ||
pass | ||
return False |
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.
Does this need to be a try/except? requests.get() should always return some status_code, right?
Can we change it to be a bit simpler:
response = requests.get(self.cluster_dashboard_uri(), timeout=5)
if response.status_code == 200:
return True
else:
return False
This will also need a rebase |
06d7ffe
to
926e7db
Compare
926e7db
to
f2ad521
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 APPROVED This pull-request has been approved by: MichaelClifford 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 |
Issue link
Closes #314
What changes have been made
is_dashboard_ready
function that is used to check for the dashboard's availability. This is done by sending a request to the Dashboard URI, where if status code equals 200 we returnTrue
.wait_ready
function to ensure that both the cluster and the dashboard are operational.Verification steps
I updated the unit tests to reflect these changes on the
wait_ready
function. All tests are passing.Checks