-
Notifications
You must be signed in to change notification settings - Fork 10
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
Allow multiple services #18
Allow multiple services #18
Conversation
I used shotgrids process-dockerfile as a ref (https://github.com/ynput/ayon-shotgrid/blob/develop/services/processor/Dockerfile)
…e services This mimics how Shotgrid is setup
This allows us to still get IntelliSense in VS Code
I see no problem with this PR itself (thanks for the clean-up), but I'm not convinced that the sync trigger justifies another service. The overhead of having two minimalistic services (not only computational but work required to set them up, keeping two separate images...) is pretty high - don't you think, we could just run the listener in another thread of the processor service? @iLLiCiTiT wdyt? |
Hmm, maybe. I was mostly looking on how the shotgrid addon. It has 3 different services. |
server/__init__.py
Outdated
services = { | ||
"processor": {"image": f"ynput/ayon-kitsu-processor:{__version__}"} | ||
} | ||
services = {"processor": {"image": f"ynput/ayon-kitsu-processor:{__version__}"}} |
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 actually think that the previous formatting was better.
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.
Fixed ;)
I added a ,
after the processor dict. That way Black will format it per line.
We have listener as separated service in ftrack so you can restart the processor service without loosing events which happened meanwhile the processor is restarting. But if listener is not listening to "live" events, but is querying them, then it does not make sense and can be in single service. |
services/kitsu_common/utils.py
Outdated
@@ -0,0 +1,6 @@ | |||
class KitsuServerError(Exception): |
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 don't think this file has to be out of the service itself, there are only exceptions...
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 put it outside of the processor service as they are also used in my sync_service code.
I thought it would be good to place them in the kitsu_common so we don't have them duplicated.
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 put it outside of the processor service as they are also used in my sync_service code.
I don't understand? The exceptions are used only in processor service. Do you have you're own sync_service service? If yes, how does help to have it in kitsu_common? You can't raise exception in one process and catch it in other...
If you have it in same process then you can probably do import like from processor.exceptions import ...
instead of from kitsu_common import ...
.
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.
Classes and functions that I will use in my upcoming PR (that's currently called sync_service (Same name as the Kitsu sync service in OpenPype)) I placed in untils.py
Mostly to skip duplicated code between multiple services. Same thing here, inspired on how the Shotgrid addon is made.
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.
Hard to tell without the multiple usage. Can you move it to common in the upcomming PR? It does not make sense here and it is not possible to comment if it's ok or not without the usage.
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.
Ok, sure thing!
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!
The Gazu listeners executes a function when being called. It's possible to ether work "live" or if Ayon have a queue system we can use that. |
This PR prepares the service to be able to run multiple different services.
It's needed for the next PR I'm working on to implement Gazu event listeners so Ayon will get the same kitsu sync as OpenPype.
Most updates in the code is inspired by the shotgrid code (https://github.com/ynput/ayon-shotgrid)