### Start Nix Development Shell Source: https://docs.cloudypad.gg/contributing/contribution-guide Initiates the Nix development shell, automating the setup of the project's required tools and versions. The first execution may take time to download packages, but subsequent runs are fast. Ensure Nix and Docker are installed beforehand. ```bash nix develop ``` -------------------------------- ### Run Local Documentation Server Source: https://docs.cloudypad.gg/contributing/contribution-guide Starts a local server to preview documentation changes. This allows you to see how your Markdown updates will render before deploying. ```shell task mdbook-server ``` -------------------------------- ### Example Instance State File Source: https://docs.cloudypad.gg/contributing/contribution-guide This YAML file demonstrates the structure of an instance state, including provisioning inputs/outputs and configuration details. It is used to define and track the state of a cloud instance. ```yaml __ name: aws-instance version: '1' # Provision inputs and outputs provision: provider: aws # provider name # Desired instance state for AWS input: diskSize: 200 instanceType: g4dn.2xlarge publicIpType: static region: eu-central-1 ssh: user: ubuntu privateKeyContentBase64: xxx # Actual infrastructure state # for AWS, host is instance static IP address and instanceId the EC2 instance ID output: host: 18.199.182.227 instanceId: i-0ae901f1799b17fdf # Configuration inputs and outputs # used to configure instance configuration: configurator: ansible input: sunshine: enable: true passwordBase64: xxx username: sunshine ``` -------------------------------- ### Create Cloudy Pad Instance Source: https://docs.cloudypad.gg/cloud-provider-setup/aws This command initiates the creation of a Cloudy Pad instance. It assumes that your AWS environment is properly configured. ```bash cloudypad create ``` -------------------------------- ### Run Cloudy Pad with Nix Source: https://docs.cloudypad.gg/usage/installation Installs and runs the Cloudy Pad CLI using Nix, a powerful package manager. This allows for declarative installation and execution. ```bash nix run github:PierreBeucher/cloudypad create ``` ```bash nix run github:PierreBeucher/cloudypad -- --version ``` -------------------------------- ### Upgrade and Provision Cloudy Pad Instance Source: https://docs.cloudypad.gg/usage/installation Commands to upgrade an existing Cloudy Pad instance to the latest version and then provision it to apply the changes. This ensures the instance reflects the newest features and configurations. ```bash cloudypad provision my-instance ``` ```bash cloudypad configure my-instance ``` -------------------------------- ### Cloudy Pad Instance Management Commands Source: https://docs.cloudypad.gg/usage/cli Provides examples for common instance management tasks: listing all instances, getting details of a specific instance, and starting, stopping, or restarting an instance. ```bash cloudypad list ``` ```bash cloudypad get mypad ``` ```bash cloudypad start mypad ``` ```bash cloudypad stop mypad ``` ```bash cloudypad restart mypad ``` -------------------------------- ### Verify Azure Account Configuration Source: https://docs.cloudypad.gg/cloud-provider-setup/azure This command verifies that your Azure account is configured correctly and lists available subscriptions. It requires the Azure CLI to be installed and configured with your credentials. ```bash az account list ``` -------------------------------- ### Run CloudyPad CLI Help Source: https://docs.cloudypad.gg/contributing/contribution-guide Displays the help information for the CloudyPad CLI, useful for understanding available commands and options during development. ```shell npx tsx src/cli/main.ts --help ``` -------------------------------- ### Verify AWS Credentials and Configuration Source: https://docs.cloudypad.gg/cloud-provider-setup/aws This command verifies that your AWS credentials are correctly configured and allows you to retrieve your AWS User ID, Account ID, and ARN. Ensure you have the AWS CLI installed and configured. ```bash aws sts get-caller-identity ``` -------------------------------- ### Install cloudypad CLI Source: https://docs.cloudypad.gg/getting-started Installs the latest version of the cloudypad CLI using a curl command. This script downloads and executes the installation script from a remote URL. ```bash curl -fsSL https://raw.githubusercontent.com/PierreBeucher/cloudypad/master/install.sh | bash ``` -------------------------------- ### Create Test Instance with CloudyPad CLI Source: https://docs.cloudypad.gg/contributing/contribution-guide Creates a test instance using the CloudyPad CLI. This command allows you to deploy and test your changes in a live environment. ```shell npx tsx src/cli/main.ts create aws my-test-instance [...] ``` -------------------------------- ### Configure Instance with Cloudy Pad CLI Source: https://docs.cloudypad.gg/print Command to run the configuration process for a Cloudy Pad instance. This step installs necessary packages and software, like the Wolf server. ```bash cloudypad configure mypad ``` -------------------------------- ### Build Application with npm Source: https://docs.cloudypad.gg/contributing/contribution-guide Builds the application using npm. This command compiles the source code into a distributable format. ```shell task build-npm ``` -------------------------------- ### Install Cloudy Pad CLI with Zsh Source: https://docs.cloudypad.gg/usage/installation Installs the latest version of the Cloudy Pad CLI using a zsh script. This method is suitable for users who prefer or use the Zsh shell. ```zsh curl -fsSL https://raw.githubusercontent.com/PierreBeucher/cloudypad/master/install.sh | zsh ``` -------------------------------- ### Install cloudypad CLI with curl Source: https://docs.cloudypad.gg/print Installs the latest version of the cloudypad CLI using curl. This method is suitable for Linux and MacOS environments. ```shell curl -fsSL https://raw.githubusercontent.com/PierreBeucher/cloudypad/master/install.sh | bash ``` ```shell curl -fsSL https://raw.githubusercontent.com/PierreBeucher/cloudypad/master/install.sh | zsh ``` -------------------------------- ### Provision or Update Cloudy Pad Instance Source: https://docs.cloudypad.gg/help/upgrade-guide Commands to provision or update a Cloudy Pad instance. `cloudypad provision` is used for initial setup, while `cloudypad update` applies changes to existing instances. Note that `cloudypad provision` and `cloudypad update` may not fully function with older Scaleway volume types. ```bash cloudypad provision ``` ```bash cloudypad update ``` -------------------------------- ### Manage Instance Lifecycle with Cloudy Pad CLI Source: https://docs.cloudypad.gg/print Commands to start, stop, or restart a Cloudy Pad instance. These operations are fundamental for managing the availability of your instances. ```bash cloudypad start mypad cloudypad stop mypad cloudypad restart mypad ``` -------------------------------- ### Environment Variables for Cloudy Pad Source: https://docs.cloudypad.gg/print Configuration of Cloudy Pad using environment variables. Examples include log level, CLI debugging, home directory, and version settings for the launcher and container image. ```bash # Log level. Also exposed via CLI --verbose flag. # 0: silly, 1: trace, 2: debug, 3: info, 4: warn, 5: error, 6: fatal CLOUDYPAD_LOG_LEVEL=3 # Set -x bash flag to show all commands executed by launcher script CLOUDYPAD_CLI_LAUNCHER_DEBUG=1 # Home directory for Cloudy Pad data CLOUDYPAD_HOME=~/.cloudypad # Cloudy Pad version to use for launcher. # Beware: changing this value will change Cloudy Pad container image used # which may not be compatible with launch version installed CLOUDYPAD_VERSION=0.7.0 # Override Cloudy Pad container image used by launcher CLOUDYPAD_IMAGE="crafteo/cloudypad:$CLOUDYPAD_VERSION" ``` -------------------------------- ### Check Scaleway CLI Configuration Source: https://docs.cloudypad.gg/cloud-provider-setup/scaleway This command verifies that the Scaleway Command Line Interface (CLI) is correctly configured and authenticated with your Scaleway account. Ensure you have run `scw login` and set up your credentials beforehand. ```bash scw info ``` -------------------------------- ### Set Up Local Debug VM with Vagrant Source: https://docs.cloudypad.gg/contributing/contribution-guide Sets up a local debug Virtual Machine (VM) using Vagrant and a Vagrantfile. This VM mimics a real Cloudy Pad instance for testing configuration changes, Ansible playbooks, and Sunshine container images, although it may lack GPU support. ```shell vagrant up ``` ```shell task dev-ansible-config ``` -------------------------------- ### Debug Container with Docker Compose Volume Mounts Source: https://docs.cloudypad.gg/contributing/contribution-guide This snippet demonstrates how to debug container and Dockerfile changes by mounting local files into a running container using Docker Compose with Vagrant. This allows for faster testing without rebuilding the container image. The example shows mounting a configuration file. ```YAML volumes: # [...] # Mount local containers/sunshine/overlay/cloudy/conf/sunshine/sunshine.conf.template # Local project is mounted at /vagrant, hence using /vagrant/ # - "/vagrant/containers/sunshine/overlay/cloudy/conf/sunshine/sunshine.conf.template:/cloudy/conf/sunshine/sunshine.conf.template" ``` -------------------------------- ### Authenticate with Google Cloud Application Default Credentials Source: https://docs.cloudypad.gg/cloud-provider-setup/gcp This command authenticates your local environment using Application Default Credentials (ADC). ADC is required for Google APIs to access your credentials when running locally, as opposed to standard 'gcloud auth login'. Ensure you have the Google Cloud SDK installed and configured. ```shell gcloud auth application-default login ``` -------------------------------- ### Build Core Docker Container Locally Source: https://docs.cloudypad.gg/contributing/contribution-guide Builds the core Docker container for local development and testing. This ensures the container environment is consistent with production. ```shell task build-core-container-local ``` -------------------------------- ### Run Unit Tests Source: https://docs.cloudypad.gg/contributing/contribution-guide Executes the unit tests for the project. This is a crucial step to verify the correctness of your code changes before merging. ```shell task test-unit ``` -------------------------------- ### Push Local Container Image to VM Source: https://docs.cloudypad.gg/contributing/contribution-guide This section details the process of pushing a local container image to a VM. It assumes the VM is accessible via a specific IP address and requires manual pairing using the Sunshine web UI and Moonlight. ```Bash task dev-docker-sunshine-to-vm ``` -------------------------------- ### Build and Test with Task Runner Source: https://docs.cloudypad.gg/contributing/contribution-guide Executes common development tasks using the project's task runner, defined in `Taskfile.yml`. This includes building the Node CLI package and running unit tests. These commands are available after entering the Nix development shell. ```bash # Build Node CLI package task build-npm # Run unit tests task test-unit ``` -------------------------------- ### Pair Cloudy Pad Instance (CLI) Source: https://docs.cloudypad.gg/usage/moonlight-pairing Manually pair your Cloudy Pad instance using the Cloudy Pad CLI. This command initiates the pairing process, and a separate command is provided for the Moonlight client to complete the pairing. ```shell cloudypad pair my-instance ``` ```shell # Run this command in another terminal to pair your instance: # # moonlight pair 35.181.136.176 --pin 1234 ``` -------------------------------- ### Run CloudyPad CLI (Development) Source: https://docs.cloudypad.gg/print Executes the CloudyPad CLI directly from the development code using tsx. This allows for immediate testing of CLI changes without needing a full build or installation. ```shell npx tsx src/cli/main.ts --help ``` ```shell npx tsx src/cli/main.ts create aws my-test-instance [...] ``` -------------------------------- ### Waiting for Instance Actions with Timeout Source: https://docs.cloudypad.gg/usage/cli Shows how to wait for instance start, stop, or restart operations to complete, with an optional timeout duration in seconds. This ensures actions are finished before proceeding. ```bash cloudypad [start|top|restart] mypad --wait --timeout 180 ``` -------------------------------- ### Deploy Latest Version to Instance Source: https://docs.cloudypad.gg/print Command to update an existing Cloudy Pad instance to the latest version. This involves upgrading the Cloudy Pad installation first, then running the deploy command. ```bash cloudypad deploy my-instance ``` -------------------------------- ### Decode Base64 Encoded Sunshine Password Source: https://docs.cloudypad.gg/print Example of how to decode a base64 encoded password, typically found in instance details, to retrieve the actual password for services like Sunshine. ```bash echo "c3Vuc2hpbmU=" | base64 -d ``` -------------------------------- ### Instance Lifecycle Management with InstanceManager Source: https://docs.cloudypad.gg/print The InstanceManager orchestrates the lifecycle of an instance, delegating tasks to specialized components for provisioning, configuration, and running operations. It relies on InstanceProvisioner for infrastructure setup and InstanceRunner for start/stop actions. ```typescript import { InstanceManager } from "./manager"; import { InstanceProvisioner } from "./provisioner"; import { InstanceRunner } from "./runner"; // Example usage: const provisioner = new InstanceProvisioner(); const runner = new InstanceRunner(); const manager = new InstanceManager(provisioner, runner); // Initialize instance // manager.initialize(...); // Start instance // manager.start(...); // Stop instance // manager.stop(...); // Delete instance // manager.delete(...); ``` -------------------------------- ### Get Instance IP Address with Cloudy Pad CLI Source: https://docs.cloudypad.gg/usage/streaming-server Retrieves the IP address of a Cloudy Pad instance using the 'cloudypad get' command. This IP is necessary for establishing SSH connections and accessing instance services. ```bash cloudypad get ``` -------------------------------- ### Run All Integration Tests in Cloudy Pad Source: https://docs.cloudypad.gg/contributing/contribution-guide Executes all stable integration tests for Cloudy Pad using the 'task test-integ-stable' command. These tests create real cloud infrastructure and require local credentials. Ensure you understand the tests before execution. ```shell task test-integ-stable ``` -------------------------------- ### Run Specific Provider Integration Tests in Cloudy Pad Source: https://docs.cloudypad.gg/contributing/contribution-guide Executes integration tests for a specific cloud provider, such as Scaleway, using the 'test-integ-provider-scaleway' command. This allows for targeted testing of provider-specific infrastructure interactions. ```shell test-integ-provider-scaleway ``` -------------------------------- ### Create Cloudy-Pad Instance with Rate Limiting (AWS Example) Source: https://docs.cloudypad.gg/print This command demonstrates how to create a new Cloudy-Pad instance on AWS with a specified network rate limit. The `--ratelimit-max-mbps` flag controls the maximum network speed in megabits per second, which can help manage egress traffic costs. ```bash cloudypad create aws --name my-instance \ --ratelimit-max-mbps 20 # ... ``` -------------------------------- ### Get Instance Details with Cloudy Pad Source: https://docs.cloudypad.gg/usage/ssh Retrieves the configuration details of a specified Cloudy Pad instance, including host and SSH connection parameters. This command outputs a JSON object containing instance information. ```bash cloudypad get mypad ``` -------------------------------- ### Create SSH Instance with Cloudy Pad Source: https://docs.cloudypad.gg/print This command initiates the creation of a new instance using the SSH provider. Cloudy Pad will guide you through the necessary steps to configure your instance. Make sure you have your SSH key or password ready before running this command. ```bash cloudypad create ssh ``` -------------------------------- ### AWS Provider InstanceRunner Implementation Source: https://docs.cloudypad.gg/print This TypeScript file implements the InstanceRunner for the AWS provider. It utilizes the AWS SDK client to interact with AWS APIs for starting and stopping EC2 instances. ```typescript import { InstanceRunner } from "../runner"; import { AwsSdkClient } from "./sdk-client"; // Assuming AwsSdkClient is defined elsewhere export class AwsInstanceRunner implements InstanceRunner { private sdkClient: AwsSdkClient; constructor(sdkClient: AwsSdkClient) { this.sdkClient = sdkClient; } async start(instanceId: string): Promise { console.log(`Starting AWS instance: ${instanceId}`); await this.sdkClient.startEc2Instance(instanceId); } async stop(instanceId: string): Promise { console.log(`Stopping AWS instance: ${instanceId}`); await this.sdkClient.stopEc2Instance(instanceId); } } ``` -------------------------------- ### Decode Sunshine Password with Base64 Source: https://docs.cloudypad.gg/usage/streaming-server Decodes the base64 encoded Sunshine password obtained from the 'cloudypad get' command output. This allows users to view the plain text password for login. ```bash echo "c3Vuc2hpbmU=" | base64 -d # sunshine ``` -------------------------------- ### Cloudy Pad IPv6 Pairing Workaround Source: https://docs.cloudypad.gg/usage/moonlight-pairing A workaround for Mac/Apple devices that may prevent Moonlight from pairing on non-local addresses. This involves using an IPv6 address format instead of the default IPv4 address. ```shell 200.123.4.56 ``` ```shell [::ffff:200.123.4.56] ``` -------------------------------- ### Manage Cloudy Pad Auto Stop Systemd Service Source: https://docs.cloudypad.gg/usage/autostop These commands allow for controlling the `cloudypad-autostop` systemd service. You can stop, start, or check the status of the service. Additionally, you can view its logs in real-time. ```bash sudo systemctl stop|start|status cloudypad-autostop sudo journalctl -u cloudypad-autostop -f ``` -------------------------------- ### Verify AWS Credentials with AWS CLI Source: https://docs.cloudypad.gg/print This snippet demonstrates how to verify your AWS credentials using the AWS CLI by checking your IAM identity. Ensure you have the AWS CLI installed and configured with valid credentials. ```bash __ $ aws sts get-caller-identity { "UserId": "AID...YOUR_USER_ID", "Account": "123456789", "Arn": "arn:aws:iam::123456789:user/crafteo" } ``` -------------------------------- ### Update Container with Custom Mounts Source: https://docs.cloudypad.gg/contributing/contribution-guide This command updates the container with custom volume mounts defined in the Docker Compose file. It requires SSHing into the Vagrant instance and then running the Docker Compose command to bring up the service with the specified configuration. ```Bash vagrant ssh $ docker compose -f /vagrant/test/resources/docker-compose.vagrant.yml -p sunshine up -d --force-recreate ``` -------------------------------- ### Update Cloudy-Pad Instance with Rate Limiting (AWS Example) Source: https://docs.cloudypad.gg/print This command shows how to update an existing Cloudy-Pad instance on AWS to set a specific network rate limit. The `--ratelimit-max-mbps` option is used to cap the network speed, assisting in the control of egress data transfer costs. ```bash cloudypad update aws --name my-instance \ --ratelimit-max-mbps 20 ``` -------------------------------- ### Create Custom Cloudy Pad Dockerfile Source: https://docs.cloudypad.gg/contributing/container-image Defines a Dockerfile to build a custom Cloudy Pad image. It starts from a base Sunshine image and allows for adding custom packages and other Docker instructions. Ensure you use the same version as returned by `cloudypad --version`. ```dockerfile # Use the same version returned by cloudypad --version FROM ghcr.io/pierrebeucher/cloudypad/sunshine:0.19.0 # Example: add custom packages RUN --mount=type=cache,target=/var/cache --mount=type=tmpfs,target=/var/log \ apt update && \ apt install -y my-package another-package && \ apt clean # # Add other instructions... # ``` -------------------------------- ### Manage Pulumi Stacks Locally Source: https://docs.cloudypad.gg/contributing/contribution-guide Manipulates Pulumi stacks locally within the Nix development shell. This involves listing stacks, showing stack resources with IDs, and destroying stacks, facilitated by pre-set environment variables like PULUMI_BACKEND_URL and PULUMI_CONFIG_PASSPHRASE. ```shell pulumi stack ls -a ``` ```shell pulumi stack -s --show-ids ``` ```shell pulumi destroy -s ``` -------------------------------- ### Debug Cloudy Pad Deployments with Ansible Source: https://docs.cloudypad.gg/contributing/contribution-guide Debugs Cloudy Pad configurations by setting the CLOUDYPAD_LOG_LEVEL environment variable to 2 (DEBUG) or 3 (INFO) and running configuration commands. The Ansible playbook path is shown in DEBUG logs, allowing direct execution and modification of the playbook for easier debugging. ```shell CLOUDYPAD_LOG_LEVEL=2 npx tsx src/cli/main.ts configure my-instance ``` ```shell ansible-playbook -i /tmp/nix-shell.iuM9BJ/cloudypad-qBivGz/inventory.yml ansible/sunshine.yml ``` -------------------------------- ### MacOS Docker VirtioFS Error Example Source: https://docs.cloudypad.gg/help/known-issues This snippet displays a typical error response from the Docker daemon when encountering issues with mount source paths due to VirtioFS and SSH agent conflicts on MacOS. It highlights the 'operation not supported' message. ```bash Error response from daemon: error while creating mount source path '/private/tmp/com.apple.launchd.ABCDEF/Listeners': mkdir /private/tmp/com.apple.launchd.ABCDEF/Listeners: operation not supported ``` -------------------------------- ### cloudypad CLI Help Source: https://docs.cloudypad.gg/print Displays the main help information for the cloudypad CLI, listing available commands and global options. This is the entry point for understanding the CLI's capabilities. ```shell $ cloudypad --help Usage: cloudypad [options] [command] Cloudy Pad CLI to manage your own gaming instance in the Cloud. Options: -v, --verbose Verbosity level (0: silly, 1: trace, 2: debug, 3: info, 4: warn, 5: error, 6: fatal). Alternatively, use CLOUDYPAD_LOG_LEVEL environment variable. -V, --version output the version number -h, --help display help for command Commands: create Create a new instance. See subcommands for each provider options. update Update an existing instance. See subcommands for each provider options. list [options] List all instances start [options] Start an instance stop [options] Stop an instance restart [options] Restart an instance. Depending on provider this operation may be synchronous. get Get current state of an instance and its status (running, provisioned, configured, ready) provision [options] Provision an instance (deploy or update Cloud resources) configure [options] Configure an instance (connect to instance and install drivers, packages, etc.) deploy [options] Deploy an instance: provision and configure it. Equivalent to running provision and configure commands sequentially. destroy [options] Destroy an instance pair Pair an instance with Moonlight help [command] display help for command ``` -------------------------------- ### Create Cloudy Pad Instance Source: https://docs.cloudypad.gg/getting-started Creates a new Cloudy Pad instance using the cloudypad CLI. This command will prompt for necessary information and then provision and configure the instance, including GPU drivers and streaming server. ```bash cloudypad create # How shall we name your Cloudy Pad instance? (default: mypad) # # Creating Cloudy Pad instance 'mypad' # # [...] # # 🥳 Your Cloudy Pad instance is ready ! ``` -------------------------------- ### Set Up Local Debug VM with Vagrant Source: https://docs.cloudypad.gg/print These commands are used to set up and manage a local debug Virtual Machine using Vagrant. This VM mimics a real Cloudy Pad instance for testing configuration and container image changes. ```bash # Create VM vagrant up ``` ```bash # Run configuration from Ansible playbook task dev-ansible-config ``` -------------------------------- ### Manual Instance Lifecycle Commands Source: https://docs.cloudypad.gg/usage/cli Details the commands for performing individual steps of the instance deployment lifecycle: provisioning cloud resources, configuring the instance software, and pairing it with Moonlight. ```bash cloudypad provision mypad ``` ```bash cloudypad configure mypad ``` ```bash cloudypad pair mypad ``` -------------------------------- ### Create cloudypad Instance Source: https://docs.cloudypad.gg/print Commands to create a new cloudypad gaming instance. Supports interactive creation or specifying all parameters via flags for specific cloud providers. ```shell cloudypad create # Or for a specific provider cloudy pad create azure cloudy pad create aws cloudy pad create gcp # Google cloudy pad create paperspace cloudy pad create scaleway ``` ```shell cloudypad create aws \ --name $instance_name \ --instance-type g4dn.xlarge \ --disk-size 100 \ --public-ip-type static \ --region eu-central-1 \ --spot \ --streaming-server [sunshine|wolf] \ --cost-alert [disable|no|false|0] \ --cost-limit 40 \ --cost-notification-email me@example.com \ --ratelimit-max-mbps 40 \ --yes --overwrite-existing ``` -------------------------------- ### Create Instance with Cloudy Pad CLI Source: https://docs.cloudypad.gg/print This command is used to initiate the creation of a gaming instance using the Cloudy Pad command-line interface after the cloud provider has been successfully configured. ```bash __ cloudypad create ``` -------------------------------- ### Building and Pushing a Custom Docker Image Source: https://docs.cloudypad.gg/print These commands demonstrate how to build a Docker image using `docker buildx` and tag it appropriately, followed by pushing the image to a container registry. This process is essential for deploying custom container images to cloud instances or other environments. ```bash docker buildx build . -t your-registry/cloudypad-custom:some-tag docker push your-registry/cloudypad-custom:some-tag ``` -------------------------------- ### Cloudy Pad CLI Help and Basic Commands Source: https://docs.cloudypad.gg/usage/cli Displays the help information for the Cloudy Pad CLI, showing available options and commands. This is the entry point for understanding the CLI's capabilities. ```bash cloudypad --help ``` ```bash cloudypad create ``` ```bash cloudypad create azure ``` ```bash cloudypad create aws ``` ```bash cloudypad create gcp # Google ``` ```bash cloudypad create paperspace ``` ```bash cloudypad create scaleway ``` -------------------------------- ### Manage Pulumi Stacks Locally Source: https://docs.cloudypad.gg/print The Nix development shell automatically configures Pulumi environment variables, enabling local management of Pulumi stacks. These commands show how to list stacks, view stack resources, and destroy a stack. ```bash # List stacks pulumi stack ls -a ``` ```bash # Show stack resources pulumi stack -s --show-ids ``` ```bash # Destroy stack pulumi destroy -s ``` -------------------------------- ### Configure Cloudy-Pad Dedicated Data Disk (Scaleway) Source: https://docs.cloudypad.gg/print This procedure enables a dedicated data disk for Scaleway instances, separating OS and data for better maintenance and cost management. It involves upgrading the instance, configuring a 0 GB data disk, manually moving data, and then running an update command to provision and mount the new data disk. ```bash cloudypad configure SSH into your instance and move (not copy) folder mv /var/lib/cloudypad/data /var/lib/cloudypad/data-backup cloudypad update scaleway --name my-instance --data-disk-size SSH into your instance and move back data folder mv /var/lib/cloudypad/data-backup /var/lib/cloudypad/data ``` -------------------------------- ### Enable Debug Logging Source: https://docs.cloudypad.gg/print To view more detailed information during execution, set the CLOUDYPAD_LOG_LEVEL environment variable. Level 2 enables DEBUG messages, and level 3 enables INFO messages. ```bash export CLOUDYPAD_LOG_LEVEL=2 ``` ```bash export CLOUDYPAD_LOG_LEVEL=3 ``` -------------------------------- ### List Existing Instances with Cloudy Pad CLI Source: https://docs.cloudypad.gg/print Command to list all existing Cloudy Pad instances. This helps in managing multiple instances by providing a consolidated view. ```bash cloudypad list ``` -------------------------------- ### Pair Moonlight Manually with Instance IP and PIN Source: https://docs.cloudypad.gg/print Manual pairing process for Moonlight streaming client with an instance, requiring the instance's IP address and a PIN. This is done in a separate terminal from the `cloudypad pair` command. ```bash moonlight pair 35.181.136.176 --pin 1234 ``` -------------------------------- ### Verify Azure Account Configuration with Azure CLI Source: https://docs.cloudypad.gg/print This snippet shows how to check your Azure account configuration using the Azure CLI. It lists your subscriptions and verifies that your local environment is connected to your Azure account. ```bash __ $ az account list [ { "cloudName": "AzureCloud", "homeTenantId": "xxx", "id": "xxx", "isDefault": true, "managedByTenants": [], "name": "My Azure Subcription", "state": "Enabled", "tenantId": "xxx", "user": { "name": "you@example.com", "type": "user" } } ] ``` -------------------------------- ### Provision Instance Resources with Cloudy Pad CLI Source: https://docs.cloudypad.gg/print Command to provision or update the cloud resources for a Cloudy Pad instance, such as virtual machines, IP addresses, and disks. This is a key step in the instance creation lifecycle. ```bash cloudypad provision mypad ``` -------------------------------- ### Configure Cloudy Pad Instance (Scaleway) Source: https://docs.cloudypad.gg/help/upgrade-guide Use this command to configure a Cloudy Pad instance, particularly useful when migrating from older volume types or enabling dedicated data disks. It allows for partial updates when a full provision is not feasible. ```bash cloudypad configure ``` -------------------------------- ### Pair Moonlight with Instance using Cloudy Pad CLI Source: https://docs.cloudypad.gg/print Command to establish a connection pairing between Moonlight streaming client and an existing Cloudy Pad instance. This is typically done automatically during instance creation but can be performed manually. ```bash cloudypad pair my-instance ``` -------------------------------- ### Verify Scaleway Configuration with SCW CLI Source: https://docs.cloudypad.gg/print This command checks the configuration and connection status of the Scaleway CLI. It ensures that your local environment is properly set up to interact with Scaleway services. ```bash scw info ``` -------------------------------- ### Build and Push Custom Docker Image Source: https://docs.cloudypad.gg/contributing/container-image Commands to build a Docker image locally and push it to a container registry. Replace `your-registry/cloudypad-custom:some-tag` with your actual registry, image name, and tag. ```bash docker buildx build . -t your-registry/cloudypad-custom:some-tag docker push your-registry/cloudypad-custom:some-tag ``` -------------------------------- ### Debug Ansible Playbook Execution Source: https://docs.cloudypad.gg/print This command demonstrates how to run a deployment or configuration command with increased logging to observe the Ansible playbook path. The output will show the full Ansible command, which can then be used for direct debugging. ```bash CLOUDYPAD_LOG_LEVEL=2 npx tsx src/cli/main.ts configure my-instance ``` -------------------------------- ### Updating Instance with Custom Image via Docker Compose Source: https://docs.cloudypad.gg/print This command sequence updates a running instance to use a custom Docker image without a full `cloudypad update`. It involves connecting to the instance via SSH, navigating to the `sunshine` directory, and then running `docker-compose` with specific compose files to pull and restart the container with the desired image. ```bash docker-compose -f docker-compose.yml -f docker-compose.nvidia.yml up -d --pull always ``` -------------------------------- ### Pair Cloudy Pad Instance using CLI Source: https://docs.cloudypad.gg/help/moonlight-install-connect This command pairs your Cloudy Pad instance with Moonlight using the Cloudy Pad CLI. It requires a separate terminal to run the Moonlight pairing command with the provided IP and PIN. ```bash cloudypad pair my-instance # Run this command in another terminal to pair your instance: # # moonlight pair 35.181.136.176 --pin 1234 ``` -------------------------------- ### Configure Network Rate Limit with cloudypad CLI Source: https://docs.cloudypad.gg/cost/index Demonstrates how to set network speed limits for cloud instances using the 'cloudypad create' and 'cloudypad update' commands. This feature helps manage egress traffic costs. ```bash cloudypad create aws --name my-instance \ --ratelimit-max-mbps 20 # ... cloudypad update aws --name my-instance \ --ratelimit-max-mbps 20 ``` -------------------------------- ### Deploying and Destroying Cloudy Pad Instances Source: https://docs.cloudypad.gg/usage/cli Illustrates the commands for deploying (provisioning and configuring) an instance to the latest version and destroying an instance. The destroy command includes an option to bypass the confirmation prompt. ```bash cloudypad deploy my-instance ``` ```bash cloudypad destroy mypad ``` ```bash cloudypad destroy mypad --yes ``` -------------------------------- ### Execute Ansible Playbook Directly Source: https://docs.cloudypad.gg/print This command allows direct execution and debugging of the Ansible playbook using the path identified in the debug logs. It requires the inventory file path and the playbook path. ```bash ansible-playbook -i /tmp/nix-shell.iuM9BJ/cloudypad-qBivGz/inventory.yml ansible/sunshine.yml ``` -------------------------------- ### Mounting Local Files in Vagrant for Faster Container Testing Source: https://docs.cloudypad.gg/print This snippet demonstrates how to configure `docker-compose.vagrant.yml` to mount local files into a running container on a Vagrant VM. This allows for rapid iteration on container configurations without rebuilding the entire image. It assumes the local project is mounted at `/vagrant` within the VM. ```yaml volumes: # [...] # # Mount local containers/sunshine/overlay/cloudy/conf/sunshine/sunshine.conf.template # Local project is mounted at /vagrant, hence using /vagrant/ # - "/vagrant/containers/sunshine/overlay/cloudy/conf/sunshine/sunshine.conf.template:/cloudy/conf/sunshine/sunshine.conf.template" ``` -------------------------------- ### Stop Cloud Instance with cloudypad CLI Source: https://docs.cloudypad.gg/cost/index Shows the command to stop a running Cloudy Pad instance, which is a crucial step to avoid unnecessary costs when the instance is not in use. ```bash cloudypad stop mypad ``` -------------------------------- ### Update Cloudy Pad Instance with Dedicated Data Disk (Scaleway) Source: https://docs.cloudypad.gg/help/upgrade-guide This command updates a Scaleway instance and enables a dedicated data disk. It requires specifying the instance name and the desired data disk size in GB. Ensure legacy root volumes are migrated before running this command. ```bash cloudypad update scaleway --name my-instance --data-disk-size ``` -------------------------------- ### Connect to Instance Using Base64 SSH Key Source: https://docs.cloudypad.gg/usage/ssh Demonstrates how to connect to a Cloudy Pad instance when the SSH private key is provided as a base64-encoded string. It involves creating a temporary file, decoding the key, and then using SSH with the decoded key. ```bash # Create a file only current user can access to write our key in touch /tmp/my-instance-key chmod 0600 /tmp/my-instance-key # Decode key into our file cloudypad get mypad | jq -r .provision.input.ssh.privateKeyContentBase64 | base64 -d > /tmp/my-instance-key # Note: jq is a JSON parser you may need to install # Otherwise copy/paste key content and use echo directly such as # echo "...KeyContentAsVeryLongString..." | base64 -d > /tmp/my-instance-key # Connect to instance using key ssh -i /tmp/my-instance-key ubuntu@1.123.45.xxx ``` -------------------------------- ### AWS Provider Pulumi Stack Definition Source: https://docs.cloudypad.gg/print This TypeScript file defines the Pulumi Stack program for the AWS provider. It outlines how cloud resources are provisioned and managed using Pulumi, an Infrastructure as Code tool. ```typescript import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws"; // Example resource definition const ec2Instance = new aws.ec2.Instance("my-instance", { ami: "ami-0abcdef1234567890", // Example AMI ID instanceType: "g4dn.2xlarge", tags: { Name: "cloudypad-instance", }, }); // Export relevant outputs export const instanceId = ec2Instance.id; export const publicIp = ec2Instance.publicIp; export const publicDns = ec2Instance.publicDnsName; ``` -------------------------------- ### Destroy Cloudy Pad Instance Source: https://docs.cloudypad.gg/print Command to permanently remove a Cloudy Pad instance and its associated resources. A confirmation prompt appears by default unless the `--yes` flag is used. ```bash cloudypad destroy mypad cloudypad destroy mypad --yes ``` -------------------------------- ### Connect to Instance Using SSH Key Path Source: https://docs.cloudypad.gg/usage/ssh Provides a straightforward method to connect to a Cloudy Pad instance when the SSH private key is accessible via a file path. This is the simpler method when a key file is already configured on the local system. ```bash ssh -i /home/crafteo/.ssh/id_ed25519 ubuntu@1.123.45.xxx ``` -------------------------------- ### Non-Interactive Instance Creation with AWS Source: https://docs.cloudypad.gg/usage/cli Demonstrates how to create an AWS instance non-interactively by specifying all required parameters as flags. This is useful for scripting and automated deployments. ```bash cloudypad create aws \ --name $instance_name \ --instance-type g4dn.xlarge \ --disk-size 100 \ --public-ip-type static \ --region eu-central-1 \ --spot \ --streaming-server [sunshine|wolf] \ --cost-alert [disable|no|false|0] \ --cost-limit 40 \ --cost-notification-email me@example.com \ --ratelimit-max-mbps 40 \ --yes --overwrite-existing ``` -------------------------------- ### Stop or Destroy Cloudy Pad Instance Source: https://docs.cloudypad.gg/getting-started Stops or destroys an existing Cloudy Pad instance using the cloudypad CLI. This is crucial for avoiding unnecessary costs after gaming sessions. ```bash cloudypad stop mypad # or # cloudypad destroy mypad ``` -------------------------------- ### AWS Provider Configuration for Instance State Source: https://docs.cloudypad.gg/print This YAML configuration defines the desired and actual state for an AWS instance. It includes details for provisioning, such as instance type and region, and configuration settings for software like Sunshine. The state is persisted locally. ```yaml name: aws-instance version: '1' # Provision inputs and outputs provision: provider: aws # provider name # Desired instance state for AWS input: diskSize: 200 instanceType: g4dn.2xlarge publicIpType: static region: eu-central-1 ssh: user: ubuntu privateKeyContentBase64: xxx # Actual infrastructure state # for AWS, host is instance static IP address and instanceId the EC2 instance ID output: host: 18.199.182.227 instanceId: i-0ae901f1799b17fdf # Configuration inputs and outputs # used to configure instance configuration: configurator: ansible input: sunshine: enable: true passwordBase64: xxx username: sunshine ``` -------------------------------- ### Updating Cloudy Pad Instance with Custom Sunshine Image Source: https://docs.cloudypad.gg/print This command updates a specific Cloudy Pad instance (`my-instance` on AWS) to use a custom Sunshine Docker image. It specifies the registry and tag of the custom image, allowing the instance to pull and run the customized version of the Sunshine service. ```bash cloudypad update aws my-instance \ --sunshine-image-registry your-registry/cloudypad-custom \ --sunshine-image-tag some-tag ``` -------------------------------- ### Authenticate Google Cloud with Application Default Credentials Source: https://docs.cloudypad.gg/print This command is essential for authenticating your application with Google Cloud services when using Application Default Credentials (ADC). It replaces the standard `gcloud auth login` for programmatic access. ```bash __ $ gcloud auth application-default login ``` -------------------------------- ### Cloudy Pad Environment Variables Configuration Source: https://docs.cloudypad.gg/usage/cli Lists and explains key environment variables used by Cloudy Pad for configuring logging levels, debugging, home directory, and version control. These variables allow for customization of the CLI's behavior. ```bash # Log level. Also exposed via CLI --verbose flag. # 0: silly, 1: trace, 2: debug, 3: info, 4: warn, 5: error, 6: fatal CLOUDYPAD_LOG_LEVEL=3 # Set -x bash flag to show all commands executed by launcher script CLOUDYPAD_CLI_LAUNCHER_DEBUG=1 # Home directory for Cloudy Pad data CLOUDYPAD_HOME=~/.cloudypad # Cloudy Pad version to use for launcher. # Beware: changing this value will change Cloudy Pad container image used # which may not be compatible with launch version installed CLOUDYPAD_VERSION=0.7.0 ``` -------------------------------- ### Generate SSH Key with Ed25519 Algorithm Source: https://docs.cloudypad.gg/print This command generates a new SSH key pair using the Ed25519 algorithm, which is a modern and secure choice. The `-a 100` flag increases the number of encryption rounds for added security. ```bash ssh-keygen -t ed25519 -a 100 ``` -------------------------------- ### Configure Cloudy Pad Analytics Collection Method Source: https://docs.cloudypad.gg/help/faq This YAML snippet demonstrates how to configure the data collection method for Cloudy Pad's analytics. Users can set the `collectionMethod` to 'none', 'technical', or 'all' to control the level of data gathered. This configuration is typically found in the `$HOME/.cloudypad/config.yml` file. ```yaml analytics: posthog: collectionMethod: none # <<===== EDIT HERE, valid value: "none", "technical", "all" distinctId: xxx ``` -------------------------------- ### Rapidly Update Sunshine Container during Development Source: https://docs.cloudypad.gg/contributing/container-image This command allows for a faster feedback loop during development by directly updating the Sunshine container on an instance without a full `cloudypad update` run. It assumes you have connected to the instance via SSH and navigated to the `sunshine` directory. ```bash docker-compose -f docker-compose.yml -f docker-compose.nvidia.yml up -d --pull always ``` -------------------------------- ### Establish SSH Tunnel to Sunshine Interface Source: https://docs.cloudypad.gg/usage/streaming-server Creates an SSH tunnel to access the Sunshine web interface running on the instance. It forwards the local port 47990 to the instance's port 47990, enabling browser access. ```bash ssh -L 47990:localhost:47990 @ ``` -------------------------------- ### Update Cloudy Pad Instance with Custom Image Source: https://docs.cloudypad.gg/contributing/container-image Updates a Cloudy Pad instance to use a custom Sunshine Docker image. This command requires the registry and tag of the custom image you previously built and pushed. This is a high-level update command. ```bash cloudypad update aws my-instance \ --sunshine-image-registry your-registry/cloudypad-custom \ --sunshine-image-tag some-tag ``` -------------------------------- ### Disable Cloudy Pad Analytics Environment Variable Source: https://docs.cloudypad.gg/print This command shows how to disable Cloudy Pad analytics by setting an environment variable. This is one of the methods to opt-out of data collection. ```bash export CLOUDYPAD_ANALYTICS_DISABLE=true ``` -------------------------------- ### Update Instance Auto Stop Configuration Source: https://docs.cloudypad.gg/usage/autostop This command updates an existing instance to enable or disable the Auto Stop feature and set its timeout. It requires the provider name, instance name, and the desired autostop-enable (true/false) and autostop-timeout (seconds) values. ```bash cloudypad update --name --autostop-enable true --autostop-timeout 600 ``` -------------------------------- ### Retrieve Sudo Password in Cloudy Pad Source: https://docs.cloudypad.gg/help/sudo This command retrieves the sudo password within the Cloudy Pad environment. It is executed via the terminal after right-clicking on the desktop. ```bash get-cloudy-password ``` -------------------------------- ### Workaround: Disable SSH Agent (MacOS) Source: https://docs.cloudypad.gg/help/known-issues This command-line instruction provides a temporary workaround for the Docker VirtioFS bug on MacOS by unsetting the SSH agent's socket. This prevents conflicts that can cause Cloudy Pad to fail. ```bash unset SSH_AUTH_SOCK ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.