-
Notifications
You must be signed in to change notification settings - Fork 18
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
Allow server-side panel code on S3 #1089
Allow server-side panel code on S3 #1089
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to test it on the dev deployment, still doesn't work
[I 2024-11-15 13:53:39,345 xcube] Applying initial configuration...
[W 2024-11-15 13:53:39,348 xcube] Downloading s3://xcube-viewer-app/bc/dev to /tmp/xcube-viewer-aux-utjgj30v
[W 2024-11-15 13:53:39,722 xcube] Temporarily prepending '/tmp/xcube-viewer-aux-utjgj30v' to sys.path
[I 2024-11-15 13:53:39,722 xcube] Loading viewer extension(s) my_viewer_ext.ext
[I 2024-11-15 13:53:39,723 xcube] Restored sys.path
[E 2024-11-15 13:53:39,723 xcube] Internal error: No module named 'my_viewer_ext'
Traceback (most recent call last):
File "/opt/conda/lib/python3.12/site-packages/xcube/cli/main.py", line 87, in main
exit_code = cli.main(args=args, obj=ctx_obj, standalone_mode=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.12/site-packages/xcube/cli/serve.py", line 251, in serve
server = Server(framework, config)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.12/site-packages/xcube/server/server.py", line 97, in init
ctx.on_update(None)
File "/opt/conda/lib/python3.12/site-packages/xcube/server/server.py", line 511, in on_update
next_api_ctx.on_update(prev_api_ctx)
File "/opt/conda/lib/python3.12/site-packages/xcube/webapi/viewer/context.py", line 41, in on_update
self.set_extension_context(path, extension_refs)
File "/opt/conda/lib/python3.12/site-packages/xcube/webapi/viewer/context.py", line 76, in set_extension_context
self.ext_ctx = ExtensionContext.load(self.server_ctx, extension_refs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.12/site-packages/chartlets/extensioncontext.py", line 58, in load
module = importlib.import_module(module_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'my_viewer_ext'
the my_viewer_ext exists on s3.
|
Tested and it works now! |
The code for server-side panels can now also be loaded from S3. For example:
In addition, the xcube test helper module
test.s3test
has been enhanced to support testing the experimental server-side panels described above:@s3_test()
for individual tests withtimeout
arg;s3_test_server()
withtimeout
arg to be used within tests function bodies;S3Test
,@s3_test()
, ands3_test_server()
now restore environment variables modified for the Moto S3 test server.Checklist:
[ ] New/modified features documented indocs/source/*
CHANGES.md