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

Per-host configuration ignored for some hostnames #17664

Open
neoformit opened this issue Mar 12, 2024 · 8 comments
Open

Per-host configuration ignored for some hostnames #17664

neoformit opened this issue Mar 12, 2024 · 8 comments
Assignees

Comments

@neoformit
Copy link
Collaborator

Relates to "per-host configuration" of Galaxy: #12328

Galaxy Version and/or server at which you observed the bug
Galaxy Version: 23.2.1.dev0 https://dev.gvl.org.au/
Commit: 8bda304

I am trying to set the default_panel_view as a by_host parameter. However, when I set the following in galaxy.yml on Galaxy AU Dev it seems to have no effect. The tool panel loads the normal default:

    default_panel_view_by_host:
      proteomics.dev.gvl.org.au: proteomics

However, when I try to replicate the bug locally, the following seems to work fine i.e. I get proteomics as the default panel when I open the site on http://localhost/:

    default_panel_view_by_host:
      localhost: proteomics

So it seems like this feature works, but for some hostnames it stops working?

Additional context
I can confirm the same pattern with support_url_by_host (works locally, not on dev.gvl.org.au), so this seems to be a general issue with the _by_host feature and not limited to the default_panel_view param:

WORKS: default_tool_panel: proteomics
NOT WORKING: default_tool_panel_by_host: dev.gvl.org.au
NOT WORKING: default_tool_panel_by_host: proteomics.dev.gvl.org.au
NOT WORKING: support_url_by_host: dev.gvl.org.au
NOT WORKING: support_url_by_host: proteomics.dev.gvl.org.au
WORKS (local): support_url_by_host: localhost/127.0.0.1

@neoformit
Copy link
Collaborator Author

So I added the following lines to galaxy/config/init.py#813:

            for host_key, host_val in per_host.items():
                if per_host_option == 'support_url_by_host':
                    log.info(f"LOADING SUPPORT URL | host: {host}, host_key: {host_key}, host_val: {host_val}")

With the following galaxy.yml config:

support_url_by_host:
  'dev.gvl.org.au': https://site.usegalaxy.org.au/help
  'proteomics.dev.gvl.org.au': https://google.com 

And on dev.gvl.org.au this produces the following logs on request of proteomics.gvl.org.au:

LOADING SUPPORT URL | host: proteomics.gvl.org.au, host_key: dev.gvl.org.au, host_val: https://site.usegalaxy.org.au/help

Now, looking at the code in config/init.py, it obviously matches the first key that is a substring of host.

So, when using this feature for subdomains, this won't work:

support_url_by_host:
  'dev.gvl.org.au': https://site.usegalaxy.org.au/help
  'proteomics.dev.gvl.org.au': https://google.com 

... but this will:

support_url_by_host:
  'proteomics.dev.gvl.org.au': https://google.com
  'dev.gvl.org.au': https://site.usegalaxy.org.au/help 

I will link this from the PR so that others can see this issue. @jdavcs I'll leave it up to you whether this is a bug or a feature!

@neoformit
Copy link
Collaborator Author

neoformit commented Mar 12, 2024

Also note that default_panel_view is not listed as per_host in config_schema.yml:

default_panel_view:
type: str
default: default
required: false
desc: |
Default tool panel view for the current Galaxy configuration. This should refer to an id of
a panel view defined using the panel_views or panel_views_dir configuration options or an
EDAM panel view. The default panel view is simply called `default` and refers to the tool
panel state defined by the integrated tool panel.

So this will not work for John's intended use case (which is also my intended use case!) until we fix that. I'll make a PR for this.

@neoformit
Copy link
Collaborator Author

neoformit commented Mar 12, 2024

So I updated the config_schema.yml and that got me this log line (when opening proteomics.dev.gvl.org.au in the browser) to show that the per_host param selection is working:

LOADING 'default_panel_view_by_host' WITH host: proteomics.dev.gvl.org.au, host_key: proteomics.dev.gvl.org.au, host_val: proteomics

... but the default tool panel is still loaded!

I can set the default panel view globally as follows, and that works OK:

default_panel_view: proteomics

So for some reason it's only when default_panel_view comes from a per_host config that it stops working.

@neoformit
Copy link
Collaborator Author

@jdavcs should I open a separate issue for the above?

@jdavcs
Copy link
Member

jdavcs commented May 9, 2024

@neoformit Sorry for the delay! I was able to reproduce. Working on it now, so no need for a separate issue.

@neoformit
Copy link
Collaborator Author

Amazing, thanks! This has been a blocker for me for quite a few months now. Also just had some trouble with themes_config_file_by_host along the same lines...

@nomadscientist
Copy link
Contributor

This is now a blocker for the great single-cell subdomain unification as well! Can this please be fixed??? @natefoo <--- I think this is what is blocking you for this, right?

@mvdbeek
Copy link
Member

mvdbeek commented Jul 4, 2024

For default_panel_view that's fixed in #18471, if other options aren't working it's a good idea to check that the per_host schema option is set and that the config values are parsed as in that PR.

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

No branches or pull requests

4 participants