Skip to content
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

Example of how to manage OMERO scripts install for users #1

Open
will-moore opened this issue Jan 22, 2024 · 5 comments
Open

Example of how to manage OMERO scripts install for users #1

will-moore opened this issue Jan 22, 2024 · 5 comments

Comments

@will-moore
Copy link
Owner

Hi @Tom-TBT, cc @joshmoore @jburel

This repo is based on the same idea I had for omero-figure at https://github.com/ome/omero-figure/pull/366/files which is to add an omero cli plugin command for uploading scripts.

For this repo, you can do

$ pip install -e .
$ omero annotation_scripts upload

This will upload all the scripts in https://github.com/will-moore/omero-annotation_scripts/tree/main/src/scripts to OMERO with a path of /omero/annotation_scripts/, and if they are already there then they will be updated.

This cli plugin was created with https://github.com/ome/cookiecutter-omero-cli-plugin and still has lots of bits not filled out yet.

This is just a proof-of-concept, as an example of a possible way for users to install your scripts.

@joshmoore
Copy link

No objections to the above, but before anyone spends too much time on it, I think it would be possible to have: pip install omero-scripts-X and no longer need to modify lib/scripts.

@will-moore
Copy link
Owner Author

@joshmoore Can you explain a bit more what you're thinking here? "no longer need to modify lib/scripts" You mean that the scripting service will use scripts from a different location?

@Tom-TBT
Copy link

Tom-TBT commented Jan 23, 2024

@joshmoore Are you talking of something like that?
https://stackoverflow.com/a/19404371/10712860

@joshmoore
Copy link

No, more like: zarr-developers/numcodecs#300

or:

https://github.com/German-BioImaging/omero-rdf/blob/main/src/omero_rdf/__init__.py#L97C1-L101C50

    for ep in entrypoints.get_group_all("omero_rdf.annotation_handler"):
        ah_loader = ep.load()
        self.annotation_handlers.append(ah_loader(self))
    # We know there are some built in handlers
    assert len(self.annotation_handlers) >= 1

but entrypoints.get_group_all("omero_scripts.script_provider")

@joshmoore
Copy link

@joshmoore Can you explain a bit more what you're thinking here? "no longer need to modify lib/scripts" You mean that the scripting service will use scripts from a different location?

Yeah, the processor.py would make use of entrypoints to load the strings of the scripts. In an initial prototype, that might mean that the strings get written to lib/scripts though that's likely to have permission issues in various scenarios (like Docker). So the server will need to be updated to use the discovered scripts from processor. To support situations where someone has updated their scripts locally, the contents of lib/scripts should take priority, but this would be the beginning of deprecating them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants