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

Josh Moore josh at glencoesoftware.com
Fri Nov 10 09:22:00 GMT 2017


Hi Elidh,

On Thu, Nov 9, 2017 at 5:07 PM, Eilidh Troup <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

I've update your script:
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


More information about the ome-devel mailing list