Copyright (c) 2024 Expanso [email protected] This software is licensed under the Apache2/MIT License.
This was generated by Claude Sonnet 3.5, with the assistance of my human mentor.
A guide to using Andaime's beta features for Azure and GCP deployments. Cloud-hopping has never been so easy!
Andaime is expanding its capabilities beyond AWS to include Azure and GCP deployments. This guide will walk you through the process of using these beta features to create and manage Bacalhau clusters on these cloud platforms.
- Go 1.16 or later
- Azure CLI (for Azure deployments)
- Google Cloud SDK (for GCP deployments)
- Andaime CLI tool (built from the latest source)
-
Clone the Andaime repository:
git clone https://github.com/bacalhau-project/andaime.git cd andaime
-
Build the project:
make build
Before using the Azure deployment feature, ensure you have:
- An Azure account and subscription
- Azure CLI installed and authenticated
- The necessary permissions to create resources in your Azure subscription
- A configuration file (e.g.,
config-azure.yaml
) with the required settings
The Azure deployment is driven by a configuration file. Here's an explanation of the available settings:
azure:
allowed_ports:
- 22 # SSH
- 1234 # Custom port
- 1235 # Custom port
- 4222 # NATS
default_count_per_zone: 1
default_disk_size_gb: 30
default_machine_type: Standard_D2s_v3
machines:
- location: eastus2
parameters:
count: 2
- location: australiaeast
parameters:
type: Standard_B4as_v2
- location: spaincentral
parameters:
count: 2
orchestrator: false
type: Standard_D2s_v3
- location: uksouth
parameters:
orchestrator: true
- location: brazilsouth
parameters:
count: 4
vmsize: Standard_B4as_v2
- location: westus
resource_group_location: eastus
subscription_id: fd075559-43fc-4fbe-8dee-21e125a9dafc
general:
bacalhau_settings:
- key: compute.allowlistedlocalpaths
value:
- /tmp
- /data
- key: compute.heartbeat.interval
value: 5s
- key: compute.heartbeat.infoupdateinterval
value: 5s
- key: compute.heartbeat.resourceupdateinterval
value: 5s
- key: orchestrator.nodemanager.disconnecttimeout
value: 5s
- key: user.installationid
value: BACA14A0-eeee-eeee-eeee-194519911992
- key: jobadmissioncontrol.acceptnetworkedjobs
value: true
custom_script_path: /Users/daaronch/code/andaime/scripts/install_k3s.sh
log_level: debug
log_path: /var/log/andaime
project_prefix: andaime
ssh_port: 22
ssh_private_key_path: /Users/daaronch/.ssh/id_ed25519
ssh_public_key_path: /Users/daaronch/.ssh/id_ed25519.pub
ssh_user: andaime
Explanation of settings:
-
azure
section:allowed_ports
: List of ports to open in the security groupdefault_count_per_zone
: Default number of VMs to create per zone if not specifieddefault_disk_size_gb
: Default disk size for VMs in GBdefault_machine_type
: Default VM size if not specifiedmachines
: List of machine configurations per locationlocation
: Azure region for deploymentparameters
:count
: Number of VMs to create in this locationtype
orvmsize
: VM size for this locationorchestrator
: Boolean to indicate if this is an orchestrator node
resource_group_location
: Location for the Azure resource groupsubscription_id
: Your Azure subscription ID
-
general
section:bacalhau_settings
: List of key-value pairs for Bacalhau configurationcustom_script_path
: Path to a custom script to run on VM startuplog_level
: Logging level for Andaimelog_path
: Path for Andaime logsproject_prefix
: Prefix for resource namesssh_port
: SSH port for connecting to VMsssh_private_key_path
: Path to your SSH private keyssh_public_key_path
: Path to your SSH public keyssh_user
: SSH username for connecting to VMs
To create an Azure deployment using the configuration file:
- Create a configuration file (e.g.,
config-azure.yaml
) with your desired settings. - Run the following command:
./andaime beta azure create-deployment --config config-azure.yaml
This command will:
- Read the configuration file
- Create a new resource group (if it doesn't exist)
- Set up a virtual network and subnet
- Create public IP addresses and a network security group
- Deploy the specified number of VMs for compute and orchestrator nodes in the specified locations
- Install and configure Bacalhau on the nodes
Before using the GCP deployment feature, ensure you have:
- A Google Cloud Platform account and project
- Google Cloud SDK installed and authenticated
- The necessary permissions to create resources in your GCP project
- A configuration file (e.g.,
config-gcp.yaml
) with the required settings
The GCP deployment is driven by a configuration file, similar to the Azure deployment. Here's an explanation of the available settings for GCP:
gcp:
project_id: your-gcp-project-id
region: us-central1
zone: us-central1-a
allowed_ports:
- 22 # SSH
- 1234 # Custom port
- 1235 # Custom port
- 4222 # NATS
default_count_per_zone: 1
default_disk_size_gb: 30
default_machine_type: e2-medium
machines:
- zone: us-central1-a
parameters:
count: 2
- zone: us-west1-b
parameters:
type: n1-standard-2
- zone: us-east1-b
parameters:
count: 2
orchestrator: false
type: e2-standard-4
- zone: europe-west1-b
parameters:
orchestrator: true
- zone: asia-east1-a
parameters:
count: 4
machine_type: n1-standard-4
network_name: andaime-network
subnetwork_name: andaime-subnet
general:
bacalhau_settings:
- key: node.allowlistedlocalpaths
value:
- /tmp
- /data
- key: node.compute.controlplanesettings.heartbeatfrequency
value: 5s
- key: node.requester.controlplanesettings.heartbeatcheckfrequency
value: 5s
- key: node.requester.controlplanesettings.nodedisconnectedafter
value: 5s
- key: user.installationid
value: BACA14A0-eeee-eeee-eeee-194519911992
- key: node.requester.jobselectionpolicy.acceptnetworkedjobs
value: true
- key: node.compute.jobselection.acceptnetworkedjobs
value: true
custom_script_path: /path/to/your/custom/script.sh
log_level: debug
log_path: /var/log/andaime
project_prefix: andaime
ssh_port: 22
ssh_private_key_path: /path/to/.ssh/id_rsa
ssh_public_key_path: /path/to/.ssh/id_rsa.pub
ssh_user: andaime
Explanation of settings:
-
gcp
section:project_id
: Your GCP project IDregion
: Default GCP region for deploymentzone
: Default GCP zone for deploymentallowed_ports
: List of ports to open in the firewall rulesdefault_count_per_zone
: Default number of VMs to create per zone if not specifieddefault_disk_size_gb
: Default disk size for VMs in GBdefault_machine_type
: Default machine type if not specifiedmachines
: List of machine configurations per zonezone
: GCP zone for deploymentparameters
:count
: Number of VMs to create in this zonetype
ormachine_type
: Machine type for this zoneorchestrator
: Boolean to indicate if this is an orchestrator node
network_name
: Name of the VPC network to create or usesubnetwork_name
: Name of the subnetwork to create or use
-
general
section:bacalhau_settings
: List of key-value pairs for Bacalhau configurationcustom_script_path
: Path to a custom script to run on VM startuplog_level
: Logging level for Andaimelog_path
: Path for Andaime logsproject_prefix
: Prefix for resource namesssh_port
: SSH port for connecting to VMsssh_private_key_path
: Path to your SSH private keyssh_public_key_path
: Path to your SSH public keyssh_user
: SSH username for connecting to VMs
To create a GCP deployment using the configuration file:
- Create a configuration file (e.g.,
config-gcp.yaml
) with your desired settings. - Run the following command:
./andaime beta gcp create-deployment --config config-gcp.yaml
This command will:
- Read the configuration file
- Create or use the specified VPC network and subnetwork
- Set up firewall rules
- Deploy the specified number of VMs for compute and orchestrator nodes in the specified zones
- Install and configure Bacalhau on the nodes
This GETTING_STARTED_BETA.md file now provides a comprehensive guide for users to understand and use the beta features for both Azure and GCP deployments in Andaime, with both using configuration files instead of command-line flags.