-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use entry points for services and service proxies #251
Use entry points for services and service proxies #251
Conversation
Hey @ehpor, so what is this supposed to look like once the splitting is done? Will all the entry points be removed from catkit2's Other than that this PR looks good, except for the failing CI. |
@ivalaginja Not all entry points will be removed. I think just the ones related to hardware. They will be separate packages in the same repo, with their own requirements in a pyproject.toml file. Since they will be separate packages, you can pick and choose which hardware you want to control on your conda environment. |
Failing CI is due to mismatched API from |
Ok, I'll wait for an example by you for that 😬 . |
@ivalaginja Example: File structure:
pyproject.toml:
Installation would be something like:
|
abc8584
to
ab33220
Compare
@a-sevin This PR is a first with the ultimate goal of separating dependencies of catkit into separately installable packages. This will allow different testbeds to use different versions of Python and be able to install mutually incompatible SDKs for hardware devices. I'd like your opinion on this. |
@RemiSoummer I'd like your input on this as well, to make sure that this is indeed the direction you want to take. |
One small thing that probably wasn't make clear enough, for the reviewer: this PR requires the use of a Python file to start the service. A C++ service would need to be started by the Python script, if we want one, rather than started directly by the testbed server. I'm guessing that the process priorities and CPU pinning (set by the testbed server after launching) are inherited by the subprocess, but this needs to be checked. |
@ivalaginja See https://github.com/spacetelescope/hicat-package2/pull/673 as an example for what this looks like on a downstream package. |
@a-sevin @RemiSoummer Any comment on this? I was hoping to get this, and two other PRs that depend on this, merged before a talk on catkit2 at the CfAO Fall Retreat in about a week from now. |
Is this something that can still be automated on the downstream repo with conda or would we have to do it differently? |
@ehpor this looks good to me, thank you for all the examples! So do I understand correctly that this PR here enables the flexibility on service and proxy discovery, while a future PR will change the catkit2 structure for the possibility to install the different packages selectively? |
This is fine with me. I understand this is a first step, and then we'll be able to filter the packages and install them automatically later. Go ahead with the PR. |
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
Okay, I'll merge after fixing the conflict and receiving another approval. Note that this PR breaks all downstream packages (ie. hicat-package2, thd-controls, etc...) until they update their |
This makes this also work on Python 3.8.
721563e
to
8790269
Compare
It seems great! I will take some time to take a deeper look at the code ASAP |
Yes. Except for "possibility". After this PR it is already possible to create separate packages that contain services that will be used by catkit2. This PR however does not split up the current catkit2 package into multiple packages, each of which targeted to a particular manufacturer. That is a separate PR with less high priority. Okay, merging. Note that this breaks compatibility and requires downstream changes to fix. See e.g. https://github.com/spacetelescope/hicat-package2/pull/673. |
This PR converts service type discovery from explicit paths to an entry-point-based solution.
This has the advantage of not having to import proxies defined outside of catkit2, since they are discovered and installed as plugins at installation time rather than runtime.
Furthermore, this allows us to use separate packages for installation of services and service proxies. That remove dependency of catkit2 on hardware libraries which are unnecessary to run on specific testbeds. Actually splitting out services into separate packages is left for a separate PR.
Finally, it allows us to put services and service proxies at any arbitrary location in the library. So we are free to bunch up cameras into separate folders, and other similar groupings.
This PR supersedes #166.