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

[23.1] Workaround for XML nodes of job resource parameters losing their children #16728

Conversation

kysrpex
Copy link
Contributor

@kysrpex kysrpex commented Sep 22, 2023

This is a workaround for, and thus closes #16727.

This bug was spotted because the job resource parameters selector broke on usegalaxy.eu. For the tool keras_train_and_eval, the option "Use GPU resources" shows up, but no drop-down menu is available and no items can be selected.

The options are available as children of the XML nodes tagged with "param" within the scope of galaxy.jobs.parse_resource_parameters. They are then returned and later retrieved within the scope of galaxy.util.parse_resource_parameters, but by then, the children of the XML node (the options) are gone.

It seems that returning strings rather than lxml Element objects, and then converting the strings back to Element objects fixes the bug. I have no clue why. As said on #16727, this is likely not a Galaxy bug but rather something related either to lxml or whatever is doing the garbage collection. Nevertheless, this cannot be left broken.

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. Apply the changes of this PR.
    2. Visit the keras_train_and_eval tool page.
    3. Things work as expected again.

License

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

…dren

This bug was spotted because the job resource parameters selector broke on usegalaxy.eu. For the tool keras_train_and_eval, the option "Use GPU resources" shows up, but no drop-down menu is available and no items can be selected.

The options are available as children of the XML nodes tagged with "param" within the scope of `galaxy.jobs.parse_resource_parameters`. They are then returned and later retrieved within the scope of `galaxy.util.parse_resource_parameters`, but by then, the children of the XML node (the options) are gone.

See galaxyproject#16727 for more details.
@github-actions github-actions bot added this to the 23.2 milestone Sep 22, 2023
@kysrpex kysrpex changed the base branch from dev to release_23.1 September 22, 2023 16:17
@kysrpex kysrpex changed the title Workaround for XML nodes of job resource parameters losing their children [23.1] Workaround for XML nodes of job resource parameters losing their children Sep 22, 2023
Copy link
Member

@mvdbeek mvdbeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, the reason this became a problem is because we get rid of the tool source, which takes up a lot of memory. Ideally we'd fully parse out the conditional, but this will work for now.

Import `etree` from `galaxy.util` as suggested in the code review.

Co-authored-by: Marius van den Beek <[email protected]>
@kysrpex
Copy link
Contributor Author

kysrpex commented Sep 25, 2023

I cannot merge, so go ahead :)

@mvdbeek mvdbeek merged commit 602cdd4 into galaxyproject:release_23.1 Sep 25, 2023
@github-actions
Copy link

This PR was merged without a "kind/" label, please correct.

@kysrpex kysrpex deleted the job_resource_parameters_child_elements_missing branch September 25, 2023 08:27
@dannon dannon modified the milestones: 23.2, 23.1 Sep 25, 2023
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.

Job resource parameters selector broken on usegalaxu.eu (unknown causes)
3 participants