Difference between revisions of "GUI Programs"

From UFRC
Jump to navigation Jump to search
 
(164 intermediate revisions by 8 users not shown)
Line 1: Line 1:
[[Category:Software]]
+
[[Category:Software]][[Category:GUI]]
 +
'''The module gui/2 is no longer available. Use this page to know how to use GUI applications on Hipergator.
 +
'''
 +
__NOTOC__
  
{{HPG2}}
+
Here you will find the information necessary to configure and run graphical user interface (GUI) applications on HiPerGator. The process is not complicated, but running a GUI on a remote server and displaying the windows on your local client computer with a sufficiently responsive interface is not as easy as simply running the application locally. We'd like to acknowledge an Open Source [https://xpra.org Xpra Project] for creating software we built our GUI sessions on top of.
=Xpra Links =
 
  
 +
==X11 Forwarding==
 +
For the simplest case of running a lightweight GUI application for a very short time you can log into HiPerGator with
 +
ssh -Y MYUSER@hpg.rc.ufl.edu
 +
load the environment module your application is in and run it. Do not analyze data this way, but running a text editor, a web browser to log in and get an api token from a remote service or some other very short and lightweight operations are fine.
  
*Xpra Homepage: https://xpra.org/
+
==Open OnDemand==
*Xpra Basic Usage: https://xpra.org/trac/wiki/Usage
+
Normally the X11 DISPLAY variable is set once the X11 server is started.  This can be done manually, as described above, but an easier method is to use [https://help.rc.ufl.edu/doc/Open_OnDemand#Display_Environment_on_the_Console Open OnDemand] since that will start an X11 server and allocate the frame buffer automatically.
*Xpra Advanced Usage: http://xpra.org/manual.html
 
  
=Step 1: Client Installation=
+
[https://openondemand.org/ Open OnDemand] provides a web-only interface to starting and attaching to GUI programs with seamless connections through web browsers. This service is available at the following URL:
  
Xpra client installation depends on what operating system is running on your local machine.
+
https://ondemand.rc.ufl.edu
  
==Linux==
+
{{Note|Many applications have their own interfaces, but other can also be launched by launching a HiPerGator Desktop and then opening the application with the desktop interface.|info}}
The recommended option is to use the distribution specific packages if possible:
 
  
===Ubuntu/Debian===
+
===[https://mediasite.video.ufl.edu/Mediasite/Play/4654bfa838624de894085bf54678848f1d Using Open on Demand on HiPerGator]===
sudo apt-get install xpra
+
[[File:Play_icon.png|frameless|30px|link=https://mediasite.video.ufl.edu/Mediasite/Play/4654bfa838624de894085bf54678848f1d]] [5 min, 11 sec]
 
+
This video covers the use of Open on Demand https://openondemand.org/ on HiPerGator via https://ood.rc.ufl.edu/.
===CentOS/RHEL===
+
* Connect to https://ood.rc.ufl.edu/
 
+
* Launch a terminal
<pre>
+
* Launch many graphical applications like Rstudio, Matlab and Freeview
sudo su -
+
* Manage job submission
rpm --import https://winswitch.org/gpg.asc
+
* Upload, download and edit files via your browser
cd /etc/yum.repos.d/
 
curl -O https://winswitch.org/downloads/CentOS/winswitch.repo
 
yum install xpra
 
</pre>
 
 
 
==Windows==
 
===XP and Newer===
 
Download and install MS Windows files: from [https://xpra.org/ https://xpra.org/], Installer file can be found at [https://xpra.org/dists/windows/Xpra_Setup.exe https://xpra.org/dists/windows/Xpra_Setup.exe]. Note that installation will require an account with Admin privileges.
 
 
 
==MAC OS==
 
===OS X 10.5 and Newer===
 
Download and install MAC installer files: from [https://xpra.org/ https://xpra.org/], Installer file can be found at [https://xpra.org/dists/osx/x86/Xpra.dmg https://xpra.org/dists/osx/x86/Xpra.dmg]. Note that installation will require an account with Admin privileges.
 
 
 
=Step 2: Starting your application on HiPerGator=
 
 
 
The simplest way to start a GUI application session on HiPerGator is to use the wrapper scripts in a job script. For example, a SLURM job script can have the following to start the emacs editor GUI:
 
 
 
module load gui
 
xpra_start emacs
 
 
 
 
 
There are other wrapper scripts. For example,
 
 
 
xpra_list_sessions will refresh the Xpra session list and provide a convenient list of live Xpra sessions as well as commands that can be copied and pasted into a terminal on the client machine.
 
 
 
Some applications, like matlab and rstudio need more care to be started under Xpra. For them, we have additional wrappers like xpra_start_matlab or xpra_start_rstudio.
 
 
 
=Step 3: Connect to Xpra Session from the client side=
 
==Linux:==
 
Xpra is typically automatically added to your path during installation, so you can connect to your running xpra instance using the following syntax where $USERNAME is your UF GatorLink user-name, $SERVERNAME is the server where your application is running inside xpra, and $PORT is the X11 port you assigned when you started your application.
 
 
 
xpra attach ssh:$USERNAME@$SERVERNAME:$PORT
 
 
 
As an example:
 
<pre>
 
testuser@jr-physics:~$ xpra attach ssh:testuser@i21a-s3.rc.ufl.edu:143 --desktop-scaling=on --dpi=96
 
</pre>
 
 
 
[[File:Hpg2-gui-matlab2.png|thumbnail|center|MatLab running via Xpra under slurm]]
 
 
 
==MAC OS:==
 
Navigate to the folder that contains the xpra executable:
 
<pre>
 
cd /Applications/Xpra.app/Contents/MacOS
 
</pre>
 
 
 
Second, connect to your running xpra instance using the following syntax where $USERNAME is your GatorLink user-name, $SERVERNAME is the server where your application is running inside xpra, and $PORT is the X11 port you assigned when you started your application.
 
<pre>
 
./Xpra attach ssh:$USERNAME@$SERVERNAME:$PORT
 
</pre>
 
 
 
Example:
 
<pre>
 
./Xpra attach ssh:test-user@i21a-s3.rc.ufl.edu:143 --desktop-scaling=on --dpi=96
 
</pre>
 
 
 
==Microsoft Windows==
 
First, navigate to the install location of xpra (normally C:\Program Files (x86)\Xpra\). 
 
;In MobaXterm:
 
cd /drives/c/Progam\ Files\ \(x86\)/Xpra/
 
 
 
Second, connect to your running xpra instance using the following syntax where $USERNAME is your GatorLink user-name, $SERVERNAME is the server where your application is running inside xpra, and $PORT is the X11 port you assigned when you started your application.
 
 
 
./xpra attach ssh:$USERNAME@$SERVERNAME:$PORT
 
 
 
;Example:
 
 
 
<pre>
 
./xpra attach ssh:testuser@i21a-s3.rc.ufl.edu:143 --desktop-scaling=on --dpi=96
 
</pre>
 
 
 
[[File:Hpg2-gui-matlab-win.png|thumbnail|center|MatLab running via Xpra under slurm]]
 
 
 
;NOTE: If you close the window using the close button, this will exit your application just like a native application.  If you want to simply detach the session and come back later, please follow the ''detaching xpra session'' instructions below
 
 
 
=Step 4: Detaching Xpra Session=
 
These instructions allow you to detach a running xpra client without closing the application.
 
 
 
==Linux and MAC OS==
 
In the original terminal where you activated the client, simply press Control-C to detach the session.
 
 
 
<pre>
 
2016-04-06 15:18:17,173 Attached to ssh:testuser@i21a-s3.rc.ufl.edu:143 (press Control-C to detach)
 
^C
 
got signal SIGINT, exiting
 
2016-04-06 15:18:42,513 Connection lost
 
</pre>
 
 
 
You can re-attach to the running application using the ''xpra attach'' command as described in the instructions above.
 
 
 
==Windows==
 
* Start a new console and navigate to the xpra directory as shown above.
 
* Run the following command where $USERNAME is your UF GatorLink user-name, $SERVERNAME is the server where your application is running inside xpra, and $PORT is the X11 port you assigned when you started your application.
 
 
 
./xpra detach ssh:$USERNAME@$SERVERNAME:$PORT
 
 
 
;Example:
 
<pre>
 
cd "C:\Program Files (x86)\Xpra"
 
./xpra detach ssh:testuser@i21a-s3.rc.ufl.edu:143
 
</pre>
 
 
 
;Note: If you are using mobaXterm, you can press Control-C in the mobaXterm window to detach, just like using the Linux client.
 
 
 
=Startup Scripts=
 
Some applications that require key command line parameters for launching, are more convienent to wrap with a startup script.  Here is an annotated version and some application examples.  The executable file can be downloaded here: [[File:matlab-launch.sh.txt| matlab-launch.sh]]
 
 
 
==Matlab Example==
 
The first line of the launch script should set which shell type to use.  On HiPerGator systems, the default shell is bash.
 
<pre>
 
#!/bin/bash
 
</pre>
 
 
 
Next, load the modules required for the application:
 
<pre>
 
module load matlab;
 
</pre>
 
 
 
Finally, enter the launch command for the GUI application:
 
<pre>
 
matlab -nosplash -desktop
 
</pre>
 
 
 
Once the script is saved, you will need to make it executable to run as an application wrapper.  This can be done with the "chmod" command:
 
<pre>
 
[testuser@gator3 ~]$ chmod u+x matlab-launch.sh
 
</pre>
 
 
 
Below are some other application launch script examples:
 
==Other Examples==
 
===MZmine===
 
<pre>
 
#!/bin/bash
 
module load mzmine;
 
startMZmine_Linux.sh;
 
</pre>
 
 
 
MZmine with 8GB of memory:
 
<pre>
 
#!/bin/bash
 
 
 
module load mzmine
 
 
 
export _JAVA_OPTIONS="-Xmx8g"
 
 
 
startMZmine_Linux.sh
 
</pre>
 
 
 
===Rstudio===
 
<pre>
 
#!/bin/bash
 
 
 
module load gui rstudio;
 
rstudio;
 
</pre>
 
 
 
 
 
===Other tested applications===
 
;trackvis
 
Notes: Application window appears correctly, waiting on license key in inital window
 
 
 
;xterm
 
Notes: Works as expected
 
 
 
 
 
;End current Xpra documentation slated for wiki
 

Latest revision as of 14:42, 30 January 2023

The module gui/2 is no longer available. Use this page to know how to use GUI applications on Hipergator.


Here you will find the information necessary to configure and run graphical user interface (GUI) applications on HiPerGator. The process is not complicated, but running a GUI on a remote server and displaying the windows on your local client computer with a sufficiently responsive interface is not as easy as simply running the application locally. We'd like to acknowledge an Open Source Xpra Project for creating software we built our GUI sessions on top of.

X11 Forwarding

For the simplest case of running a lightweight GUI application for a very short time you can log into HiPerGator with

ssh -Y MYUSER@hpg.rc.ufl.edu

load the environment module your application is in and run it. Do not analyze data this way, but running a text editor, a web browser to log in and get an api token from a remote service or some other very short and lightweight operations are fine.

Open OnDemand

Normally the X11 DISPLAY variable is set once the X11 server is started. This can be done manually, as described above, but an easier method is to use Open OnDemand since that will start an X11 server and allocate the frame buffer automatically.

Open OnDemand provides a web-only interface to starting and attaching to GUI programs with seamless connections through web browsers. This service is available at the following URL:

https://ondemand.rc.ufl.edu

Many applications have their own interfaces, but other can also be launched by launching a HiPerGator Desktop and then opening the application with the desktop interface.

Using Open on Demand on HiPerGator

Play icon.png [5 min, 11 sec] This video covers the use of Open on Demand https://openondemand.org/ on HiPerGator via https://ood.rc.ufl.edu/.

  • Connect to https://ood.rc.ufl.edu/
  • Launch a terminal
  • Launch many graphical applications like Rstudio, Matlab and Freeview
  • Manage job submission
  • Upload, download and edit files via your browser