Difference between revisions of "GUI Programs"

From UFRC
Jump to navigation Jump to search
Line 1: Line 1:
 
[[Category:Software]]
 
[[Category:Software]]
 
 
{{HPG2}}
 
{{HPG2}}
 
=Upstream Xpra Documentation =
 
=Upstream Xpra Documentation =
 
 
 
*Xpra Homepage: https://xpra.org/
 
*Xpra Homepage: https://xpra.org/
 
*Xpra Basic Usage: https://xpra.org/trac/wiki/Usage
 
*Xpra Basic Usage: https://xpra.org/trac/wiki/Usage
 
*Xpra Advanced Usage: http://xpra.org/manual.html
 
*Xpra Advanced Usage: http://xpra.org/manual.html
 
=OS-Specific Directions=
 
The steps for all Linux, Mac and Windows are outlined below. We also have individual pages with directions and examples for Windows and Mac.
 
===[[Xpra Windows|Windows Specific Directions]]===
 
===[[Xpra Mac|Mac OS Specific Directions]]===
 
  
 
=Step 1: Client Installation=
 
=Step 1: Client Installation=
 +
Xpra client installation depends on the operating system running on your local machine and may require assistance of a system administrator if you do not have the authority to install new software. Once Xpra is installed on your client computer feel free to skip this step.
  
Xpra client installation depends on what operating system is running on your local machine.
+
* [[Xpra Windows Installation|Windows]]
 
+
* [[Xpra MacOS X Installation|MacOS X]]
==Linux==
+
* [[Xpra Linux Installation|Linux]]
The recommended option is to use the distribution specific packages if possible:
 
 
 
===Ubuntu/Debian===
 
sudo apt-get install xpra
 
  
===CentOS/RHEL===
+
=Step 2: Start a GUI session on HiPerGator=
* Make sure the epel-release package is installed. If it is not, find the package here:
+
==Connecting from outside of UF campus via VPN==
 +
The nodes in SLURM gui partition are accessible only within the UF campus network. If you are working off campus, you will need to use the VPN to connect to the network. Please see: [https://vpn.ufl.edu https://vpn.ufl.edu] for additional information.
  
https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F
+
The simplest way to start a GUI application session on HiPerGator is to use the pre-made launcher script available for approved commonly used applications.
  
<pre>
+
=Launch pre-approved application=
sudo su -
+
To launch a pre-approved application for which we prepared a launcher script only two steps are needed:
rpm --import https://winswitch.org/gpg.asc
+
Load the application environment module
cd /etc/yum.repos.d/
+
module load application
curl -O https://winswitch.org/downloads/CentOS/winswitch.repo
+
Launch the application
yum install xpra
+
launch_xpra_application
</pre>
+
See an example on the [[RStudio|RSTudio Help Page]].
  
==Windows==
+
=Launch any application=
===XP and Newer===
+
Use a sample job script as the base of your gui session job. Sample job scripts can be found in the '$HPC_GUI_JOB' directory once the 'gui' environment module is loaded.
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==
+
Within the job script use the xpra_start wrapper to launch the application within the shell section of the job script.
===OS X 10.5 and Newer===
+
module load application
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.
+
xpra_start application
  
=Step 2: Starting your application on HiPerGator=
+
=List Xpra Sessions=
 
+
Once you submit a job wait for it to start. Check the job status with 'squeue -u $USER'. When the job starts list the available xpra sessions using xpra_list_sessions command in the gui module. This command will refresh the Xpra session list and provide a convenient list of live Xpra sessions as well as client commands that can be copied and pasted into a terminal on the client machine.
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 commands below the '#SBATCH' section to start the emacs editor GUI under Xpra inside the job:
 
 
 
module load gui
 
xpra_start emacs
 
 
 
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.
 
 
 
See [[Matlab_job_scripts|Matlab GUI job script]] for an example or look inside the $HPC_GUI_JOB directory once the gui module is loaded.
 
 
 
There are other Xpra 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.
 
  
 
;Example
 
;Example
Line 70: Line 46:
 
Refreshing the session list for jdoe to remove stale sessions
 
Refreshing the session list for jdoe to remove stale sessions
  
Re-probing existing xpra sessions for jdoe:
+
List of active Xpra sessions for jdoe:
Found the following xpra sessions:
 
/home/jdoe/.xpra:
 
        LIVE session at :2647
 
        LIVE session at :5727
 
  
Xpra session status for jdoe have been refreshed.
+
Session: i111a-s222.rc.ufl.edu:3713
 +
    Job ID: 123456, Name: RStudio
 +
    Client command:
 +
        xpra attach ssh:jdoe@i111a-s222.rc.ufl.edu:3713
 +
        or (downloaded script):
 +
        ./xpra attach ssh:jdoe@i111a-s222.rc.ufl.edu:3713
  
Xpra sessions for jdoe:
 
    i21a-s3.rc.ufl.edu:2647
 
        Connection command: xpra attach ssh:jdoe@i21a-s3.rc.ufl.edu:2647
 
    i21a-s3.rc.ufl.edu:5727
 
        Connection command: xpra attach ssh:jdoe@i21a-s3.rc.ufl.edu:5727
 
 
</pre>
 
</pre>
  
You can use the connection commands posted in the output on your client machine as described elsewhere in this document.
+
See the respective application pages for details and sample job scripts.
 
 
See the respective application pages for details and sample job scripts e.g. [[Matlab]].
 
  
=Step 3: Connect to Xpra Session from the client side=
+
=Step 3: Connect to Xpra Session from the client computer=
 
==VPN==
 
==VPN==
If you are not located on UF Campus you will have to connect to the UF network via VPN using [https://connect.ufl.edu/it/wiki/Pages/glvpn-anyconnect-install.aspx AnyConnect VPN] or similar software. Our GUI nodes are only accessiblefrom within the UF campus network.
+
If you are not located on UF Campus you will have to connect to the UF network via VPN using [https://connect.ufl.edu/it/wiki/Pages/glvpn-anyconnect-install.aspx AnyConnect VPN] or similar software. Our GUI nodes are only accessible from within the UF campus network.
  
 
==Linux==
 
==Linux==

Revision as of 23:18, 22 August 2016

Hpg2 wiki logo.png

HiPerGator 2.0 documentation

Upstream Xpra Documentation

Step 1: Client Installation

Xpra client installation depends on the operating system running on your local machine and may require assistance of a system administrator if you do not have the authority to install new software. Once Xpra is installed on your client computer feel free to skip this step.

Step 2: Start a GUI session on HiPerGator

Connecting from outside of UF campus via VPN

The nodes in SLURM gui partition are accessible only within the UF campus network. If you are working off campus, you will need to use the VPN to connect to the network. Please see: https://vpn.ufl.edu for additional information.

The simplest way to start a GUI application session on HiPerGator is to use the pre-made launcher script available for approved commonly used applications.

Launch pre-approved application

To launch a pre-approved application for which we prepared a launcher script only two steps are needed: Load the application environment module

module load application

Launch the application

launch_xpra_application

See an example on the RSTudio Help Page.

Launch any application

Use a sample job script as the base of your gui session job. Sample job scripts can be found in the '$HPC_GUI_JOB' directory once the 'gui' environment module is loaded.

Within the job script use the xpra_start wrapper to launch the application within the shell section of the job script.

module load application
xpra_start application

List Xpra Sessions

Once you submit a job wait for it to start. Check the job status with 'squeue -u $USER'. When the job starts list the available xpra sessions using xpra_list_sessions command in the gui module. This command will refresh the Xpra session list and provide a convenient list of live Xpra sessions as well as client commands that can be copied and pasted into a terminal on the client machine.

Example
$ module add gui
$ xpra_list_sessions 

Output:

Refreshing the session list for jdoe to remove stale sessions

List of active Xpra sessions for jdoe:

Session: i111a-s222.rc.ufl.edu:3713
    Job ID: 123456, Name: RStudio
    Client command:
         xpra attach ssh:jdoe@i111a-s222.rc.ufl.edu:3713
        or (downloaded script):
         ./xpra attach ssh:jdoe@i111a-s222.rc.ufl.edu:3713

See the respective application pages for details and sample job scripts.

Step 3: Connect to Xpra Session from the client computer

VPN

If you are not located on UF Campus you will have to connect to the UF network via VPN using AnyConnect VPN or similar software. Our GUI nodes are only accessible from within the UF campus network.

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:

testuser@jr-physics:~$ xpra attach ssh:testuser@i21a-s3.rc.ufl.edu:143 --desktop-scaling=on --dpi=96
MatLab running via Xpra under slurm
Please note, if you use the xpra_list_sessions command in the GUI module on HPG2, then it will generate these connection commands for you to be able to copy and paste. In addition, 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

MAC OS

Navigate to the folder that contains the xpra executable:

cd /Applications/Xpra.app/Contents/MacOS

Alternatively, download the following 'xpra' shell script, put it into a directory in your $PATH, make it executable, and run xpra through it with the 'xpra' command instead of going into /Applications... each time:

Download the [{{#fileLink: xpra}} xpra macos script]. {{#fileAnchor: xpra}}

#!/bin/bash
cd /Applications/Xpra.app/Contents/MacOS/
./Xpra "$@"

Make sure to make it executable by running 'chmod 750 xpra' in the terminal in the directory you downloaded the script to.


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:

./Xpra attach ssh:test-user@i21a-s3.rc.ufl.edu:143 --desktop-scaling=on --dpi=96
Please note, if you use the xpra_list_sessions command in the GUI module on HPG2, then it will generate these connection commands for you to be able to copy and paste. In addition, 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

Microsoft Windows

First, navigate to the install location of xpra (normally C:\Program Files (x86)\Xpra\).

In MobaXterm
cd "/drives/c/Program\ Files\ \(x86\)/Xpra/"

Alternatively, download the following 'xpra' shell script, put it into a directory in your $PATH, make it executable, and run xpra through it with the 'xpra' command instead of changing into the Program Files directory each time manually.

Download the [{{#fileLink: xpra}} xpra mobaxterm script]. {{#fileAnchor: xpra}}

#!/bin/bash
"/drives/c/Program Files (x86)/Xpra/Xpra.exe" "$@"

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

or, if the xpra script is not in the $PATH,

sh xpra attach ssh:$USERNAME@$SERVERNAME:$PORT
Example
 ./xpra attach ssh:testuser@i21a-s3.rc.ufl.edu:143 --desktop-scaling=on --dpi=96
MatLab running via Xpra under slurm
Please note, if you use the xpra_list_sessions command in the GUI module on HPG2, then it will generate these connection commands for you to be able to copy and paste.
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.

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

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
cd "C:\Program Files (x86)\Xpra"
./xpra detach ssh:testuser@i21a-s3.rc.ufl.edu:143
Note
If you are using mobaXterm, you can press Control-C in the mobaXterm window to detach, just like using the Linux client.