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

Merge 23.1 into dev #17000

Merged
merged 26 commits into from
Nov 9, 2023
Merged

Merge 23.1 into dev #17000

merged 26 commits into from
Nov 9, 2023

Conversation

mvdbeek
Copy link
Member

@mvdbeek mvdbeek commented Nov 9, 2023

(Please replace this header with a description of your pull request. Please include BOTH what you did and why you made the changes. The "why" may simply be citing a relevant Galaxy issue.)
(If fixing a bug, please add any relevant error or traceback)
(For UI components, it is recommended to include screenshots or screencasts)

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

ElectronicBlueberry and others added 25 commits October 30, 2023 20:11
…aram_name_fallback

[23.1] Backport Fix select parameter doesn't show parameter name in UI
adds `biii` as supported xref reference type
Added a `fixed_delegated_path` variable to the `ConfigSerializer` that
lets us reroute users to home if we have a Galaxy set up with:
```
	config.enable_oidc
	and len(config.oidc) == 1
	and len(auth_manager.authenticators) == 0
```

as in; we only have 1 external auth and no local authenticator,
hence, we don't want users to be disconnecting the external
provider.
…f_fixed_delegated_auth

[23.1] Prevent Singular external auth users from disconnecting identity
Fix the following traceback:
```
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: uvicorn.access INFO 2023-06-30 10:28:03,573 [pN:main.1,p:3528860,tN:MainThread] 193.156.42.8:0 - "HEAD /root/login HTTP/1.0" 500
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: Exception in supplement:
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: Traceback (most recent call last):
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: File "/cluster/galaxy-test/srv/galaxy/server/lib/galaxy/web/framework/middleware/error.py", line 165, in __call__
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: app_iter = self.application(environ, sr_checker)
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: File "/cluster/galaxy-test/srv/galaxy/venv/lib64/python3.11/site-packages/paste/recursive.py", line 85, in __call__
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: return self.application(environ, start_response)
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: File "/cluster/galaxy-test/srv/galaxy/venv/lib64/python3.11/site-packages/paste/httpexceptions.py", line 640, in __call__
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: return self.application(environ, start_response)
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: File "/cluster/galaxy-test/srv/galaxy/server/lib/galaxy/web/framework/base.py", line 167, in __call__
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: return self.handle_request(environ, start_response)
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: File "/cluster/galaxy-test/srv/galaxy/server/lib/galaxy/web/framework/base.py", line 221, in handle_request
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: rc.environ = environ
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: ^^^^^^^^^^
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: File "/cluster/galaxy-test/srv/galaxy/venv/lib64/python3.11/site-packages/routes/__init__.py", line 23, in __setattr__
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: self.load_wsgi_environ(value)
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: File "/cluster/galaxy-test/srv/galaxy/venv/lib64/python3.11/site-packages/routes/__init__.py", line 73, in load_wsgi_environ
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: self.__shared_state.host += ':' + environ['SERVER_PORT']
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Jun 30 10:28:03 galaxy01-test.educloud.no galaxyctl[3528286]: TypeError: can only concatenate str (not "int") to str
```

Reported by @vazovn : https://matrix.to/#/!rfLDbcWEWZapZrujix:gitter.im/$McOyd5Kmp-w-Z-bYbRUV42K30YhVvwRJtrCaxru-yf4?via=gitter.im&via=matrix.org
…tes_bug

[23.1] Workaround issue in Routes
[23.1] Backport Fix maf_thread_for_species.py
…fix-backport

[23.1] Empty page render fix - backport
and invalidate `_output_hdas_and_paths` when current session is not the
same session that was used to populate `_output_hdas_and_paths`.

The Job instance may originate from a session that is associated to
another thread, and when that thread closes the session the instance
(along with other instances retrieved through loading relationships)
becomes detached.

I am not sure at all if this will fix
```
DetachedInstanceError: Instance <HistoryDatasetAssociation at 0x7fe68bbf14f0> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: https://sqlalche.me/e/14/bhk3)
  File "galaxy/jobs/runners/__init__.py", line 291, in prepare_job
    job_wrapper.prepare()
  File "galaxy/jobs/__init__.py", line 1248, in prepare
    tool_evaluator.set_compute_environment(compute_environment, get_special=get_special)
  File "galaxy/tools/evaluation.py", line 162, in set_compute_environment
    self.param_dict = self.build_param_dict(
  File "galaxy/tools/evaluation.py", line 204, in build_param_dict
    self.__populate_output_dataset_wrappers(param_dict, output_datasets, job_working_directory)
  File "galaxy/tools/evaluation.py", line 447, in __populate_output_dataset_wrappers
    param_dict[name] = DatasetFilenameWrapper(
  File "galaxy/tools/wrappers.py", line 403, in __init__
    path_rewrite = compute_environment and compute_environment.output_path_rewrite(dataset_instance)
  File "galaxy/job_execution/compute_environment.py", line 132, in output_path_rewrite
    return str(self.job_io.get_output_path(dataset))
  File "galaxy/job_execution/setup.py", line 226, in get_output_path
    if hda.id == dataset.id:
  File "sqlalchemy/orm/attributes.py", line 487, in __get__
    return self.impl.get(state, dict_)
  File "sqlalchemy/orm/attributes.py", line 959, in get
    value = self._fire_loader_callables(state, key, passive)
  File "sqlalchemy/orm/attributes.py", line 990, in _fire_loader_callables
    return state._load_expired(state, passive)
  File "sqlalchemy/orm/state.py", line 712, in _load_expired
    self.manager.expired_attribute_loader(self, toload, passive)
  File "sqlalchemy/orm/loading.py", line 1369, in load_scalar_attributes
    raise orm_exc.DetachedInstanceError(
```
but it seems to make some sense. JobIO crosses thread boundaries as part
of the job wrapper getting put into threading queues.

Ideally we'd make sure that no ORM instance crosses the thread boundary
(or we systematically re-associated with a session).

I also tried flagging these patterns automatically using something like:

```

    @event.listens_for(session, "persistent_to_detached")
    def on_detach(sess, instance):
        if not getattr(instance, "allow_detatch", False):
            raise Exception(f"{instance} detached. This ain't good for how we do things ?")
```

but it seems tricky to figure out when this is fine and when it is not.
…ob_object

[23.1] Don't store job in JobIO instance attributes
@dannon dannon merged commit a1b5485 into galaxyproject:dev Nov 9, 2023
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants