[ome-devel] Plan for transferring data from one OMERO to another

Eilidh Troup e.troup at epcc.ed.ac.uk
Tue Dec 5 21:51:25 GMT 2017


Hi Josh,

Thanks for your help. I can now transfer an image from one OMERO to another  : )

I’ve put the latest version of the script at https://github.com/SynthSys/omero-user-scripts/blob/master/Export_to_other_omero.py <https://github.com/SynthSys/omero-user-scripts/blob/master/Export_to_other_omero.py>

I’ve got more questions though:
How can I find the managed repository directory? (Something like omero.managed.dir, Default: ${omero.data.dir}/ManagedRepository ?)
How can I hide the password text entry? 
How can I get the newly created image id? It is printed to stdout as "Image:920" for example, but I don't know how to get hold of that number in my script.


Also, the docker script you sent didn’t quite work (don’t worry about it though, I got what I needed from your example) - I got this error when I ran the python script:

bash-4.2$ python /gist/export_to_remote_omero.py
Traceback (most recent call last):
  File "/gist/export_to_remote_omero.py", line 24, in <module>
    sf = c.createSession(REMOTE_USER, REMOTE_PASS)
  File "/opt/omero/server/OMERO.server-5.4.0-ice36-b74/lib/python/omero/clients.py", line 569, in createSession
    prx = rtr.createSession(username, password, ctx)
  File "/usr/lib64/python2.7/site-packages/Glacier2_Router_ice.py", line 258, in createSession
    return _M_Glacier2.Router._op_createSession.invoke(self, ((userId, password), _ctx))
Glacier2.PermissionDeniedException: exception ::Glacier2::PermissionDeniedException
{
    reason = internal server error
}

Thanks,
Eilidh


> On 10 Nov 2017, at 09:22, Josh Moore <josh at glencoesoftware.com <mailto:josh at glencoesoftware.com>> wrote:
> 
> Hi Elidh,
> 
> On Thu, Nov 9, 2017 at 5:07 PM, Eilidh Troup <e.troup at epcc.ed.ac.uk <mailto:e.troup at epcc.ed.ac.uk>> wrote:
>> Hi,
>> 
>> I’ve run into a similar problem as last time.
> 
> Turns out, there's a similar solution.
> 
>> I’ve written a script that
>> will upload an image to a remote OMERO server, but only from the python
>> command line, and not from within a script running in a local OMERO. As
>> before, the script will work from the command line or from with OMERO when
>> transferring the image to the local OMERO server. When I try to import an
>> image on the remote server, I get the following error:
> ...
>> 
>> The code, and full error output are below.
>> I’ve also put it into a different script on gist that demonstrates the error
>> by running it from within OMERO as a script.
>> https://gist.github.com/eilidh-t/e763dab7d4f3515cc85b0b6ddfb8d9f4 <https://gist.github.com/eilidh-t/e763dab7d4f3515cc85b0b6ddfb8d9f4>
> 
> I've update your script:
> https://gist.github.com/joshmoore/0c2e5319d8d5ae7f79ee82e3e68b721b <https://gist.github.com/joshmoore/0c2e5319d8d5ae7f79ee82e3e68b721b>
> 
> The most important change is:
> 
>    del os.environ["ICE_CONFIG"] before importing
> 
> which does the equivalent of `Ice.Config=/dev/null` but for the import
> process. Likely, that should be done closer to the top.
> 
> Other changes include:
> 
> * use ome.cli.CLI rather than calling subprocess (simplicity)
> * only register the script if it doesn't exist (less test mess)
> * pass a key to not store the root's password (security)
> * adding a warning about the security whole that this script could
> cause (security)
> 
> My general workflow was:
> 
> * docker-compose up -d
> * docker-compose exec omero1 bash
> * cd /opt/omero/server/OMERO.server
> * export PYTHONPATH=lib/python
> * python /gist/export_to_remote_omero.py
> 
> If I needed to change the script, I deleted the uploaded file from
> lib/script/export_to_remote_omero.py and re-ran.
> 
>> Thanks for your help with this,
>> Eilidh
> 
> 
> Let us know if that works for you.
> ~J
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20171205/c6fb1ef2/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20171205/c6fb1ef2/attachment.ksh>


More information about the ome-devel mailing list