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

allow creation of thumbnails in all-groups context #5207

Merged
merged 18 commits into from
May 9, 2017

Conversation

mtbc
Copy link
Member

@mtbc mtbc commented Mar 29, 2017

What this PR does

Adjusts the heart of the server's thumbnail generation so that in a omero.group: -1 context thumbnails can still be generated, by grouping the pixels objects by group and creating their thumbnails in the corresponding group context.

Testing this PR

Experiment with the thumbnail service to ensure that this PR does not cause any regressions.

Check if the new https://ci.openmicroscopy.org/job/OMERO-DEV-merge-integration-java/lastCompletedBuild/testngreports/integration/ThumbnailStoreTest/testGetThumbnailsMultipleGroups/ test passes and looks to relate to what this PR does.

Related reading

https://trello.com/c/bJqd3SkJ/39-getthumbnailbylongestsideset-doesn-t-accept-ctx

@will-moore
Copy link
Member

Testing locally with my branch based on @aleksandra-tarkowska's work seems to work fine.
I can browse thumbnails in webclient when they're not in my default group (using omero.group: -1).
I'll open my PR again to allow testing in web #5192

@will-moore
Copy link
Member

After "Save to All" I am getting failures in getThumbnailSet() but not for getThumbnail(). Doesn't appear to be group-specific (same behaviour in default group vv other group, always using group -1). Need to investigate more...

@mtbc
Copy link
Member Author

mtbc commented Mar 30, 2017

Hmmm. I tried switching testGetThumbnailsMultipleGroups to use getThumbnailSet and also to try a non-standard 72×72 thumbnail size and that still passes for me locally. I wonder if we can find a simple way to reconstruct the error that you are observing. Also, I wonder if it is a regression.

@will-moore
Copy link
Member

So, after I do

settingsService.applySettingsToSet(pid, "Image", [56686])

I get an exception for

tb.getThumbnailByLongestSideSet(rint(96), [pid, pid2])

Exception!!! Traceback (most recent call last):
  File "/Users/wmoore/Desktop/OMERO/openmicroscopy/dist/lib/python/omero/gateway/__init__.py", line 4454, in getThumbnailSet
    rint(max_size), list(_temp), ctx)
  File "/Users/wmoore/Desktop/OMERO/openmicroscopy/dist/lib/python/omero/gateway/__init__.py", line 4514, in __call__
    return self.handle_exception(e, *args, **kwargs)
  File "/Users/wmoore/Desktop/OMERO/openmicroscopy/dist/lib/python/omeroweb/webclient/webclient_gateway.py", line 2025, in handle_exception
    e, *args, **kwargs)
  File "/Users/wmoore/Desktop/OMERO/openmicroscopy/dist/lib/python/omero/gateway/__init__.py", line 4511, in __call__
    return self.f(*args, **kwargs)
  File "/Users/wmoore/Desktop/OMERO/openmicroscopy/dist/lib/python/omero_api_ThumbnailStore_ice.py", line 650, in getThumbnailByLongestSideSet
    return _M_omero.api.ThumbnailStore._op_getThumbnailByLongestSideSet.invoke(self, ((size, pixelsIds), _ctx))
SecurityViolation: exception ::omero::SecurityViolation
{
    serverStackTrace = ome.conditions.SecurityViolation: Group is ------. Cannot link to object: ome.model.core.Pixels:Id_39754
	at ome.security.basic.OmeroInterceptor.throwIfNotGranted(OmeroInterceptor.java:1179)
	at ome.security.basic.OmeroInterceptor.evaluateLinkages(OmeroInterceptor.java:585)

but this is fixed AFTER I get a single thumbnail for that image (pid2).

@will-moore
Copy link
Member

The error at #5207 (comment) was using a combination of webclient and python API. I'll try and make a self-contained test.

@atarkowska
Copy link
Member

atarkowska commented Mar 30, 2017

@will-moore
Copy link
Member

// This works to start with:
tb.getThumbnailByLongestSideSet(rint(96), [pid1, pid2], {'omero.group': '-1'})

// But after doing this:
ss.applySettingsToSet(pid1, "Image", [imageId2])

// This now fails with the Exception above
tb.getThumbnailByLongestSideSet(rint(96), [pid1, pid2], {'omero.group': '-1'})
    serverExceptionClass = ome.conditions.SecurityViolation
    message = Group is ------. Cannot link to object: ome.model.core.Pixels:Id_39754

// But without the group -1 context, this works
 tb.getThumbnailByLongestSideSet(rint(96), [pid1, pid2])
// And NOW, this will work again too!
tb.getThumbnailByLongestSideSet(rint(96), [pid1, pid2], {'omero.group': '-1'})

Do you want me to write a Python integration test for this in a separate branch?

@will-moore
Copy link
Member

@aleksandra-tarkowska
This works now with group -1 (with images from different groups).

tb.getThumbnailByLongestSideSet(rint(96), [pid1, pid2], {'omero.group': '-1'})

So I've re-opened my PR above #5192 and reverted your commit that used group: None.
Everything works fine except after you "Save to All" (see last code sample above).

@atarkowska
Copy link
Member

atarkowska commented Mar 30, 2017

@will-moore feel free to open against #5158 so we will reduce number of dependent branches

#5192 can be closed now

try {
applicationContext.publishMessage(new ContextMessage.Push(this, groupContext));
} catch (Throwable t) {
log.error("could not publish context change push", t);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the exceptions on push/pop not be thrown?

@mtbc
Copy link
Member Author

mtbc commented Mar 31, 2017

Do you want me to write a Python integration test for this in a separate branch?

Thank you for the offer! I'll start out by trying to reproduce this as part of the existing Java test class.

@mtbc mtbc closed this Mar 31, 2017
@mtbc mtbc reopened this Mar 31, 2017
@snoopycrimecop
Copy link
Member

Conflicting PR. Removed from build OMERO-DEV-merge-push#648. See the console output for more details.
Possible conflicts:

@atarkowska
Copy link
Member

--rebased-to #5234

@will-moore will-moore mentioned this pull request Apr 5, 2017
@will-moore
Copy link
Member

Test created at #5235

@mtbc
Copy link
Member Author

mtbc commented Apr 13, 2017

To check: this PR may break thumbnails in shares.

@atarkowska
Copy link
Member

atarkowska commented Apr 13, 2017

is share workflow not going to be removed in 5.3.x ?

@mtbc
Copy link
Member Author

mtbc commented Apr 13, 2017

I don't know that it is.

@jburel
Copy link
Member

jburel commented Apr 13, 2017

It cannot be removed in 5.3.x, it has just been deprecated.
We still need to be sure that the existing shares work

@pwalczysko
Copy link
Member

This PR indeed does seem to break thumbnails in Shares. Checked today on eel merge.

@mtbc
Copy link
Member Author

mtbc commented Apr 18, 2017

@pwalczysko: The latest commit attempts to fix the shares issue.

@pwalczysko
Copy link
Member

Checked that the PR is in, it seems to be. https://github.com/snoopycrimecop/openmicroscopy/tree/develop/merge/daily.

There is no change in behaviour with respect to shares, the thumb problem persists.
screen shot 2017-04-20 at 09 55 43

@mtbc
Copy link
Member Author

mtbc commented Apr 20, 2017

Which user is sharing with which user?

@pwalczysko
Copy link
Member

user-4 and user-1, and vice versa.

@pwalczysko
Copy link
Member

The other problem with plates persists as well. #5158 (comment)

@mtbc
Copy link
Member Author

mtbc commented Apr 20, 2017

In local testing this works with #5207 only

web

but when I include #5158 in the merge I lose the thumbnail, so I think this PR's fine. (Similarly, recall that the plate problem was fine a couple of days ago when this PR was in but #5158 was still excluded.)

@atarkowska
Copy link
Member

atarkowska commented Apr 20, 2017

That would make sense because web in this branch is not using getThumbnailByLongestSideSet. That is the problem we are trying to fix.

@mtbc
Copy link
Member Author

mtbc commented Apr 20, 2017

Both this PR's integration test and @will-moore's in #5235 use getThumbnailByLongestSideSet.

@atarkowska
Copy link
Member

For some reason https://github.com/openmicroscopy/openmicroscopy/pull/5158/files#diff-e4feecea30b2ee097639cbb7c9171fedR4455 is not working, it might be worth to reproduce that method in the first place?

@atarkowska
Copy link
Member

Both this PR's integration test and @will-moore's in #5235 use getThumbnailByLongestSideSet.

I am afraid in both mentioned PRs web loads thumbnail one by one using https://github.com/aleksandra-tarkowska/openmicroscopy/blob/2a66a0c129dd499aae6a88f398057f024a1f8183/components/tools/OmeroPy/src/omero/gateway/__init__.py#L8002

@will-moore will-moore mentioned this pull request Apr 20, 2017
@mtbc
Copy link
Member Author

mtbc commented Apr 28, 2017

@pwalczysko: Is this PR all good for you now?

@pwalczysko
Copy link
Member

Yes, ready to merge.

@jburel jburel merged commit 535c5b2 into ome:develop May 9, 2017
@mtbc mtbc deleted the thumbnail-context branch May 9, 2017 13:44
@jburel jburel added this to the 5.3.2 milestone May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants