### Install io.net Setup Script Source: https://docs.io.net/docs/install-on-ubuntu Downloads and saves the io.net setup script. This script is essential for the one-time setup for hardware prerequisites. ```bash curl -L https://github.com/ionet-official/io-net-official-setup-script/raw/main/ionet-setup.sh -o ionet-setup.sh ``` -------------------------------- ### Container Start Command Example (JSON) Source: https://docs.io.net/docs/deploy-containers Provides an example of how to format the start command for a container deployment in a JSON array format. This is used to specify the executable and its arguments when launching the container. ```json ["python3", "-m", "vllm.entrypoints.openai.api_server", "--model"] ``` -------------------------------- ### Run IO Binary Source: https://docs.io.net/docs/install-on-ubuntu Executes the IO Net launch binary. This is the primary command to start the worker setup process. The binary handles computational tasks and system operations. ```bash ./io_net_launch_binary_linux ``` -------------------------------- ### Install Nvidia-container-toolkit Source: https://docs.io.net/docs/waiting-for-io-containers-to-start Installs the Nvidia-container-toolkit by adding the NVIDIA repository, enabling experimental features, and then performing the installation via apt-get. It also configures the Docker runtime and restarts Docker. ```bash curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && \ curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list ``` ```bash sudo sed -i -e '/experimental/ s/^#//g' /etc/apt/sources.list.d/nvidia-container-toolkit.list ``` ```bash sudo apt-get update sudo apt-get install -y nvidia-container-toolkit sudo nvidia-ctk runtime configure --runtime=docker sudo systemctl restart docker ``` -------------------------------- ### Check Nvidia-container-toolkit Installation Source: https://docs.io.net/docs/waiting-for-io-containers-to-start Checks if the Nvidia-container-toolkit is installed and reports its version. It also verifies the package presence using dpkg. ```bash nvidia-container-runtime --version dpkg -l | grep nvidia-container-toolkit ``` -------------------------------- ### Download io.net Setup Script Source: https://docs.io.net/docs/install-on-hiveos Downloads the io.net setup script from a GitHub repository using wget. This script contains the necessary commands to install the io.net worker. ```bash wget https://raw.githubusercontent.com/ionet-official/io-net-official-setup-script/main/ionet-setup.sh ``` -------------------------------- ### Install cURL if missing Source: https://docs.io.net/docs/install-on-ubuntu Command to install cURL if the previous download command fails. After installation, the setup process should be rerun. ```bash sudo apt install curl ``` -------------------------------- ### Execute io.net Setup Script Source: https://docs.io.net/docs/install-on-hiveos Runs the io.net setup script to install the worker. This script handles the core installation process. ```bash ./ionet-setup.sh ``` -------------------------------- ### Download IO Binary for Windows Source: https://docs.io.net/docs/install-on-windows This snippet provides the direct download URL for the IO Binary executable file specifically for Windows. It's recommended to download the latest version for improvements. ```text https://github.com/ionet-official/io_launch_binaries/raw/main/io_net_launch_binary_windows.exe ``` -------------------------------- ### Grant Permissions and Run Setup Script Source: https://docs.io.net/docs/install-on-ubuntu Grants execute permissions to the downloaded io.net setup script and then runs it. This step is crucial for configuring the system, especially for GPU-equipped systems. ```bash chmod +x ionet-setup.sh && ./ionet-setup.sh ``` -------------------------------- ### Verify CUDA Toolkit Installation Source: https://docs.io.net/docs/cuda-toolkit-optional This command verifies if the CUDA Toolkit has been successfully installed on your system. It checks the compiler driver version and build details. ```Shell nvcc --version ``` -------------------------------- ### Make Setup Script Executable Source: https://docs.io.net/docs/install-on-hiveos Grants execute permissions to the downloaded io.net setup script, allowing it to be run from the command line. ```bash chmod +x ionet-setup.sh ``` -------------------------------- ### Check Docker Installation Source: https://docs.io.net/docs/docker-not-installed-or-running Verifies if Docker is installed and running by displaying its system information. This command is essential for confirming a successful Docker setup. ```bash docker info ``` -------------------------------- ### Check Docker Installation (Bash) Source: https://docs.io.net/docs/ubuntu-install-docker This command checks if Docker is installed on the system. If the command is not found, it indicates that Docker is not installed, and you can proceed with the installation guide. It also suggests alternative installation methods. ```bash docker compose version ``` -------------------------------- ### Navigate to Downloads Folder in Terminal Source: https://docs.io.net/docs/install-on-windows This command is used within a terminal on a Windows machine to change the current directory to the 'Downloads' folder, where the IO Binary is typically saved. ```bash cd Downloads ``` -------------------------------- ### View Running Docker Containers Source: https://docs.io.net/docs/additional-guides This command lists all currently running Docker containers. It is used to verify that the platform has started successfully, expecting two containers to be active. ```bash docker ps ``` -------------------------------- ### Launch IO Binary Source: https://docs.io.net/docs/install-on-macos Executes the IO binary. This is the primary command to start the worker. It accepts optional arguments like disabling sleep mode. ```shell ./io_net_launch_binary_mac ``` ```shell ./io_net_launch_binary_mac --disable_sleep_mode=true ``` -------------------------------- ### Troubleshoot Docker Installation with Reset Script Source: https://docs.io.net/docs/ubuntu-install-docker Executes a script to reset Docker and drivers if the initial verification fails. Requires making the script executable before running. A device restart is recommended after execution. ```shell chmod +x reset_drivers_and_docker.sh ./reset_drivers_and_docker.sh ``` -------------------------------- ### List Files in Directory (Bash) Source: https://docs.io.net/docs/ubuntu-install-docker This command lists all the files and directories in the current directory. It's used here to identify the name of the downloaded Docker .deb package for installation. ```bash ls ``` -------------------------------- ### Navigate to Home Directory Source: https://docs.io.net/docs/install-on-hiveos Changes the current working directory to the user's home directory. This is a common starting point for downloading and executing scripts. ```bash cd ~ ``` -------------------------------- ### Configure Nvidia-ctk Directly for Docker Runtime Source: https://docs.io.net/docs/waiting-for-io-containers-to-start Configures the Docker runtime using the nvidia-ctk command-line tool and restarts the Docker service. ```bash sudo nvidia-ctk runtime configure --runtime=docker sudo systemctl restart docker ``` -------------------------------- ### Verify Nvidia-container-toolkit Path and Docker Runtime Configuration Source: https://docs.io.net/docs/waiting-for-io-containers-to-start Checks if the nvidia-ctk executable is in the system's PATH and verifies that Docker is configured to use a GPU runtime. ```bash /usr/bin/nvidia-ctk --version echo $PATH ``` ```bash docker info | grep -i runtime ``` -------------------------------- ### Verify Nvidia Driver Installation (Windows) Source: https://docs.io.net/docs/install-nvidia-drivers-on-windows This command checks if the NVIDIA driver is installed and recognized by the system. It's used to confirm successful installation after following the driver setup process. ```shell nvidia-smi ``` -------------------------------- ### Bypass Interactive Authentication with Token (Windows) Source: https://docs.io.net/docs/install-on-windows This command allows bypassing the interactive authentication process for onboarding additional devices by providing a token. The token is valid for 12 months. Ensure you have your token value ready. ```bash io_net_launch_binary_windows.exe --token your-token-value ``` -------------------------------- ### Download IO Binary for Linux Source: https://docs.io.net/docs/install-on-ubuntu Downloads the IO Net launch binary for Linux (Ubuntu) using curl. This command fetches the executable file from a GitHub repository and saves it locally. ```bash curl -L https://github.com/ionet-official/io_launch_binaries/raw/main/io_net_launch_binary_linux -o io_net_launch_binary_linux ``` -------------------------------- ### Launch IO.NET Binary on Linux for Bare Metal Workers Source: https://docs.io.net/docs/bare-metal-on-demand-supplier-process This command launches the IO.NET binary on a Linux system for bare metal worker registration. It requires device and user identifiers, operating system details, GPU usage preference, device name, worker mode, IP address, and port. ```shell /io_net_launch_binary_linux --device_id=DEVICE_ID --user_id=USER_ID --operating_system="Linux" --usegpus=true --device_name=DEVICE_NAME --worker_mode=baremetal --worker_ip=HOST_IP --worker_port=HOST_PORT ``` -------------------------------- ### Download IO Binary for MacOS Source: https://docs.io.net/docs/install-on-macos Downloads the io_net_launch_binary_mac executable using curl. Ensure you have curl installed on your system. ```shell curl -L https://github.com/ionet-official/io_launch_binaries/raw/main/io_net_launch_binary_mac -o io_net_launch_binary_mac ``` -------------------------------- ### List Packages in Base Python Environment (Bash) Source: https://docs.io.net/docs/data-science-image-full-specification This command lists all installed packages and their versions within the base Python environment on the Data Science VM Image. It requires pip to be installed in the base environment. ```bash pip3 list ``` -------------------------------- ### Run IO Binary with Authentication Token Source: https://docs.io.net/docs/install-on-ubuntu Executes the IO Net launch binary using a `--token` flag for bypassing interactive authentication. Replace `your-token-value` with the actual authorization token. ```bash ./io_net_launch_binary_linux --token your-token-value ``` -------------------------------- ### Reset Drivers and Docker Script Source: https://docs.io.net/docs/additional-guides A shell script designed to reset system drivers and the Docker environment. This is typically used to resolve issues after failed installations or during troubleshooting. ```bash reset_drivers_and_docker.sh ``` -------------------------------- ### Grant Permissions to IO Binary Source: https://docs.io.net/docs/install-on-macos Makes the downloaded IO binary executable. This command is essential before running the binary. ```shell chmod +x io_net_launch_binary_mac ``` -------------------------------- ### Install Docker Package (Bash) Source: https://docs.io.net/docs/ubuntu-install-docker This command installs the Docker Desktop package on Ubuntu using the .deb file. It's crucial to replace './docker-desktop-amd64.deb' with the actual filename of the downloaded package. ```bash sudo apt-get install ./docker-desktop-amd64.deb ``` -------------------------------- ### Navigate to Downloads Directory (Bash) Source: https://docs.io.net/docs/ubuntu-install-docker This command changes the current directory to the 'Downloads' folder. This is typically where downloaded files are stored, and it's necessary before installing a local package. ```bash cd Downloads/ ``` -------------------------------- ### Reset Docker Drivers and Installation Script Source: https://docs.io.net/docs/troubleshoot-docker Executes a script to reset Docker drivers and installation for troubleshooting. Requires making the script executable before running. ```bash chmod +x reset_drivers_and_docker.sh ./reset_drivers_and_docker.sh ``` -------------------------------- ### Securely Wipe Drives (Example using shred) Source: https://docs.io.net/docs/bare-metal-on-demand-supplier-process This command securely deletes data from drives, making it unrecoverable. It is a recommended step for ensuring no residual data remains after a booking period. The `shred` command overwrites data multiple times. ```shell shred ``` -------------------------------- ### Securely Wipe Drives (Example using dd) Source: https://docs.io.net/docs/bare-metal-on-demand-supplier-process This command securely deletes data from drives, making it unrecoverable. It is a recommended step for ensuring no residual data remains after a booking period. The `dd` command can be used with options to overwrite data. ```shell dd ``` -------------------------------- ### Verify Docker Installation (Terminal) Source: https://docs.io.net/docs/install-docker-on-macos This command verifies the successful installation of Docker by displaying its current version. It requires the Docker application to be installed and accessible in the system's PATH. ```shell docker --version ``` -------------------------------- ### Update Package List Source: https://docs.io.net/docs/install-on-hiveos Updates the local package index to ensure you have the latest available versions of software. This is a standard first step before installing new packages. ```bash sudo apt-get update -y ``` -------------------------------- ### Launch io_net Binary After Rosetta Installation Source: https://docs.io.net/docs/troubleshoot-macos-worker This command executes the io_net launch binary after Rosetta 2 has been successfully installed. It is used to run applications designed for Intel processors on Apple Silicon devices. ```bash ./io_net_launch_binary_mac ``` -------------------------------- ### Grant Execute Permissions to IO Binary Source: https://docs.io.net/docs/install-on-ubuntu Grants execute permissions to the downloaded IO Net launch binary. The `chmod +x` command is used to make the binary file executable. ```bash chmod +x io_net_launch_binary_linux ``` -------------------------------- ### Verify Docker Service Status (Bash) Source: https://docs.io.net/docs/ubuntu-install-docker This command checks the status of the Docker service to confirm if it is running correctly. The output shows details like whether the service is enabled, active, and its main process ID. ```bash sudo systemctl status docker ``` -------------------------------- ### Execute M4 Device Migration Command (macOS) Source: https://docs.io.net/docs/supplier-migration-guide-upgrading-to-m4-series-devices This command is used on a macOS device to initiate the migration process to an M4 series device. It requires the existing device ID, user ID, and device name, and specifies the operating system and GPU usage. ```Shell ./io_net_launch_binary_mac --device_id={same device id} --user_id={same user_id} --operating_system="macOS" --usegpus=false --device_name="{same device name}" ``` -------------------------------- ### Install gnupg1 Source: https://docs.io.net/docs/install-on-hiveos Installs the gnupg1 package, which is a dependency for certain operations, potentially related to key management or package authentication. The '-y' flag automatically confirms the installation. ```bash sudo apt-get install -y gnupg1 ``` -------------------------------- ### Configure Docker daemon.json for Nvidia Runtime Source: https://docs.io.net/docs/waiting-for-io-containers-to-start Modifies the Docker daemon configuration file to specify the Nvidia container runtime. This ensures Docker uses the Nvidia runtime by default. ```bash sudo nano /etc/docker/daemon.json ``` ```json { "runtimes": { "nvidia": { "path": "nvidia-container-runtime", "runtimeArgs": [] } }, "default-runtime": "nvidia" } ``` ```bash sudo reboot ``` ```bash sudo systemctl restart docker ``` -------------------------------- ### Verify Ubuntu Version Source: https://docs.io.net/docs/install-on-ubuntu Command to check the Ubuntu version. It's recommended to use Ubuntu 22.04 LTS or later. ```bash lsb_release -a ``` -------------------------------- ### cURL Request to IO Intelligence API Source: https://docs.io.net/docs/io-intelligence This snippet demonstrates how to make a POST request to the IO Intelligence API using cURL to get chat completions from a specified model. It includes necessary headers for content type and authorization, along with a JSON payload containing the model, messages, and temperature settings. Ensure your $IOINTELLIGENCE_API_KEY environment variable is set. ```curl curl https://api.intelligence.io.solutions/api/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $IOINTELLIGENCE_API_KEY" \ -d '{ "model": "meta-llama/Llama-3.3-70B-Instruct", "messages": [{"role": "user", "content": "Say this is a test!"}], "temperature": 0.7 }' ``` -------------------------------- ### List Packages in Conda 'rapids-25.6.0' Environment (Bash) Source: https://docs.io.net/docs/data-science-image-full-specification This command lists all installed packages and their versions within the 'rapids-25.6.0' Conda environment on the Data Science VM Image. It requires the Conda package manager to be installed and the specified environment to exist. ```bash conda run -n rapids-25.6.0 pip3 list ``` -------------------------------- ### Install Speedtest CLI Source: https://docs.io.net/docs/connectivity-tier-not-displaying-correctly Installs the speedtest-cli Python package inside the running Docker container. This tool is used for measuring internet connection bandwidth. ```bash pip install speedtest-cli ``` -------------------------------- ### Install Rosetta 2 on Apple Silicon Source: https://docs.io.net/docs/troubleshoot-macos-worker This command installs Rosetta 2, which allows Intel-based applications to run on Apple Silicon (M1/M2) Macs. You must agree to the license to proceed with the installation. ```bash softwareupdate --install-rosetta --agree-to-license ``` -------------------------------- ### Verify Active Processes using top Source: https://docs.io.net/docs/bare-metal-on-demand-supplier-process This command displays real-time information about running processes, used to verify that no active processes remain on the device after cleanup. It helps confirm that applications, databases, and services have been properly shut down. ```shell top ``` -------------------------------- ### Verify Active Processes using ps Source: https://docs.io.net/docs/bare-metal-on-demand-supplier-process This command lists currently running processes, used to verify that no active processes remain on the device after cleanup. It helps confirm that applications, databases, and services have been properly shut down. ```shell ps ``` -------------------------------- ### Set WSL 2 as Default Version Source: https://docs.io.net/docs/install-docker-on-windows This command configures WSL 2 as the default version for all new Linux distributions installed on Windows. A system restart might be required after executing this command. ```shell wsl --set-default-version 2 ``` -------------------------------- ### Update Package List (Bash) Source: https://docs.io.net/docs/ubuntu-install-docker This command updates the package list for Ubuntu, ensuring that you have the latest information about available packages. This is a prerequisite for installing new software, including Docker. ```bash sudo apt-get update ``` -------------------------------- ### Unmount Filesystems Source: https://docs.io.net/docs/bare-metal-on-demand-supplier-process This command is used to unmount filesystems, ensuring that no data is in use or locked before wiping drives. It's a crucial step in the secure cleanup process. ```shell umount ``` -------------------------------- ### Enable WSL Feature in Windows Source: https://docs.io.net/docs/install-docker-on-windows This command enables the Windows Subsystem for Linux feature, which is a prerequisite for using Docker with WSL 2. It requires administrator privileges to run. ```shell dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart ``` -------------------------------- ### Verify Docker GPU Installation (Linux/Windows) Source: https://docs.io.net/docs/troubleshoot-docker Confirms that Docker is correctly utilizing the GPU by running a CUDA-enabled container and executing nvidia-smi. The output should match the system's nvidia-smi results. ```bash docker run --gpus all nvidia/cuda:11.0.3-base-ubuntu18.04 nvidia-smi ``` -------------------------------- ### Check CPU Information Source: https://docs.io.net/docs/install-on-ubuntu Command to display CPU information, including the processor type. Supports AMD & Intel processors. ```bash lscpu ``` -------------------------------- ### Restart Docker Service Source: https://docs.io.net/docs/docker-not-installed-or-running Restarts the Docker service to ensure it is running and can accept commands. This command is used after system changes or if the Docker daemon is unresponsive. ```bash sudo systemctl restart docker ``` -------------------------------- ### Chat Completions API Source: https://docs.io.net/docs/io-intelligence This endpoint allows you to interact with AI models to generate text completions based on provided messages. ```APIDOC ## POST /api/v1/chat/completions ### Description Allows users to interact with AI models for text generation by sending a list of messages. ### Method POST ### Endpoint /api/v1/chat/completions ### Parameters #### Query Parameters None #### Request Body - **model** (string) - Required - The ID of the model to use for completion. - **messages** (array) - Required - A list of message objects, where each object has a 'role' (user, assistant, or system) and 'content' (the message text). - **temperature** (number) - Optional - Controls randomness. Lower values make output more focused and deterministic. ### Request Example ```json { "model": "meta-llama/Llama-3.3-70B-Instruct", "messages": [{"role": "user", "content": "Say this is a test!"}], "temperature": 0.7 } ``` ### Response #### Success Response (200) - **choices** (array) - A list of completion choices. - **message** (object) - The generated message. - **role** (string) - The role of the message author (e.g., 'assistant'). - **content** (string) - The content of the generated message. #### Response Example ```json { "choices": [ { "message": { "role": "assistant", "content": "This is a test!" } } ] } ``` ``` -------------------------------- ### Enable Virtual Machine Platform Feature in Windows Source: https://docs.io.net/docs/install-docker-on-windows This command enables the Virtual Machine Platform feature, which is necessary for Docker Desktop to run efficiently on Windows using WSL 2. Ensure PowerShell is run as administrator. ```shell dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart ``` -------------------------------- ### Bypass Interactive Authentication with Token Source: https://docs.io.net/docs/install-on-macos This command allows users to onboard a new device by bypassing the standard interactive authentication process. It requires a token value to be provided. ```bash ./io_net_launch_binary_mac --token your-token-value ``` -------------------------------- ### Reboot Server Source: https://docs.io.net/docs/docker-not-installed-or-running Restarts the server to apply group membership changes. A reboot ensures that all active sessions recognize the updated group permissions. ```bash sudo reboot ``` -------------------------------- ### Install and Update ipywidgets Package Source: https://docs.io.net/docs/jupyter-notebook This command installs or updates the 'ipywidgets' package to the latest version. It's a common step for resolving issues related to outdated dependencies in Python environments, particularly for notebook-based development. ```python pip install -U ipywidgets ``` -------------------------------- ### Check Rosetta Installation Status Source: https://docs.io.net/docs/troubleshoot-macos-worker This command checks if Rosetta is installed and active on your Apple Silicon device. It is necessary for running Intel-based applications on M1/M2 Macs. The output '1' indicates it's active, '0' or no output means it's not. ```bash /usr/sbin/sysctl sysctl.proc_translated ``` -------------------------------- ### Run Docker Container Source: https://docs.io.net/docs/connectivity-tier-not-displaying-correctly Starts an interactive terminal session within the newly pulled Python Docker container. This allows for command execution inside the container. ```docker docker run -it --name speedtest-container python:3.9-slim /bin/bash ``` -------------------------------- ### Check User Group Membership Source: https://docs.io.net/docs/docker-not-installed-or-running Checks if the current user is a member of the Docker group by searching the /etc/group file. This is crucial for determining if the user has the necessary permissions to interact with Docker. ```bash grep -i docker /etc/group ``` -------------------------------- ### Run IO Binary with Disabled Sleep Mode Source: https://docs.io.net/docs/install-on-ubuntu Executes the IO Net launch binary with the `--disable_sleep_mode=true` argument. This prevents the device from entering sleep mode, ensuring continuous operation. ```bash ./io_net_launch_binary_linux --disable_sleep_mode=true ``` -------------------------------- ### Stop and Remove Docker Containers (Linux) Source: https://docs.io.net/docs/stop-restart-the-platform This command stops all currently running Docker containers and then removes them. It's essential for a clean restart of the platform. Ensure you have the necessary sudo privileges. ```bash sudo docker stop $(sudo docker ps -a -q); sudo docker rm $(sudo docker ps -q) ``` -------------------------------- ### Example Error Response Source: https://docs.io.net/docs/important-action-required-for-expired-refresh-tokens This JSON object represents a common error when a refresh token is invalid or expired, preventing authentication. ```json { "error":"invalid_grant", "error_description":"Unknown or invalid refresh token." } ``` -------------------------------- ### Download IO.NET Worker Launch Binaries Source: https://docs.io.net/docs/troubleshoot-worker-general Instructions for downloading the IO.NET worker launch binaries for different operating systems. This is the first step in connecting a device to the platform using the new authentication system. ```shell curl -L https://github.com/ionet-official/io_launch_binaries/blob/main/io_net_launch_binary_mac -o io_net_launch_binary_mac ``` ```shell https://github.com/ionet-official/io_launch_binaries/raw/main/io_net_launch_binary_windows.exe ``` ```shell curl -L https://github.com/ionet-official/io_launch_binaries/blob/main/io_net_launch_binary_linux -o io_net_launch_binary_linux ``` -------------------------------- ### Valid Component Connections in Agentic Workflow Editor Source: https://docs.io.net/docs/agentic-workflow Examples of valid connection patterns between different component types (Agent, Task, Tool, Model) in the Agentic Workflow Editor. This illustrates how data and logic flow. ```UI/UX Valid Connection Examples: * Agent → Tool * Agent → Model * Task → Tool ``` -------------------------------- ### Launch IO.NET Worker Binary to Connect Device Source: https://docs.io.net/docs/troubleshoot-worker-general Commands to launch the IO.NET worker binaries on macOS, Windows, and Linux after granting permissions. These commands initiate the device connection process, with the --no_warnings=true flag suppressing unnecessary warnings. ```shell ./io_net_launch_binary_mac --no_warnings=true ``` ```shell ./io_net_launch_binary_windows.exe --no_warnings=true ``` ```shell ./io_net_launch_binary_linux --no_warnings=true ``` -------------------------------- ### Add User to Docker Group Source: https://docs.io.net/docs/docker-not-installed-or-running Adds the current user to the Docker group, granting them permissions to execute Docker commands without sudo. This command modifies the system's group configurations. ```bash sudo usermod -aG docker $USER ``` ```bash sudo usermod -aG docker Michael ``` -------------------------------- ### Invalid Component Connections in Agentic Workflow Editor Source: https://docs.io.net/docs/agentic-workflow Examples of invalid connection patterns between component types in the Agentic Workflow Editor. These connections violate the directional flow of logic and data. ```UI/UX Invalid: * Tool → Agent * Tool → Task ``` -------------------------------- ### IO.net Device Base Score Calculation Formula Source: https://docs.io.net/docs/block-rewards-page This formula outlines how the base score for a device is calculated, considering factors like connectivity tier, hardware, processor quantity, and hiring status. It is crucial for determining potential earnings within the IO.net ecosystem. ```text +(0.02 _ (connectivity_tier_number / 4.0)) + (2.0 _ hardware_multiplier _ processor_quantity)) _ 100 + (0.05 _ was_hired)) _ 10 ``` -------------------------------- ### Reset RAID Configuration using mdadm Source: https://docs.io.net/docs/bare-metal-on-demand-supplier-process This command is used to delete RAID arrays and clear RAID metadata, a necessary step in resetting the server configuration to its factory defaults. It's part of the recommended cleanup process. ```shell mdadm ``` -------------------------------- ### Re-authenticate IO.NET Worker with New Account Source: https://docs.io.net/docs/troubleshoot-worker-general Suppliers can change their accounts in IO Worker by including the --no_cache=true flag in the binary run command. This forces a re-authentication process. The examples show how to add this flag for macOS, Windows, and Linux. ```shell ./launch_binary_mac --disable_sleep_mode=true --no_cache=true ``` ```shell ./io_net_launch_binary_windows.exe --disable_sleep_mode=true --no_cache=true ``` ```shell ./io_net_launch_binary_linux --disable_sleep_mode=true --no_cache=true ``` -------------------------------- ### Resolve Expired or Invalid Token Authentication Error Source: https://docs.io.net/docs/troubleshoot-worker This error message indicates an issue with the provided authentication token. It suggests re-authenticating using the --no_cache=true flag, which forces a fresh authentication process. ```text Error: device code authorization returned: Bad Request Error: Error authenticating: provided token has expired or invalid. Please re-authenticate using --no_cache=true flag. ``` -------------------------------- ### Verify Official $IO Staking Contract Address on Solscan Source: https://docs.io.net/docs/protecting-your-stake This snippet provides the official Solscan URL to verify the $IO staking contract address. Users should always confirm this address matches the one in the official documentation to prevent interacting with malicious contracts. ```text https://solscan.io/account/3RRz3bZ7Khr3Cw2i7JURpKuUPT3G9QFV7fNVPmhSsF2i ``` -------------------------------- ### Environment Variables in Entrypoints (JSON) Source: https://docs.io.net/docs/deploy-vm-on-demand Demonstrates the correct way to use environment variables within container entrypoints to avoid deployment failures. It shows how to escape '$' characters for proper variable substitution. ```JSON { "entrypoint": [ "sh", "-c", "echo 'Variable value: $${TEST_VAR}' && sleep 3600" ], "env_variables": { "TEST_VAR": "This is a test" } } ``` -------------------------------- ### Grant Permissions to IO.NET Launch Binaries Source: https://docs.io.net/docs/troubleshoot-worker-general This command grants execute permissions to the downloaded IO.NET launch binaries on macOS and Linux systems, which is necessary before launching them to connect the device. ```shell chmod +x io_net_launch_binary_mac ``` ```shell chmod +x io_net_launch_binary_linux ``` -------------------------------- ### Stake $IO on io.net Source: https://docs.io.net/docs/staking Details the steps required to stake $IO on io.net after connecting a crypto wallet. This includes selecting a worker, entering the stake amount, and confirming the transaction. ```plaintext 1. Locate the worker you want to stake to and click the **Stake** button under **Staking Actions** in the **Manage Your Stake & Devices** table. 2. In the pop-up window, enter the required amount of $IO for your hardware, and confirm by clicking the **Stake** button. Remember that you can always add to your $IO stake later, but you must use the same wallet that you originally used to stake on that device. ``` -------------------------------- ### Using grep for Proof-of-Work Log Analysis (Linux) Source: https://docs.io.net/docs/proof-of-work This snippet demonstrates how to use the `grep` command-line tool to search for a device ID within Proof-of-Work logs for troubleshooting. It assumes the user is familiar with command-line operations. ```bash grep "" ``` -------------------------------- ### Connect Phantom Wallet to io.net Source: https://docs.io.net/docs/staking Demonstrates the process of connecting a Phantom wallet to the io.net platform for staking $IO. This involves navigating to the staking tab and authorizing the connection through the wallet interface. ```plaintext 1. In io.net, go to**IO Worker** > **Staking** tab. 2. Click **Connect Crypto Wallet** on the right side on the **Staking** page. 3. Select your crypto wallet in the pop-up window. Please note that this wallet can be different from the wallet you have associated with your account. For example, see Solana Wallet to learn more. 4. The **Phantom** wallet prompts you to connect with IO. Click **Connect** to proceed. ``` -------------------------------- ### Distributing ML Workloads with Ray.io on io.net Source: https://docs.io.net/docs/faq io.net is built on ray.io, a framework for distributed computing used by organizations like OpenAI. This enables users to distribute AI and Python applications, from reinforcement learning to deep learning and model serving, across a grid of GPUs. ```python import ray # Initialize Ray (io.net will handle the distributed setup) ray.init() # Example: Define a simple task @ray.remote def my_task(x): return x * 2 # Execute the task on the distributed cluster results = ray.get([my_task.remote(i) for i in range(10)]) print(results) # io.net supports various ML frameworks like PyTorch FSDP, TensorFlow, etc. # Example for PyTorch FSDP (conceptual): # from torch.distributed.fsdp import FullyShardedDataParallel as FSDP # model = FSDP(model) # Example for TensorFlow (conceptual): # from tensorflow.distribute import Strategy # strategy = Strategy(...) # with strategy.scope(): # model = build_model() ray.shutdown() ``` -------------------------------- ### Use IO Credits via API Source: https://docs.io.net/docs/io-credits Demonstrates how to specify 'credits' as the payment method in deployment API calls. Includes fallback options for low balances, such as checking credit availability, pending payments, negative credit allowance, and a grace period for top-ups. ```plaintext Deployment endpoints accept `payment_method: "credits"`. If Balance Is Low, fallback options may include: * `GET /credits/check?amount=XX` * Pending Payment state * Small negative credit allowance (e.g., -$10) * 5-minute grace window with top-up prompt * Failure if not topped up in time ``` -------------------------------- ### Use IO Credits for Deployment via API Source: https://docs.io.net/docs/io-credits This section details how to specify IO Credits as the payment method when deploying compute resources via the API. It also outlines fallback mechanisms when the balance is low. ```APIDOC ## Deployment with IO Credits via API ### Description When making deployment requests via API, you can specify `payment_method: "credits"` to use your available IO Credits. The system will automatically deduct the required credits. ### Method POST (or relevant deployment method) ### Endpoint `/deployments` (example endpoint) ### Parameters #### Request Body - **payment_method** (string) - Required - Set to `"credits"` to use IO Credits for payment. - **amount** (integer) - Required - The amount of credits to use for the deployment. ### Request Example ```json { "deployment_name": "my-ray-cluster", "instance_type": "gpu", "node_count": 3, "payment_method": "credits", "amount": 50 } ``` ### Response #### Success Response (200) - **deployment_id** (string) - The ID of the created deployment. - **status** (string) - The status of the deployment. #### Response Example ```json { "deployment_id": "dep_abc123xyz", "status": "pending" } ``` ### Error Handling / Fallback Options If the IO Credit balance is low, the following fallback options may be considered by the system: - **`GET /credits/check?amount=XX`**: Used to verify if a specific amount is available. - **Pending Payment state**: The deployment might enter a pending state, awaiting further action. - **Small negative credit allowance**: A small overdraft might be permitted (e.g., -$10). - **5-minute grace window with top-up prompt**: Users may have a short period to add credits. - **Failure**: If not topped up within the grace period, the deployment will fail. ``` -------------------------------- ### Initial Monthly Inflation Rate Calculation Source: https://docs.io.net/docs/ionet-monthly-token-emission-schedule This calculation demonstrates how the initial monthly inflation rate is derived from the annual inflation rate, showing a simple division by 12 months. ```mathematics Initial Monthly Inflation Rate = Annual Inflation Rate ÷ Months Per Year Initial Monthly Inflation Rate = 8% ÷ 12 = 0.667% ``` -------------------------------- ### Selecting an AI Model for an Agent Source: https://docs.io.net/docs/agentic-workflow Steps to select and connect an AI model to an Agent component. This involves searching for and choosing a model from the available list in the right sidebar. ```UI/UX 1. Click **Add Component** → Select **AI Model** 2. Select the Component block → use right sidebar to: * Search and select an AI model * Click **Save** 3. The block updates with the model name ``` -------------------------------- ### Importing a Flow from YAML Source: https://docs.io.net/docs/agentic-workflow Instructions on how to import a workflow definition from a YAML file into the Agentic Workflow Editor. This allows for pre-configured workflows to be loaded. ```UI/UX Click **Import From YAML** button when you just created new flow in the center of the flow editor Upload `.yaml` file (max 1MB) Click **Generate Flow** ``` -------------------------------- ### Creating and Removing Connections Source: https://docs.io.net/docs/agentic-workflow Instructions on how to create and remove connections between workflow components by dragging connection points and using the provided UI elements. ```UI/UX To create a connection: Drag from the top-right circle of one block to another. This sets execution order and data flow To remove a connection : Hover over the connecting line, then click the cross icon to remove it. ``` -------------------------------- ### Available Tools in Agentic Workflow Editor Source: https://docs.io.net/docs/agentic-workflow A list of available tools that can be integrated into the Agentic Workflow Editor, along with brief descriptions of their functionality. These tools extend the capabilities of agents and tasks. ```Tool Integration Tool Name| Description ---|--- `r2r.list documents`| Lists documents with pagination. `r2r.rag search`| Performs a Retrieval-Augmented Generation (RAG) search. `listing coins`| Retrieves a paginated list of active cryptocurrencies. `get coin info`| Returns coin metadata like logo, description, links, and documentation. `get coin quotes`| Provides real-time price quotes for cryptocurrencies. `get coin quotes historical`| Returns historical price quotes. `search the web`| Performs a web search. Requires `text` input. `search the web async`| Performs a web search asynchronously. Requires `text` input. ``` -------------------------------- ### Pull Python Docker Container Source: https://docs.io.net/docs/connectivity-tier-not-displaying-correctly Pulls the specified Python 3.9 Slim Docker image. This is the first step to setting up the testing environment. ```docker docker pull python:3.9-slim ``` -------------------------------- ### Month 1 Token Emission Calculation Source: https://docs.io.net/docs/ionet-monthly-token-emission-schedule This code snippet shows the calculation for the first month's token emissions, using the initial total supply and the initial monthly inflation rate. It also details the updated total supply after emissions. ```mathematics Emissions_1 = 500,000,000 × 0.667% Emissions_1 = 3,333,333.33 tokens Total Supply: 500,000,000 + 3,333,333.33 = 503,333,333.33 ``` -------------------------------- ### Restart Docker Platform Source: https://docs.io.net/docs/troubleshoot-docker-for-windows Command to restart the Docker platform after a system reboot or other troubleshooting steps. ```bash ./io_net_launch_binary_windows.exe ``` -------------------------------- ### Configuring a Task Component Source: https://docs.io.net/docs/agentic-workflow Information on how to configure Task components, which represent specific steps in the workflow. This includes setting a Task ID, Name, Text, and Client Mode. ```UI/UX Configure each task with: `Task ID` `Name` `Text` `Client Mode (on/off)` ``` -------------------------------- ### Check Running Docker Containers Source: https://docs.io.net/docs/troubleshoot-docker Lists all currently running Docker containers, useful for identifying duplicate instances of services like io-worker-vc. ```bash docker ps ``` -------------------------------- ### Python: Ray Torch Trainer for Fashion MNIST Source: https://docs.io.net/docs/jupyter-notebook This Python code defines the necessary components for distributed training of a Fashion MNIST model using Ray's TorchTrainer. It includes data loading, a neural network architecture, and the training/evaluation loop per worker, with reporting of training metrics. ```python import os from typing import Dict import torch from filelock import FileLock from torch import nn from torch.utils.data import DataLoader from torchvision import datasets, transforms from torchvision.transforms import Normalize, ToTensor from tqdm import tqdm import ray.train from ray.train import ScalingConfig from ray.train.torch import TorchTrainer def get_dataloaders(batch_size): transform = transforms.Compose([ToTensor(), Normalize((0.5,), (0.5,))]) with FileLock(os.path.expanduser("~/data.lock")): training_data = datasets.FashionMNIST( root="~/data", train=True, download=True, transform=transform, ) test_data = datasets.FashionMNIST( root="~/data", train=False, download=True, transform=transform, ) train_dataloader = DataLoader(training_data, batch_size=batch_size, shuffle=True) test_dataloader = DataLoader(test_data, batch_size=batch_size) return train_dataloader, test_dataloader class NeuralNetwork(nn.Module): def __init__(self): super(NeuralNetwork, self).__init__() self.flatten = nn.Flatten() self.linear_relu_stack = nn.Sequential( nn.Linear(28 * 28, 512), nn.ReLU(), nn.Dropout(0.25), nn.Linear(512, 512), nn.ReLU(), nn.Dropout(0.25), nn.Linear(512, 10), nn.ReLU(), ) def forward(self, x): x = self.flatten(x) logits = self.linear_relu_stack(x) return logits def train_func_per_worker(config: Dict): lr = config["lr"] epochs = config["epochs"] batch_size = config["batch_size_per_worker"] train_dataloader, test_dataloader = get_dataloaders(batch_size=batch_size) train_dataloader = ray.train.torch.prepare_data_loader(train_dataloader) test_dataloader = ray.train.torch.prepare_data_loader(test_dataloader) model = NeuralNetwork() model = ray.train.torch.prepare_model(model) loss_fn = nn.CrossEntropyLoss() optimizer = torch.optim.SGD(model.parameters(), lr=lr, momentum=0.9) # Model training loop for epoch in range(epochs): if ray.train.get_context().get_world_size() > 1: train_dataloader.sampler.set_epoch(epoch) model.train() for X, y in tqdm(train_dataloader, desc=f"Train Epoch {epoch}"): pred = model(X) loss = loss_fn(pred, y) optimizer.zero_grad() loss.backward() optimizer.step() model.eval() test_loss, num_correct, num_total = 0, 0, 0 with torch.no_grad(): for X, y in tqdm(test_dataloader, desc=f"Test Epoch {epoch}"): pred = model(X) loss = loss_fn(pred, y) test_loss += loss.item() num_total += y.shape[0] num_correct += (pred.argmax(1) == y).sum().item() test_loss /= len(test_dataloader) accuracy = num_correct / num_total ray.train.report(metrics={"loss": test_loss, "accuracy": accuracy}) def train_fashion_mnist(num_workers=2, use_gpu=False): global_batch_size = 32 train_config = { "lr": 1e-3, "epochs": 10, "batch_size_per_worker": global_batch_size // num_workers, } # Configure computation resources scaling_config = ScalingConfig(num_workers=num_workers, use_gpu=use_gpu) # Initialize a Ray TorchTrainer trainer = TorchTrainer( train_loop_per_worker=train_func_per_worker, train_loop_config=train_config, scaling_config=scaling_config, ) result = trainer.fit() print(f"Training result: {result}") ``` -------------------------------- ### Check and Update WSL Version Source: https://docs.io.net/docs/troubleshoot-docker-for-windows Ensures you are running the latest version of Windows Subsystem for Linux (WSL) and sets the default version to WSL 2, which is often required for Docker Desktop. ```bash wsl --version ``` ```bash wsl --set-default-version 2 ``` -------------------------------- ### Test Network Speed Source: https://docs.io.net/docs/connectivity-tier-not-displaying-correctly Executes the speedtest-cli command within the Docker container to measure network performance. This provides download, upload, and ping metrics. ```bash speedtest-cli ``` -------------------------------- ### Configuring a Stage Component Source: https://docs.io.net/docs/agentic-workflow Details for configuring Stage components, used for organizing workflows into sequential or parallel stages. Configuration includes Type, Objective, Result Type, and Context. ```UI/UX Configure each Stage with: `Type` `Objective` `Result Type` `Context` ``` -------------------------------- ### Configuring an Agent Component Source: https://docs.io.net/docs/agentic-workflow Details on the configuration options for an Agent component within the workflow editor. This includes setting the agent's name, instructions, and swarm name. ```UI/UX Configure: `Agent Name` `Instructions` (what it should do) `Swarm Name` (for group coordination if applicable) ``` -------------------------------- ### Shell Script to Reset Docker and NVIDIA Drivers Source: https://docs.io.net/docs/troubleshoot-docker A comprehensive bash script designed to stop, remove, and uninstall all Docker components, including containers, images, engine, and related storage. It also handles the uninstallation of NVIDIA Docker and drivers, followed by system cleanup and updates. ```bash #!/bin/bash # Stop all running Docker containers echo "Stopping all running Docker containers..." docker stop $(docker ps -a -q) # Remove all Docker containers echo "Removing all Docker containers..." docker rm $(docker ps -a -q) # Remove all Docker images echo "Removing all Docker images..." docker rmi $(docker images -q) # Uninstall Docker Engine, CLI, and Containerd echo "Uninstalling Docker..." sudo apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli containerd containerd.io # Remove Docker's storage volumes echo "Removing Docker storage volumes..." sudo rm -rf /var/lib/docker sudo rm -rf /var/lib/containerd # Remove Docker group sudo groupdel docker # Remove Docker's configuration files echo "Removing Docker configuration files..." sudo rm -rf /etc/docker # Remove any leftover Docker files sudo find / -name '*docker*' -exec rm -rf {} \; # Uninstall NVIDIA Docker echo "Uninstalling NVIDIA Docker..." sudo apt-get purge -y nvidia-docker # Uninstall NVIDIA drivers echo "Uninstalling NVIDIA drivers..." sudo apt-get purge -y '*nvidia*' # Remove any remaining NVIDIA directories sudo rm -rf /usr/local/nvidia/ # Update the package lists echo "Updating package lists..." sudo apt-get update # Autoremove any orphaned packages echo "Removing unused packages and cleaning up..." sudo apt-get autoremove -y sudo apt-get autoclean # Rebuild the kernel module dependencies echo "Rebuilding kernel module dependencies..." sudo depmod # Inform the user that a reboot is required echo "Uninstallation complete. Please reboot your system." ``` -------------------------------- ### Calculate Minimum Stake Requirement Source: https://docs.io.net/docs/io-staking This Python code snippet calculates the minimum stake required for a device based on the base requirement per card, the number of GPUs, and the earning multiplier. It ensures a minimum stake is always met. ```python minimum_stake_required = base_requirement_per_card * max(1, earning_multiplier) ```