[OOD-users] is nc/ncat an interactive app requirement?

Michael Coleman mcolema5 at uoregon.edu
Fri Oct 26 12:24:54 EDT 2018


Looks like modern bash might be an alternative.  (You might also need the timeout command, which is also relatively modern.)

    https://stackoverflow.com/questions/4922943/test-from-shell-script-if-remote-tcp-port-is-open

Mike


From: OOD-users <ood-users-bounces at lists.osc.edu> On Behalf Of Jeremy Nicklas via OOD-users
Sent: Thursday, October 25, 2018 05:53 PM
To: E.M. Dragowsky <dragowsky at case.edu>; User support mailing list for Open OnDemand <ood-users at lists.osc.edu>
Subject: Re: [OOD-users] is nc/ncat an interactive app requirement?

Hi Em,

I think the members at OSC are pretty busy with a fairly large downtime currently, so I'll try to answer this. Good news is that it isn't due to a problem with your implementation of the interactive Jupyter app. Back when I wrote that portion of the code, I just forgot to document that netcat is a requirement for Interactive Apps to work out of the box (I made the incorrect assumption that it will exist in most standard installations). The relevant snippet of code where netcat is used can be seen here:

https://github.com/OSC/ood_core/blob/a87f59ea9d24cdcbe505c9ab859bcb120bae9951/lib/ood_core/batch_connect/template.rb#L120-L126

In particular, netcat is used in a Bash function to determine if a port on the compute node is being used. This is used to not only find available ports for an interactive application server to listen on:

https://github.com/OSC/bc_example_jupyter/blob/94d29b4ba705cfe3b17df8ce78f584a4a2f986c5/template/before.sh.erb#L32-L33

but also to wait until the interactive application server is fully launched and listening on this port before creating the "Connect to Jupyter" button for the user to connect to:

https://github.com/OSC/bc_example_jupyter/blob/94d29b4ba705cfe3b17df8ce78f584a4a2f986c5/template/after.sh#L4-L12

In fact, it is this latter snippet of code where you are seeing the timeout occur. That Bash function `port_used()` in the first link is failing to detect any port in use without netcat installed.

You have a few options to choose from for resolving this, take your pick:

- install netcat on the compute nodes (easiest)
- override the Bash function `port_used()` in your `template/before.sh.erb` script before the `find_port` function is called with your own implementation that doesn't use netcat (medium difficulty, note that it isn't documented but there is a way to make this a global override for all interactive apps)
- remove the timeout conditional in the `template/after.sh` script and just sleep an appropriate amount of time until you are sure the interactive server is running (easy, but possibly bad user experience)

-Jeremy Nicklas


On Thu, Oct 25, 2018 at 10:08 AM E.M. Dragowsky via OOD-users <ood-users at lists.osc.edu<mailto:ood-users at lists.osc.edu>> wrote:
Greetings --
In implementation of the Jupyter app, I have indications that nc is necessary for connections to compute nodes. The install documentation indicates that it may be used to test that reverse proxy connections are successfully configured (3.3 Verify it works)
The compute nodes in our cluster (rhel7) do not have the 'nmap-ncat' package installed. When the package is installed, connections succeed. Without the package -- the connection times-out.

I've done this on a subset of our nodes, and am preparing a 'change request' to have the 'nmap-ncat' package installed on all the nodes. Please let me know if I am only seeing part of the picture, or if what I describe indicates other problems with my implementation of the interactive jupyter app.
Thanks,
~ Em

--
E.M. Dragowsky, Ph.D.
Research Computing -- UTech
Case Western Reserve University
(216) 368-0082<tel:(216)%20368-0082>
_______________________________________________
OOD-users mailing list
OOD-users at lists.osc.edu<mailto:OOD-users at lists.osc.edu>
https://lists.osu.edu/mailman/listinfo/ood-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osu.edu/pipermail/ood-users/attachments/20181026/d39f041b/attachment-0001.html>


More information about the OOD-users mailing list