-
Notifications
You must be signed in to change notification settings - Fork 27
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
Take out unnecessary Job.save() #1217
Conversation
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
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.
This is the service to create a Job
if a job is being created in another point of the workflow must be refactorized to use this service.
@Tansito I looked through code. There is only one place where the job instance is created. The |
Correct me if I'm wrong @akihikokuroda , Apart from that, the |
@Tansito The The other places calling the save() are updating specific attributes like |
I agree with what you just said @akihikokuroda and that's exactly the reason because we need to have that We can summarize the
Without the step 2 the step 3 never has the These are all the references that I could find where we are updating the job. I can be wrong but if my explanation doesn't convince you let me test the pull request monday and check if I'm wrong and we can solve the doubt, Aki. |
Ok, let me ask you in this way. Where the job instance is being created? |
It's created here https://github.com/Qiskit-Extensions/quantum-serverless/blob/ab0ab99409fa69d9df14ab6b083d960718f98210/gateway/api/services.py#L173 (in your step 1) |
I added print lines in the service.py like this
then I got this in the gateway log when I ran an example.
|
Oooh, got it. I didn't know that about the
|
The creating of the Job instance doesn't involve any db operation. It just creates a python object. So it doesn't cause any db related exception. So I took it out. Where are the 2 steps saving? There is only one save() here. Do I miss something? |
Oh wait, what?! With UUID's the instance generates an UUID but doesn't introduce any entry in the database?! Nothing to say then 😂 |
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.
Thank you so much @akihikokuroda for guide me 🙏
I'm going to need to review other entities because I think we have some similar saves
around the code.
@Tansito My pleasure. Thanks for reviewing this! |
Should we tweak the log message in L189 (since now that would be catching any issue saving the job, not just one specific to the envvars)? Otherwise LGTM. |
@psschwei Good catch. I'll update it. Thanks! |
gateway/api/services.py
Outdated
status=status, | ||
config=jobconfig, | ||
) | ||
print("!!!!") |
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.
@akihikokuroda I think you missed this 🤔
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!
* take out unnecessary Job.save() Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
* adding api documentation (swagger & redoc) to gateway * allow unauthenticated users to read RuntimeJobViewSet * allow swagger docu if user is not yet set * only show api/v1/ patterns, add token authorization, rm django login * drop jupyter from main helm readme (#1208) Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com> * CatalogEntry API (#1204) * add ModelView API for CatalogEntry * additional apis for catalogentry --------- Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com> * Repository removal (#1207) * Removed main components from repository project * Updated chart lock * Remove repository references from the client * add catalog status (#1211) Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com> * Use LocalProvider for test (#1212) * use LocalProvider for notebook test Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com> * Documentation update (#1214) * Update contribution guidelines * Update contributing doc with supported python versions * Remove Python 3.7 badge from README files * Upgrade min python version in setup.py * Test notebooks against k8s qs deployment (#1216) * test notebooks against k8s qs deployment Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com> * update notebook location Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com> * use action for kind creation Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com> * test all notebooks Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com> * drop sleep Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com> This was redundant, as the python setup in the next few steps takes waaaay longer than 60s --------- Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com> * Take out unnecessary Job.save() (#1217) * take out unnecessary Job.save() Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com> * Update Helm release kuberay-operator to v1 (#1121) * Update Helm release kuberay-operator to v1 * Update api version --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: David <9059044+Tansito@users.noreply.github.com> * Fix link for Qiskit deprecation policy (#1218) * Remove default login view (#1215) * remove default login view Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com> * adding api documentation (swagger & redoc) to gateway --------- Signed-off-by: Paul S. Schweigert <paul@paulschweigert.com> Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com> Co-authored-by: Paul Schweigert <paul@paulschweigert.com> Co-authored-by: Akihiko (Aki) Kuroda <16141898+akihikokuroda@users.noreply.github.com> Co-authored-by: David <9059044+Tansito@users.noreply.github.com> Co-authored-by: Karla Spuldaro <karla.spuldaro@ibm.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Summary
Fix: #1150
Details and comments