Page 3 of 4

Re: Importing 'public' images from OMERO5.server to ImageJ

PostPosted: Thu Sep 11, 2014 8:01 am
by jmoore
Hi Yukako,

in order to create a token with non-standard timeouts you'll need to use an admin account. We're working on creating tools for this, but for the moment you could use a script like this:
Code: Select all
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Creates a token for another user running as an administrator.
"""

NAME = "public_user"
GROUP = "public_group"
IDLE = 0
LIVE = 60*60*24 # 1 day
ADMIN_PASS = "xxxSECRETxxx"

import omero
c = omero.client("localhost")
s = c.createSession("root", ADMIN_PASS)
try:
    service = s.getSessionService()
    principal = omero.sys.Principal()
    principal.name = NAME
    principal.group = GROUP
    principal.eventType = "User"
    session = service.createSessionWithTimeouts(principal, LIVE * 1000, IDLE * 1000)
    uuid = session.getUuid().getValue()
    idle = session.getTimeToIdle().getValue() / 1000
    live = session.getTimeToLive().getValue() / 1000
    print "Session created:"
    print "uuid=%s" % uuid
    print "idle=%s sec(s)" % idle
    print "live=%s sec(s)" % live
finally:
    c.__del__()


This will print out something like this:
Code: Select all
$ PYTHONPATH=dist/lib/python python token.py                                                                                                                                                                     
Session created:
uuid=6a41f31c-cf16-4fd1-8a89-42b89df66dd1
idle=0 sec(s)
live=86400 sec(s)


Let us know if this works for you.
Cheers,
~J.

Re: Importing 'public' images from OMERO5.server to ImageJ

PostPosted: Thu Sep 11, 2014 8:21 am
by tohsato
Dear jmoore,

All interactions worked well. Many thanks!!

Yukako.

Re: Importing 'public' images from OMERO5.server to ImageJ

PostPosted: Thu Sep 11, 2014 9:54 am
by tohsato
Dear jmoore,

Is there a way to specify (or fix) the string of session ID
such as "11111111-1111-1111-1111-11111111111" in your script?

Yukako.

Re: Importing 'public' images from OMERO5.server to ImageJ

PostPosted: Thu Sep 11, 2014 10:11 am
by jmoore
What are you trying to achieve by specifying the UUID? In general, I don't think this is possible since it's randomly chosen by the server.

~Josh.

Re: Importing 'public' images from OMERO5.server to ImageJ

PostPosted: Thu Sep 11, 2014 10:36 am
by tohsato
Dear jmoore,

I installed OMERO.server into two servers (named "ssbd1" and "ssbd2").
These servers share postgresql database. Server load dispersion system
(named "ssbd") switchs internally these servers corresponding to the loads.
Users only allow to access into "ssbd".

I might change this server's settings, when session IDs randomly chosen
by the server.

Yukako.

Re: Importing 'public' images from OMERO5.server to ImageJ

PostPosted: Thu Sep 11, 2014 10:57 am
by jmoore
Oh, interesting. In general, we've only ever tested having one active OMERO pointing at a single PostgreSQL instance (with subsequent "slaves" waiting to take over). Once you've logged in with the UUID, you'll have the problem of needing to route users to the same instance that they logged in to. Have you run into this problem yet?

Cheers,
~Josh.

Re: Importing 'public' images from OMERO5.server to ImageJ

PostPosted: Thu Sep 11, 2014 12:59 pm
by tohsato
Dear jmoore,

That is just as you indicated.

Cheers,
Yukako

Re: Importing 'public' images from OMERO5.server to ImageJ

PostPosted: Thu Sep 11, 2014 2:37 pm
by jmoore
Hi Yukako,

how are you running the multiple instances? You could try launching multiple Blitz (in etc/grid/default.xml) rather than re-running bin/omero admin start. This would put the two services into the same "grid" at which point some of your problems may go away.

Cheers,
~Josh.

Re: Importing 'public' images from OMERO5.server to ImageJ

PostPosted: Thu Sep 11, 2014 2:38 pm
by jmoore

Re: Importing 'public' images from OMERO5.server to ImageJ

PostPosted: Fri Sep 12, 2014 5:34 am
by tohsato
Dear Josh,

Thanks many information. I'll check it.
We're using Heatbeat. I attached our network structure.

Regards,
Yukako