### Connect to Instance via SSH Source: https://docs.hivenet.com/quickstart Establishes an SSH connection to a remote compute instance using a private key and the instance's IP address. Ensure the private key path and username are correct for your setup. ```bash ssh -i /path/to/private_key username@INSTANCE_IP ``` -------------------------------- ### Dockerfile for Hivenet Base Image Setup Source: https://docs.hivenet.com/documentation/essentials/custom-templates This Dockerfile demonstrates how to use the Hivenet base Ubuntu image and execute a setup script. It assumes the base image is accessible and the setup script is located at `/usr/local/bin/setup_instance.sh`. ```dockerfile FROM 993cz8u0.c1.gra9.container-registry.ovh.net/hive-compute-public/base-ubuntu:latest CMD ["/usr/local/bin/setup_instance.sh"] ``` -------------------------------- ### Connect to SFTP server and interact Source: https://docs.hivenet.com/tutorials/more-guides/sftp-not-ftps This command initiates an SFTP connection to a specified host using provided user credentials. Once connected, you can use interactive commands like 'put' or 'get' to transfer files. ```shell sftp user@host ``` -------------------------------- ### GET /v1/metadata Source: https://docs.hivenet.com/tutorials/how-to/evo2-40b Retrieves metadata about the model and its configuration. ```APIDOC ## GET /v1/metadata ### Description Retrieves metadata associated with the EVO2-40B model. ### Method GET ### Endpoint `https://-8000.tenants.hivenet.com/v1/metadata` ### Parameters None ### Request Example ```bash curl -X GET "https://-8000.tenants.hivenet.com/v1/metadata" ``` ### Response #### Success Response (200) - **metadata** (object) - Contains various details about the model. #### Response Example ```json { "model_name": "evo2-40b", "version": "1.0.0", "description": "A large language model for biological sequence generation." } ``` ``` -------------------------------- ### GET /v1/health/ready Source: https://docs.hivenet.com/tutorials/how-to/evo2-40b Checks if the model inference server is ready to receive requests. ```APIDOC ## GET /v1/health/ready ### Description Checks the readiness of the model inference server. ### Method GET ### Endpoint `https://-8000.tenants.hivenet.com/v1/health/ready` ### Parameters None ### Request Example ```bash curl -X GET "https://-8000.tenants.hivenet.com/v1/health/ready" ``` ### Response #### Success Response (200) - **status** (string) - Indicates if the server is ready. #### Response Example ```json { "status": "ready" } ``` ``` -------------------------------- ### SFTP CLI Commands for File Transfer Source: https://docs.hivenet.com/documentation/file-transfer/transfer-files-sftp This section lists essential SFTP commands for transferring files and managing directories via the command line. It includes uploading ('put'), downloading ('get'), changing local directories ('lcd'), printing local directories ('lpwd'), listing remote files ('ls'), showing remote paths ('pwd'), and exiting ('exit'). ```shell put bigfile.zip get results.csv lcd lpwd ls pwd exit ``` -------------------------------- ### Generate SSH Key Pair Source: https://docs.hivenet.com/quickstart Generates a new SSH key pair using the ed25519 algorithm, commonly used for secure connections. This is a prerequisite for setting up SSH access to your compute instances. ```bash ssh-keygen -t ed25519 -C "you@example.com" ``` -------------------------------- ### Check OpenSSH Installation (PowerShell) Source: https://docs.hivenet.com/documentation/connectivity/ssh-puttygen-openssh Verifies if the OpenSSH client is installed on your Windows machine. This is a prerequisite for using OpenSSH commands. ```powershell ssh -V ``` -------------------------------- ### Get Instance Port and IP Details Source: https://docs.hivenet.com/documentation/connectivity/forwards-ports Commands to run inside the Compute instance to identify the application's port and the instance's IP address. 'whoami' and 'hostname -I' retrieve user and IP information, while 'curl' tests connectivity to the local application. ```bash whoami hostname -I ``` ```bash curl http://localhost:7865 ``` -------------------------------- ### Retrieve Model Metadata with cURL Source: https://docs.hivenet.com/tutorials/how-to/evo2-40b This snippet shows how to retrieve metadata about the EVO2-40B model using cURL. It queries the '/v1/metadata' endpoint to get information about the model's configuration and capabilities. ```shell curl -X GET "https://-8000.tenants.hivenet.com/v1/metadata" ``` -------------------------------- ### Start Python HTTP Server (8888) Source: https://docs.hivenet.com/documentation/connectivity/https-site-ssh-port-forwarding Launches a simple HTTP server using Python's built-in module to serve files from the current directory. It binds to all network interfaces (0.0.0.0) on port 8888, making it accessible externally. Ensure no other process is using port 8888. ```bash python3 -m http.server 8888 --bind 0.0.0.0 ``` -------------------------------- ### Run Flask App with Host and Port Source: https://docs.hivenet.com/documentation/connectivity/https-site-ssh-port-forwarding Example of how to run a Flask web application, binding it to all network interfaces (0.0.0.0) on port 8888. This makes the application accessible from outside the instance. Ensure the specified port is not already in use. ```python app.run(host="0.0.0.0", port=8888) ``` -------------------------------- ### SSH Port Forwarding Example Source: https://docs.hivenet.com/documentation/connectivity/https-site-ssh-port-forwarding Establishes an SSH connection with local port forwarding enabled. This command forwards connections made to port 8888 on the local machine (your client) to port 8888 on the remote Compute instance (localhost:8888). This is useful for accessing services running on the instance as if they were local. ```bash ssh -L 8888:localhost:8888 ubuntu@.ssh.hivecompute.ai ``` -------------------------------- ### Connect to Instance via SSH Source: https://docs.hivenet.com/documentation/essentials/understand-choose-instance This command allows you to connect to your Compute instance using SSH. Replace '[your-username]' and '[your-instance-ip]' with your specific credentials and instance IP address. This is a standard command-line utility available on most systems. ```shell ssh [your-username]@[your-instance-ip] ``` -------------------------------- ### Prepare SSH Key Permissions on macOS Source: https://docs.hivenet.com/documentation/connectivity/connect-instance-macos This command sequence ensures your SSH private key file and directory have the correct permissions for secure access. It creates the .ssh directory if it doesn't exist, sets strict permissions for the directory (only owner can read, write, execute), moves your key file into it, and then sets strict permissions for the key file itself (only owner can read/write). ```shell mkdir -p ~/.ssh chmod 700 ~/.ssh mv ~/Downloads/your-key.pem ~/.ssh/ chmod 600 ~/.ssh/your-key.pem ``` -------------------------------- ### Connect to Compute Instance using SFTP CLI Source: https://docs.hivenet.com/documentation/file-transfer/transfer-files-sftp This snippet shows how to initiate an SFTP connection to your Compute instance using the command-line interface. It requires specifying the SSH private key, the proxy command for secure tunneling through a bastion host, the username, and the instance's SSH hostname. ```shell sftp -i ~/.ssh/id_ed25519 \ -o "ProxyCommand=ssh bastion@ssh.hivecompute.ai %h" \ ubuntu@.ssh.hivecompute.ai ``` -------------------------------- ### Upload a file using SFTP command line Source: https://docs.hivenet.com/tutorials/more-guides/sftp-not-ftps This command demonstrates how to upload a local file ('file.zip') to an SFTP server. It uses the `sftp` command with a here-string to pass the 'put' command and the filename. ```shell sftp user@host:~/upload <<< $'put file.zip' ``` -------------------------------- ### SSH into Instance for GPU Monitoring Source: https://docs.hivenet.com/tutorials/how-to/evo2-40b This snippet provides the command to establish an SSH connection to the Hivenet instance, potentially through a bastion host, for monitoring GPU usage. It then shows the command to run after connecting to display GPU information. ```shell ssh -i ~/.ssh/id_rsa -o "ProxyCommand=ssh bastion@ssh.hivenet.com %h" nvs@.ssh.hivenet.com ``` ```shell nvidia-smi ``` -------------------------------- ### Basic SSH Connection Command Source: https://docs.hivenet.com/documentation/connectivity/connect-instance-windows This is the basic SSH command to connect to your Compute instance. Ensure you replace `` with the actual ID obtained from the Hivenet dashboard. This command assumes you are using the default 'ubuntu' user. ```shell ssh ubuntu@.ssh.hivecompute.ai ``` -------------------------------- ### Open SSH Directory on macOS using Bash Source: https://docs.hivenet.com/documentation/connectivity/ssh-key-macos Opens the hidden .ssh directory in the Finder application. This directory typically contains the private and public SSH key files, allowing users to easily locate and manage them. It assumes OpenSSH is installed and the default SSH configuration directory is used. ```bash open ~/.ssh ``` -------------------------------- ### WinSCP ProxyCommand Configuration Source: https://docs.hivenet.com/documentation/file-transfer/transfer-files-sftp This configuration snippet is for WinSCP on Windows, enabling SFTP connections through a proxy server. It specifies the SSH command to establish the tunnel, which is necessary when connecting to instances that require routing through a bastion host. ```shell ssh bastion@ssh.hivecompute.ai %h ``` -------------------------------- ### SSH Connection with ProxyCommand Source: https://docs.hivenet.com/documentation/connectivity/connect-instance-windows This command is used when a jump host (bastion) is required for establishing the connection. It securely tunnels the connection through Hivenet's bastion server. You might need to adjust the path to your private key (`~/.ssh/id_ed25519`) if it differs. ```shell ssh -i ~/.ssh/id_ed25519 -o "ProxyCommand ssh bastion@ssh.hivecompute.ai %h" ubuntu@.ssh.hivecompute.ai ``` -------------------------------- ### Connect to Instance Manually (Bash) Source: https://docs.hivenet.com/documentation/connectivity/ssh-puttygen-openssh Establishes a direct SSH connection to the Compute instance using the private key file and instance details. Requires manual input of instance ID. ```bash ssh -i ~/.ssh/id_ed25519 ubuntu@.ssh.hivecompute.ai ``` -------------------------------- ### Transfer Large Datasets with Rsync Source: https://docs.hivenet.com/documentation/file-transfer/transfer-files-sftp Use rsync for efficient and resumable transfers of large datasets. This command includes SSH key authentication and a bastion host proxy command for secure connections. ```bash rsync -avz -e "ssh -i ~/.ssh/id_ed25519 \ -o ProxyCommand='ssh bastion@ssh.hivecompute.ai %h'" \ ./localfolder/ \ ubuntu@.ssh.hivecompute.ai:/data ``` -------------------------------- ### Check Hivenet Agent Logs (Linux) Source: https://docs.hivenet.com/documentation/connectivity/firewall-basics View the logs for the Hivenet Agent service on a Compute instance to diagnose connection or configuration issues. This command requires direct access to the instance's terminal. ```bash journalctl -u hivenet-agent --no-pager ``` -------------------------------- ### Create Custom NIM Template with Specific Container Image Source: https://docs.hivenet.com/tutorials/how-to/evo2-40b This snippet outlines the process of creating a custom NIM template in the Hivenet Compute console. It requires specifying a custom container image URL and setting an environment variable for an API key. The provided container image is adapted for Hivenet's environment. ```text rbbbucym.gra7.container-registry.ovh.net/library/evo2-40b:2.0.0 ``` ```environment-variable NGC_API_KEY= ``` -------------------------------- ### Construct SSH Hostname Source: https://docs.hivenet.com/documentation/connectivity/connect-instance-windows This code snippet demonstrates how to construct the SSH HostName by appending the instance ID to the Hivenet domain. This is a crucial step for establishing a direct connection to your Compute instance. ```shell ba184ade-84ed-4047-90bb-ca3b76e84246.ssh.hivecompute.ai ``` -------------------------------- ### Connect to Compute Instance via SSH on macOS Source: https://docs.hivenet.com/documentation/connectivity/connect-instance-macos This command establishes an SSH connection to your Compute instance. You need to specify the path to your private SSH key using the -i flag and provide the correct username (default is 'ubuntu') followed by the instance's SSH endpoint, which includes your instance ID. Replace placeholders with your actual key path and instance ID. ```shell ssh -i /path/to/your-key.pem ubuntu@your-instance-id.ssh.hivecompute.ai ``` -------------------------------- ### Run DNA Sequence Inference with cURL Source: https://docs.hivenet.com/tutorials/how-to/evo2-40b This snippet illustrates how to perform inference for DNA sequence generation using the EVO2-40B model. It sends a POST request to the '/biology/arc/evo2/generate' endpoint with a JSON payload specifying the input sequence and generation parameters. ```shell curl -X POST "https://-8000.tenants.hivenet.com/biology/arc/evo2/generate" \ -H "Content-Type: application/json" \ --data '{ "sequence": "ACTGACTGACTGACTG", "num_tokens": 8, "top_k": 1, "enable_sampled_probs": true }' ``` -------------------------------- ### POST /biology/arc/evo2/generate Source: https://docs.hivenet.com/tutorials/how-to/evo2-40b Generates a biological sequence based on the provided input parameters. ```APIDOC ## POST /biology/arc/evo2/generate ### Description Generates a biological sequence using the EVO2-40B model. ### Method POST ### Endpoint `https://-8000.tenants.hivenet.com/biology/arc/evo2/generate` ### Parameters #### Query Parameters None #### Request Body - **sequence** (string) - Required - The input DNA sequence. - **num_tokens** (integer) - Required - The number of tokens (nucleotides) to generate. - **top_k** (integer) - Optional - The number of top-k choices to consider for generation. - **enable_sampled_probs** (boolean) - Optional - Whether to enable sampled probabilities. ### Request Example ```json { "sequence": "ACTGACTGACTGACTG", "num_tokens": 8, "top_k": 1, "enable_sampled_probs": true } ``` ### Response #### Success Response (200) - **sequence** (string) - The generated biological sequence. - **elapsed_ms** (integer) - The time taken for generation in milliseconds. #### Response Example ```json { "sequence": "ACTGACTG", "elapsed_ms": 1319 } ``` ``` -------------------------------- ### Check Model Health with cURL Source: https://docs.hivenet.com/tutorials/how-to/evo2-40b This snippet demonstrates how to check the health of the deployed EVO2-40B model using the cURL command. It targets the '/v1/health/ready' endpoint and expects a JSON response indicating the model's readiness. ```shell curl -X GET "https://-8000.tenants.hivenet.com/v1/health/ready" ``` -------------------------------- ### Configure SSH Connection (config file) Source: https://docs.hivenet.com/documentation/connectivity/ssh-puttygen-openssh Sets up a convenient alias 'hivenet' for your Compute instance in the SSH configuration file. This allows for simpler connection commands. ```bash Host hivenet HostName .ssh.hivecompute.ai User ubuntu IdentityFile ~/.ssh/id_ed25519 ProxyCommand ssh bastion@ssh.hivecompute.ai %h ``` -------------------------------- ### Configure SSH Client (Perl) Source: https://docs.hivenet.com/documentation/connectivity/ssh-key-linux Sets up an SSH configuration file (`~/.ssh/config`) to define aliases, hostnames, and identity files for simplifying SSH connections to Hivenet instances. It supports optional bastion host configurations. ```perl Host hivenet HostName .ssh.hivecompute.ai User ubuntu IdentityFile ~/.ssh/id_ed25519 # Remove this line if no bastion host is listed ProxyCommand ssh bastion@ssh.hivecompute.ai %h ``` -------------------------------- ### Navigate to SSH Key Directory on Windows Source: https://docs.hivenet.com/documentation/connectivity/ssh-key-windows Provides commands to navigate to the directory where SSH key files are stored. It shows how to change the directory using PowerShell and open the folder directly in File Explorer for easy access to the key files. ```powershell cd $env:USERPROFILE\.ssh explorer . ``` -------------------------------- ### Open SSH Directory (Bash) Source: https://docs.hivenet.com/documentation/connectivity/ssh-key-linux Opens the default SSH configuration directory (`~/.ssh`) using the system's file manager. This helps in locating the generated private and public key files. ```bash xdg-open ~/.ssh ```