Question: How can I get the ip address of a running Galaxy instance
1
gravatar for yliu41
20 months ago by
yliu4150
yliu4150 wrote:

I am developing a galaxy tool which would need the ip address of the running Galaxy as its parameter. Is that anyway I can get the ip address and feed that to my tool?

I tried to do that in the command section, but protocol is not exist and ip address is 127.0.1.1. My Galaxy is running on http://192.168.56.11:8080/

    #import socket
    #set hostname = socket.gethostname()
    #set ip = socket.gethostbyname(hostname)
    #set protocol = socket.getprotobyname(hostname)
    #set $host = str(protocol) + str(ip)

Thank you in advance!

Best, Yating

galaxy • 808 views
ADD COMMENTlink modified 20 months ago by Daniel Blankenberg ♦♦ 1.7k • written 20 months ago by yliu4150
4
gravatar for Daniel Blankenberg
20 months ago by
Daniel Blankenberg ♦♦ 1.7k
United States
Daniel Blankenberg ♦♦ 1.7k wrote:

If you are trying to do this in a tool, you may want to look at the baseurl parameter type. Example:

<param name="GALAXY_URL" type="baseurl" value="/tool_runner" />
ADD COMMENTlink written 20 months ago by Daniel Blankenberg ♦♦ 1.7k

It worked! Thank you very much!

Best, Yating

ADD REPLYlink written 20 months ago by yliu4150
0
gravatar for Martin Čech
20 months ago by
Martin Čech ♦♦ 4.9k
United States
Martin Čech ♦♦ 4.9k wrote:

There might be a way how to do this - probably finding some kind of service that reflects back your IP address but generally Galaxy has no way of knowing its own outside IP address because that depends on the network's topology. The 192.168.56.11:8080 is your local network IP address, if your Galaxy was reachable from the Internet it would have had a different one.

What is that you want to achieve?

ADD COMMENTlink written 20 months ago by Martin Čech ♦♦ 4.9k

Hi Martin,

Thank you for the reply. I think right now I only want to get the local network IP address. I have everything installed in a VM. Now I have a Galaxy instance running on http:192.168.56.11:8080 and a JBrowse instance running on http://192.168.56.11:80. My Galaxy tool wants to get the ip of Galaxy, so that it can get the ip of JBrowse by changing the port number. I don't want to hard code the ip address in the Galaxy tool, as you said the ip will change.

We can defined the hostname and port of Galaxy in galaxy.init. Is there any way I can get that information for the tool?

Thank you!

ADD REPLYlink modified 20 months ago • written 20 months ago by yliu4150

Dan's answer is what you want then. :)

ADD REPLYlink written 20 months ago by Martin Čech ♦♦ 4.9k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 169 users visited in the last hour