SSH Non-Standard Port Configuration
Problem
Section titled “Problem”When managing Static Node clusters, Neutree uses SSH to connect to nodes. By default, SSH connections use port 22. If your nodes use a non-standard SSH port, you need to configure SSH settings manually.
Solution
Section titled “Solution”Since Ray (the underlying cluster management tool) does not support specifying SSH ports directly in its configuration, you need to use the SSH config file to define custom ports for each host.
Step 1: Create SSH Config File
Section titled “Step 1: Create SSH Config File”Create an SSH config file that will be mounted into the Neutree container:
mkdir -p ./ssh-configvim ./ssh-config/configStep 2: Add Host Configuration
Section titled “Step 2: Add Host Configuration”Add an entry for each node that uses a non-standard SSH port:
Host node1 HostName 192.168.1.100 Port 2222 User ubuntu
Host node2 HostName 192.168.1.101 Port 2222 User ubuntuStep 3: Use Host Alias in Neutree
Section titled “Step 3: Use Host Alias in Neutree”When adding nodes to your Static Node cluster in Neutree, use the Host alias (e.g., node1, node2) instead of the IP address directly.
Example
Section titled “Example”If you have a node at 192.168.1.100 with SSH running on port 2222:
-
Add to
./ssh-config/config:Host gpu-node-1HostName 192.168.1.100Port 2222User root -
Mount the config file into the container (see Persistence in Different Deployments below).
-
In Neutree, when configuring the Static Node cluster, enter
gpu-node-1as the node address.
Persistence in Different Deployments
Section titled “Persistence in Different Deployments”The SSH config file needs to be mounted into the neutree-core container.
Docker Compose
Section titled “Docker Compose”-
Create the SSH config file on the host:
Terminal window mkdir -p ./ssh-configcat > ./ssh-config/config << 'EOF'Host gpu-node-1HostName 192.168.1.100Port 2222User rootEOFchmod 600 ./ssh-config/config -
Update your
docker-compose.yamlto mount the config:services:neutree-core:# ... other configurationsvolumes:- ./ssh-config:/root/.ssh:ro -
Restart the service:
Terminal window docker compose up -d
Kubernetes
Section titled “Kubernetes”-
Create a ConfigMap with the SSH config:
Terminal window kubectl create configmap ssh-config --from-file=config=./ssh-config -n neutreeOr using YAML:
apiVersion: v1kind: ConfigMapmetadata:name: ssh-confignamespace: neutreedata:config: |Host gpu-node-1HostName 192.168.1.100Port 2222User root -
Update the
neutree-coreDeployment to mount the ConfigMap:spec:template:spec:containers:- name: neutree-core# ... other configurationsvolumeMounts:- name: ssh-configmountPath: /root/.sshreadOnly: truevolumes:- name: ssh-configconfigMap:name: ssh-configdefaultMode: 0600 -
Apply the changes:
Terminal window kubectl apply -f neutree-core-deployment.yaml -n neutree
- Test the connection manually before adding to Neutree:
ssh gpu-node-1 - For more context on this limitation, see Ray Discuss: Specify SSH port to cluster YAMLs