-
Notifications
You must be signed in to change notification settings - Fork 33
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
Refactor client and fix tests #1513
Conversation
time.sleep(1) | ||
while time.time() < must_finish and not client: | ||
try: | ||
client = JobSubmissionClient(connection_url) |
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.
Trying to know if Ray server started. I didn't found a better way but I'm sure it is. For the moment, this works.
@@ -40,9 +46,10 @@ def test_save_result(self): | |||
) | |||
self.assertTrue(result) | |||
|
|||
@patch("requests.get", Mock(return_value=ResponseMock())) |
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.
prevent token validation to fail.
I have to review the documentation. |
I converted it to draft @korgan00 just to let the team knows that we want a review on this but we need to fix tests yet |
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 left several comments but really good job with this refactor @korgan00 , congrats. I'm very happy with the result.
Also @korgan00 , most of the problems in the tests are related with the changes in the API. I can help you tomorrow looking at them but with some of the changes that I'm requesting you we should be able to solve some of them. |
Per offline conversations we also talked about changing |
Since file management is a Serveless feature that is not available in Ray or Local, should we remove it from the Base? This way we will reduce the |
2140199
to
a3c0809
Compare
Moving PR to review 🎉 |
@@ -29,6 +27,7 @@ jobs: | |||
shell: bash | |||
run: | | |||
cd tests/basic | |||
rm ./06_function.py |
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.
These changes were necessary. Basically currently 06_function
doesn't work in this test with the current docker-compose configuration and it was generating problems in the execution of the test.
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 opened a couple of closed conversations about breaking changes in get_job_by_id
and functions.get
methods. We can take a look tomorrow @korgan00 and clarify them. Maybe I missed them somewhere.
Since the client and the job files has huge changes, they are not shown by default in the changes preview.You have to load them intentionally. I put the deprecation redirections directly in the base file because it is better to maintain than spread and repeat the code in every client implementation. |
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.
Solved my questions and concerns with @korgan00 on a call. From my part everything looks good but @IceKhan13 if you can double check I would appreciate it 👍
45c24bb
to
9ae1121
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.
Waaaay cleaner now!
Thank you @korgan00!
Summary
Objectives:
BaseJobClient
and migrate it toBaseClient
RayJobClient
and migrate it toRayClient
LocalJobClient
and migrate it toLocalClient
GatewayJobClient
and migrate it toServerlessClient
Job
rename the variable to use theclient
instead ofjob_client
.QiskitFunctions
rename the variable to use theclient
instead ofjob_client
.Details and comments
Additionally:
BaseClient
implementations (Ray, Local and Serverless) to their own files.BaseClient
now is officially an abstract class (ABS
and@abstractmethod
).ComputedResource
because it wasn't used correctly.