mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Hardware > Cloud Computing

Reply
 
Thread Tools
Old 2019-10-13, 15:36   #1
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

100100010001102 Posts
Default Notebook Instance Reverse SSH and HTTP Tunnels.

I am happy to announce The Reverse SSH Tunnel Service.

A follow on to my Reverse SSH Tunnel Notebook I published on Github a few days ago, this new service eliminates the need for the user to have access to a "Public-Facing" SSH server. Instead, one of my "disposable" dedicated servers is used to host the tunnels for people.

To have a full interactive Bash shell access into one or more instances, Sign Up for an account, and then create one or more named tunnels. Copy-and-paste the provided Python into a Colab or Kaggle Notebook section, and run.

Two tunnels will be created. The first for SSH access into the instance, and the second for HTTP traffic. Yes, you can access the webserver running on the instance!

The reasoning for providing two tunnels is this then allows someone to have an environment whereby they can experiment with configuring a web server in a virgin Linux server environment. A great training environment for Linux Console Jockeys!

Please note that this Notebook section runs briefly, and then returns. This means additional Sections can be added and run, just like a regular Notebook. The only difference is you also have shell access!

As always, feedback appreciated.

P.S. And for those out there who know how this kinda thing works... I'm pretty sure I've locked down everything, but if you can think of a way of abusing this, please let me know.
chalsall is offline   Reply With Quote
Old 2019-10-15, 16:35   #2
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

221068 Posts
Default nmon under Kaggle...

It sure is nice having rich interactive shell access into these instances... It makes development work much, much easier...

BTW, I've found that running mprime concurrently to mfaktc has ***no*** impact on the latter's throughput, even with Kaggle's P100s.
Attached Thumbnails
Click image for larger version

Name:	kaggle_mprime.png
Views:	107
Size:	136.3 KB
ID:	21127  
chalsall is offline   Reply With Quote
Old 2019-10-15, 20:10   #3
Dylan14
 
Dylan14's Avatar
 
"Dylan"
Mar 2017

521 Posts
Default

There is a typo in the sshd.pl script, line 129.


Code:
Log(1, "Note that when you first connect, you will have to anwer \"yes\"");

I think you mean to mean to say answer instead.
In PuTTY there is an option to just connect once to the tunnel, instead of saving the credentials. Not so much with ssh in Linux.
Dylan14 is online now   Reply With Quote
Old 2019-10-15, 20:27   #4
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

928610 Posts
Default

Quote:
Originally Posted by Dylan14 View Post
There is a typo in the sshd.pl script, line 129.
LOL... Thanks. Fixed.

And thanks for helping test this; very much appreciated!

Good to know about the Putty option; I'll include that in the further documentation I'm going to put on the site (with a smell checker enabled for that work...).

BTW, have you clicked on the link for the HTTP tunnel yet? Any additional information you think would be good there?

I plan to do some simple rrdtool work in the instance, to be able to plot CPU, GPU, RAM and FS usage during the lifespan of the instance. This will be displayed as a graph on the top of the page.
chalsall is offline   Reply With Quote
Old 2019-10-15, 20:54   #5
Dylan14
 
Dylan14's Avatar
 
"Dylan"
Mar 2017

52110 Posts
Default

I have the http tunnel open. One thing I would suggest is that the page should automatically refresh every so often (much like top does). Maybe once every 30 seconds or so.

One advantage of this tunnel is the fact that you can very easily edit files using emacs, vi, etc... Whereas on the Colab site you can’t really edit files so well.
Dylan14 is online now   Reply With Quote
Old 2019-10-15, 21:02   #6
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

2·4,643 Posts
Default

Quote:
Originally Posted by Dylan14 View Post
I have the http tunnel open. One thing I would suggest is that the page should automatically refresh every so often (much like top does). Maybe once every 30 seconds or so.
Yup... I plan to use some simple AJAX to update the data.

Quote:
Originally Posted by Dylan14 View Post
One advantage of this tunnel is the fact that you can very easily edit files using emacs, vi, etc... Whereas on the Colab site you can’t really edit files so well.
Exactly! Also, "tail -f" is your friend!!!

Don't forget you can have multiple, parallel SSH sessions into your instance(s)...
chalsall is offline   Reply With Quote
Old 2019-10-17, 00:58   #7
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

221068 Posts
Default So I got a little distracted with rrdtool today...

So for anyone who's using my reverse tunnels, be sure to click on the HTTP link into your instance.

I've added pretty graphs...

This is about three hours into a GPU72_TF instance run, with mprime launched in parallel by way of the command line. No slow down in mfaktc.

Also, I'm not sure it's been mentioned explicitly before, but so everyone knows Colab gives you one (1#) core, HT enabled. Kaggle gives you two (2#) cores, again hyperthreaded.
Attached Thumbnails
Click image for larger version

Name:	colab_iroot_graphs.png
Views:	91
Size:	195.0 KB
ID:	21135  
chalsall is offline   Reply With Quote
Old 2019-10-17, 02:36   #8
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

1101001111012 Posts
Default

Quote:
Originally Posted by chalsall View Post
So for anyone who's using my reverse tunnels, be sure to click on the HTTP link into your instance.

I've added pretty graphs...

This is about three hours into a GPU72_TF instance run, with mprime launched in parallel by way of the command line. No slow down in mfaktc.

Also, I'm not sure it's been mentioned explicitly before, but so everyone knows Colab gives you one (1#) core, HT enabled. Kaggle gives you two (2#) cores, again hyperthreaded.
I was just checking all this out while I was waiting for CADO-NFS to compile in my most recent test. Still many things I need to figure out, but all appears to be working as intended from my viewpoint.

Excellent!
EdH is offline   Reply With Quote
Old 2019-10-18, 21:41   #9
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

2×4,643 Posts
Default

Quote:
Originally Posted by chalsall View Post
I've added pretty graphs...
So, today I spent some time with IPC between the tunneled instances and the iROOT server.

The same script which collects the CPU and RAM usage for display on the web pages served by the instances' web server also sends back the same data to iROOT every five minutes.

This is currently the values from a "vmstat" run, but I plan to increase the dataset to include uptime, number of logged-in users, file system status, etc. I ***won't*** be collecting data like "ps auxw" etc. Integer values only.

I will need to add this to the Privacy Policy statement on the site. And if anyone doesn't want this kind of data sent back, please let me know. There's a mechanism to "opt-out" of the telemetry stream, I just haven't added it to the iROOT UI yet.

I'm currently in the process of exposing the collected data on each "View Tunnel" page, by way of the same type of graphs you see from within the instance.

One nice thing about doing this is the data is persistent. I have the rrdtool database configured to store a year's worth of data (four-hour spans after a month).

It was a bit annoying only having this data on the instance. I couldn't "auto-refresh" the web page (to simulate a "real-time" experience), or else immediately after the instance was shut down the page would reload with an error message.

Now we have a log of the instances coming up, working, shutting down.

Rinse and repeat...
chalsall is offline   Reply With Quote
Old 2019-10-19, 01:40   #10
Dylan14
 
Dylan14's Avatar
 
"Dylan"
Mar 2017

10118 Posts
Default

The graphs are a nice touch to the server page.

Now, so far I have only played with a CPU instance with the ssh tunneling. If say, a person has a GPU instance, can the usage of the GPU be tracked as well (without too much effort, of course)? As with that, we could potentially see how the GPU’s are doled out in the Colaboratory, and so that we can better time our execution of our code so that we can get the good T4’s.

Last fiddled with by Dylan14 on 2019-10-19 at 01:45 Reason: reasoning for gpu tracking
Dylan14 is online now   Reply With Quote
Old 2019-10-19, 14:23   #11
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

2×4,643 Posts
Default

Quote:
Originally Posted by Dylan14 View Post
If say, a person has a GPU instance, can the usage of the GPU be tracked as well (without too much effort, of course)?
Trivial to plot the data. The problem I'm having is I can't figure out how to get the data!

"!nvidia-smi" works fine from within the Notebook, but the same command at the console returns "Failed to initialize NVML: Driver/library version mismatch".

If anyone can tell me a command that works, it would be appreciated. If someone doesn't offer a simple fix, I'll look at bringing in a compatible version in the SSH payload.
chalsall is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
GPU72 Notebook Integration... chalsall GPU to 72 20 2020-03-07 02:00
Notebook enzocreti enzocreti 0 2019-02-15 08:20
New instance types soon from AWS: next-gen C5, an FPGA instance, more GPU options GP2 Cloud Computing 4 2017-08-05 22:14
electronic notebook paper jasong jasong 14 2012-01-23 03:32
How to Open Second Instance of Prime95? jinydu Lounge 10 2007-01-09 16:11

All times are UTC. The time now is 17:28.

Sat Oct 31 17:28:40 UTC 2020 up 51 days, 14:39, 3 users, load averages: 1.94, 1.82, 1.86

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.