Table of Contents

Accessing Services via the HPC Gateway (POC)

Purpose

The goal of this system (the HPC Gateway with Rathole) is to make local services hosted on private compute nodes (which are not directly connected to the Internet) accessible via a secure public address.

The main objectives are:

  1. Secure Remote Access: Allow external users to access web applications, APIs, or development tools (such as LM Studio) installed on HPC clusters, without exposing the compute nodes directly to the Internet.
  2. Simplified Access: Provide a single URL (gatewaypoc.hpc.unige.ch) and a specific port for each service, instead of managing complex IP addresses or advanced network configurations.
  3. Encryption (SSL/TLS): Ensure that communication between the end user and the gateway is encrypted (HTTPS), even if the internal service does not use SSL.
  4. Isolation and Security: Compute nodes remain in a secure internal network. The gateway acts as a controlled bridge, where authentication and routing are managed by the HPC team.

In summary: It is a secure bridge that allows remote access to powerful but isolated computing services.

1. Final Access URL

All services exposed through this Proof of Concept are accessible via the single address:

https://gatewaypoc.hpc.unige.ch

The final access port is specified in the Rathole configuration file (e.g., `rathole.client.toml`) provided by the HPC team. It is indicated as a comment at the beginning of the file.

2. Prerequisites and Authorization Procedure

Before any technical configuration, you must follow these steps:

1. Contact the HPC Team: Send an email to [support email] with the following information:

2. Validation: The HPC team will validate your request. 3. SSL Configuration:

3. Tunnel Configuration (User Side)

Once authorized, you must install and configure Rathole on your compute node.

Step 1: Install Rathole

Rathole is available via the cluster's environment modules. Load it with the following command:

ml rathole

Verify that the command is available:

which rathole

Step 2: Create the Configuration File

The HPC team will provide you with a client configuration file (rathole.client.toml). This file contains two crucial pieces of information:

  1. The final access port (in a comment).
  2. The local port on which your service must listen.

Here is an example of the file you will receive:

## https://gatewaypoc.hpc.unige.ch:1200

[client]
# HPC Gateway address (Rathole connection port)
remote_addr = "gatewaypoc.hpc.unige.ch:2333"

[client.services.sagon_lm_studio]
# Unique authentication token provided by the HPC team
token = "61d4d8fdc96e641140ddf66******************6e9d733b0ce95bd21"
# Protocol type (tcp for most web/API services)
type = "tcp"
# Local address where your service listens on the compute node
# IMPORTANT: Your service MUST listen on this port (here 11200).
local_addr = "127.0.0.1:11200"

Field Explanations:

Step 3: Start the Tunnel

Run Rathole with the provided configuration file:

rathole rathole.client.toml

Check the logs to ensure the connection is established successfully (look for messages indicating “connected” or “listening”).

Step 4: Verification and Access

Your service is now accessible via the URL indicated in the comment of the configuration file.

*Example: If the file contains `## https://gatewaypoc.hpc.unige.ch:1200`, the URL will be:* https://gatewaypoc.hpc.unige.ch:1200

4. Security and Authentication

5. Support and Limitations (POC)

6. Example to launch LM-Studio

  1. Open a session on OpenOnDemand and start an advanced desktop session with a GPU.
  2. Launch lm-studio using the example script below
  3. Setup LM-Studio to start the server using the correct port and auth (see screenshot)

Script to launch the tunnel and lm-studio:

# start rathole tunnel and lm-studio

ml purge

ml LMStudio/0.4.26 rathole/0.5.0 

rathole --client client.toml &

lm-studio --no-sandbox