ome / omero-py

Python project containing Ice remoting code for OMERO
https://www.openmicroscopy.org/omero
GNU General Public License v2.0
20 stars 33 forks source link

CLI should support proxy settings #296

Open dominikl opened 3 years ago

dominikl commented 3 years ago

See Omero-py and proxy settings. The CLI would just have to pass ICE variables through to the Blitzgateway. Something similar was done for Insight: https://github.com/ome/omero-insight/pull/197 .

imagesc-bot commented 3 years ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/omero-py-and-proxy-settings/55456/2

joshmoore commented 3 years ago

I assumed that omero/client.java would make use of system properties that were set with JAVA_OPTS=-DIce... but that looks to be server-side only. I imagine that would be a fairly easy workaround.

dominikl commented 3 years ago

Does that mean, something like this (setting a wrong proxy) shouldn't work:

> export JAVA_OPTS=-DIce.HTTPProxyHost=1.2.3.4
> omero login

It does work, so the proxy setting is not taken into account, right?

joshmoore commented 3 years ago

Right. https://github.com/ome/omero-blitz/blob/master/src/main/java/omero/client.java#L361 or so would need to be updated to either place all the System properties inside the Ice properties or perhaps rather just the ones matching Ice.* and omero.*.

dominikl commented 3 years ago

Is it somehow possible to build omero-py with a custom omero-blitz, in order to test changes in omero-blitz? The setup.py seems to download omero-blitz from artifacts.openmicroscopy.org.

joshmoore commented 3 years ago

Definitely. That's what merge-ci does:

def get_blitz_location():

    config_blitz_version = "5.5.5"

    # simplified strings
    defaultsect = configparser.DEFAULTSECT
    version_key = "versions.omero-blitz"
    url_key = "versions.omero-blitz-url"

    # detect if in Jenkins or not
    if "JENKINS_URL" in os.environ:
        config_blitz_url = os.environ.get("JENKINS_URL")
        config_blitz_url += "job/OMERO-build-build/lastSuccessfulBuild/"
        config_blitz_url += "artifact/omero-blitz/build/distributions/"
        config_blitz_url += "omero-blitz-VERSION-python.zip"
    else:
        config_blitz_url = (
            "https://artifacts.openmicroscopy.org/artifactory/ome.releases/"
            "org/openmicroscopy/omero-blitz/VERSION/"
            "omero-blitz-VERSION-python.zip")