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

Reactivate infra #57

Closed
wants to merge 11 commits into from
Closed

Conversation

will-moore
Copy link
Member

@will-moore will-moore commented Nov 28, 2019

This tests omero-test-infra when the omero_mapr/__init__.py imports the urls.py.
I think we often don't see the failure of urls.py to import because it doesn't happen when the omero_mapr module itself is imported.
This is on top of #56 (alternative sibling PR since we are both working on this)

@will-moore
Copy link
Member Author

will-moore commented Nov 28, 2019

After that last commit I see:

+ python .//setup.py test
testimport urls.py...
ImportError
running pytest

but no stacktrace to show how the import failed.

However, I see this later:

Running PyYAML-5.2b1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-8zzdcwu0/PyYAML-5.2b1/egg-dist-tmp-rvh9xhou
Traceback (most recent call last):
  File "/omero-mapr/omero_mapr/__init__.py", line 30, in <module>
    from . import urls
  File "/omero-mapr/omero_mapr/urls.py", line 23, in <module>
    from . import views
  File "/omero-mapr/omero_mapr/views.py", line 33, in <module>
    from omero import ApiUsageException, ServerError
ImportError: cannot import name 'ApiUsageException'

However, running .omero/docker app locally I instead see the same import error at a different point

+ python setup.py clean
testimport urls.py...
ImportError
running clean
Traceback (most recent call last):
  File "/omero-mapr/omero_mapr/__init__.py", line 30, in <module>
    from . import urls
  File "/omero-mapr/omero_mapr/urls.py", line 23, in <module>
    from . import views
  File "/omero-mapr/omero_mapr/views.py", line 35, in <module>
    from omero import ApiUsageException, ServerError
ImportError: cannot import name 'ApiUsageException'

@will-moore
Copy link
Member Author

will-moore commented Nov 28, 2019

Locally, this fails:

>>> from omero import ApiUsageException
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name ApiUsageException

but works if you first do import omero.clients (which fails flake8)!

After adding import omero.clients in the last commit above, we now fail travis with

+ python setup.py clean
testimport urls.py...
Traceback (most recent call last):
  File "setup.py", line 38, in <module>
    version = __import__('omero_mapr').get_version()
  File "/omero-mapr/omero_mapr/__init__.py", line 30, in <module>
    from . import urls
  File "/omero-mapr/omero_mapr/urls.py", line 23, in <module>
    from . import views
  File "/omero-mapr/omero_mapr/views.py", line 38, in <module>
    from .mapr_settings import mapr_settings
  File "/omero-mapr/omero_mapr/mapr_settings.py", line 73, in <module>
    TEMPLATES = getattr(settings, 'TEMPLATES', [])
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/django/conf/__init__.py", line 56, in __getattr__
    self._setup(name)
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/django/conf/__init__.py", line 39, in _setup
    % (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting TEMPLATES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

@will-moore
Copy link
Member Author

After removing the usage of ApiException and ServerError, we are still seeing

+ python setup.py clean
testimport urls.py...
Traceback (most recent call last):
  File "setup.py", line 38, in <module>
    version = __import__('omero_mapr').get_version()
  File "/omero-mapr/omero_mapr/__init__.py", line 30, in <module>
    from . import urls
  File "/omero-mapr/omero_mapr/urls.py", line 23, in <module>
    from . import views
  File "/omero-mapr/omero_mapr/views.py", line 35, in <module>
    from .mapr_settings import mapr_settings
  File "/omero-mapr/omero_mapr/mapr_settings.py", line 73, in <module>
    TEMPLATES = getattr(settings, 'TEMPLATES', [])
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/django/conf/__init__.py", line 56, in __getattr__
    self._setup(name)
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/django/conf/__init__.py", line 39, in _setup
    % (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting TEMPLATES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

@will-moore
Copy link
Member Author

Failing with:

+ python setup.py clean
ERROR:omeroweb.webgateway.views:No numpy installed
testimport urls.py...
Traceback (most recent call last):
  File "setup.py", line 41, in <module>
    version = __import__('omero_mapr').get_version()
  File "/omero-mapr/omero_mapr/__init__.py", line 30, in <module>
    from . import urls
  File "/omero-mapr/omero_mapr/urls.py", line 36, in <module>
    DEFAULT_CONFIG = list(mapr_settings.CONFIG.keys())[0]
IndexError: list index out of range

@snoopycrimecop
Copy link
Member

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

--conflicts

@will-moore
Copy link
Member Author

To test locally need to

docker pull openmicroscopy/omero-web:5.6

@will-moore
Copy link
Member Author

NOCLEAN=true .omero/docker app
.omero/compose exec web bash
/opt/omero/web/OMERO.web/bin/omero config get | grep mapr

shows nothing, so it looks like the mapr config didn't get picked up, which could explain why

DEFAULT_CONFIG = list(mapr_settings.CONFIG.keys())[0]
IndexError: list index out of range

@snoopycrimecop
Copy link
Member

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

--conflicts

@will-moore
Copy link
Member Author

@joshmoore @manics Any idea how to debug the reading of the config file in https://github.com/ome/omero-mapr/blob/master/.omeroci/app-config to see why this might not be read by omero-test-infra?

@joshmoore
Copy link
Member

I updated .omeroci/app-config to print "XXX". I found a "config.xml not found issue". (This would have turned into a hard-failure with your recently merged PR). ome/omero-test-infra#52 fixes the issue. With that PR, however, I'm seeing:

  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omeroweb/settings.py", line 1050, in <module>
    'DEPRECATED_SETTINGS_MAPPINGS')
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omeroweb/settings.py", line 1039, in process_custom_settings
    (global_name, key, global_value, e.message, description))
AttributeError: 'JSONDecodeError' object has no attribute 'message'
+ clean_up

@snoopycrimecop
Copy link
Member

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

--conflicts

@will-moore
Copy link
Member Author

With the latest fix to omero-test-infra: ome/omero-test-infra#53 and last commits above, I now see tests running locally but Error on import.
Tried importing to another server (don't know login for docker-compose omero):

$ NOCLEAN=true .omero/docker app
...
=============== 12 passed, 1 xpassed, 28 error in 11.74 seconds ================

$ .omero/compose exec web bash
bash-4.2$ cd /opt/omero/web/OMERO.web/
2$ bin/omero import /opt/omero/web/venv3/lib/python3.6/site-packages/omeroweb/webclient/static/webclient/image/table_layout.png
Server: [localhost:4064]idr1-slot2.openmicroscopy.org
Username: [omero-web]user-3
Password:
Created session for user-3@idr1-slot2.openmicroscopy.org:4064. Idle timeout: 10 min. Current group: read-only-1
Traceback (most recent call last):
  File "/opt/omero/web/venv3/bin/omero", line 131, in <module>
    rv = omero.cli.argv()
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero/cli.py", line 1756, in argv
    cli.invoke(args[1:])
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero/cli.py", line 1187, in invoke
    stop = self.onecmd(line, previous_args)
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero/cli.py", line 1264, in onecmd
    self.execute(line, previous_args)
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero/cli.py", line 1346, in execute
    args.func(args)
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero/plugins/import.py", line 518, in importer
    self.do_import(command_args, xargs)
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero/plugins/import.py", line 529, in do_import
    stdout=out, stderr=err)
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero/java.py", line 140, in popen
    check_java(command)
  File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero/java.py", line 31, in check_java
    raise Exception("Java could not be found. (Executable=%s)" % command[0])
Exception: Java could not be found. (Executable=java)

Don't know if this is the same as errors in tests:

        out, err = popen.communicate()
        rc = popen.wait()
        if rc != 0:
            raise Exception("import failed: [%r] %s\n%s\n%s" % (
>               args, rc, out, err))
E           Exception: import failed: [['/opt/omero/web/venv3/bin/python', './bin/omero', '-s', 'omero', '-k', '9084df87-51f5-4922-8cc2-b707882f92d9', '-p', '4064', 'import', '--skip', 'all', '--output', 'legacy', '--', path('/opt/omero/web/OMERO.web/var/omero/tmp/omero_omero-web/336/import_fake_file_01zyg1mji&&plates=1&plateAcqs=1&plateCols=6&plateRows=1&fields=1.fake')]] 1
E           b''
E           b'  File "./bin/omero", line 2\n    . /opt/omero/web/venv3/bin/activate\n    ^\nSyntaxError: invalid syntax\n'

@manics
Copy link
Member

manics commented Dec 10, 2019

Which version of the omero-web docker image are you running?

@will-moore
Copy link
Member Author

@manics Don't know. Whatever is specified by omero-test-infra.

@will-moore
Copy link
Member Author

Travis is green. 😄 I assume the tests are running and passing (but don't see them mentioned in the console).

@will-moore
Copy link
Member Author

Going to tidy up and open another clean PR

@will-moore will-moore closed this Dec 10, 2019
@will-moore will-moore mentioned this pull request Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants