Single user Galaxy interactive app

feature-request

#1

Does anyone have a working example of running Galaxy as a single user application behind OnDemand? I feel like I’m close to getting this working but can’t figure out how to get the proxy part to work. When I try to use rnode/… I end up connecting to the galaxy server but getting a page with broken links back. When I try the /node/… method I get

404 Not Found
The resource could not be found.

No route for /node/hppsl230s-rcf-412-05-l.scg.stanford.edu/63989/

I think the rnode version is what I want, the problem is that it returns pages which have links like

/static/style/jquery.rating.css?v=1549134780

which are broken because the /rnode/…/ part doesn’t get put in and then the Galaxy page never fully loads. Galaxy works fine if I use a browser on the node and go to localhost:PORT.

My assumption is that if galaxy thinks it is running at http://localhost:${port}, the using the /rnode/… should mean the the OnDemand proxy part of this adds and removes /rnode/… from requests and returned pages so that galaxy never needs to know about, but that doesn’t seem to be what is happening.

Any pointers on how to get this to work would be appreciated.

griznog


#2

Actually I believe the node version is what you want. The version rnode only works if the server that its proxying to adds hyperlinks in the response that are only relative. websockify + turbovnc is a good example of this, and Shiny apps also are like this (mostly because Shiny apps are SPAs that don’t have hyperlinks to separate pages).

Galaxy, on the other hand serves static assets that by default have urls relative to the base url, defaulting to /. For example, looking at view-source:https://usegalaxy.org/ in Firefox I see these at the top of the page:

        <link href="/static/style/jquery.rating.css?v=1548446650" media="screen" rel="stylesheet" type="text/css" />
<link href="/static/style/jquery-ui/smoothness/jquery-ui.css?v=1548446650" media="screen" rel="stylesheet" type="text/css" />
<link href="/static/style/base.css?v=1548446650" media="screen" rel="stylesheet" type="text/css" />
<link href="/static/style/bootstrap-tour.css?v=1548446650" media="screen" rel="stylesheet" type="text/css" />
        
    <script src="/static/scripts/libs/raven.js?v=1548446650" type="text/javascript"></script>

In the rnode case, all of these URLs would fail because while Galaxy thinks it is running at http://localhost:${port} it is going to serve static assets URLs relative to this base URI. If, in your example, the galaxy server were running on hppsl230s-rcf-412-05-l.scg.stanford.edu listening on port 63989 you would want the URLs in the home page Galaxy serves instead to be:

        <link href="/node/hppsl230s-rcf-412-05-l.scg.stanford.edu/63989/static/style/jquery.rating.css?v=1548446650" media="screen" rel="stylesheet" type="text/css" />
<link href="/node/hppsl230s-rcf-412-05-l.scg.stanford.edu/63989/static/style/jquery-ui/smoothness/jquery-ui.css?v=1548446650" media="screen" rel="stylesheet" type="text/css" />
<link href="/node/hppsl230s-rcf-412-05-l.scg.stanford.edu/63989/static/style/base.css?v=1548446650" media="screen" rel="stylesheet" type="text/css" />
<link href="/node/hppsl230s-rcf-412-05-l.scg.stanford.edu/63989/static/style/bootstrap-tour.css?v=1548446650" media="screen" rel="stylesheet" type="text/css" />
        
    <script src="/node/hppsl230s-rcf-412-05-l.scg.stanford.edu/63989/static/scripts/libs/raven.js?v=1548446650" type="text/javascript"></script>

So in order to do that you need to use /node/ and you need to configure Galaxy to know what suburi it should serve requests from, so that galaxy thinks it is running at:

http://locahost:63989/node/hppsl230s-rcf-412-05-l.scg.stanford.edu/63989/

BTW both OSC and Tufts are or have been spending time working on this as well (now or in the past 2 months). It might be worthwhile to share notes.


#3

You are correct. /node does work, sort-of. Still a long ways to go.

I set up the config/galaxy.yml from the jobs script.sh file with this (only showing parts relevant to the proxy):

prefix="/node/${host}/${port}"
cat > config/galaxy.yml <<- EOF
        uwsgi:
          http: 0.0.0.0:${port}
          mount: ${prefix}=galaxy.webapps.galaxy.buildapp:uwsgi_app()
          manage-script-name: true
          static-map: /static/style=static/style/blue
          static-map: /static=static
          static-map: favicon.ico=/static/favicon.ico
          [ options snipped]
        galaxy:
          # filter-with: proxy-prefix
          cookie_path: ${prefix}
          [ options snipped]
        EOF

This gets me a working Galaxy main page, but the workflow and other links don’t work and produce URLs like:

https://ondemand.scg.stanford.edu/node/hppsl230s-rcf-412-05-r.scg.stanford.edu/21252/node/hppsl230s-rcf-412-05-r.scg.stanford.edu/21252/workflows/list?__identifer=wk1wsfulw2e

If I fix that URL by removing the extra node/{host}/{port}, it works and gets me a functional (as far as I can tell) Workflow page.

Noting that this is not a high priority item for me and I’m really low on the learning curve for both OnDemand and Galaxy, I’d be happy to help any other efforts working on this as best I can.