This demo shows some minimal examples of how the Azure CycleCloud REST API and cyclecloud-scalelib library can be used to implement custom autoscaling and automated cluster operations in Azure CycleCloud clusters.
See the cyclecloud-scalelib project for detailed usage and examples on building your own autoscaler with Azure CycleCloud
This demo expects that you have a working CycleCloud Installation and understand the basics of CycleCloud and the core concepts of CycleCloud Clusters.
It also requires python 3.8 or later.
-
Clone the Repository
-
Run the python packaging script to create a redistributable demo tarball
python3 ./package.py
-
Extract the dist tarball
tar xzf ./dist/cyclecloud-demo-*.tar.gz
-
Create a python virtual environment for the demo
cd cyclecloud-demo ./install.sh
-
Activate the virtual environment:
. ~/.virtualenvs/autoscale_demo/bin/activate
-
Edit
demo.py
to set your local CycleCloud configurationCC_CONFIG = { "url": "https://localhost:8443", # Or your CC URL "username": "USER", "password": "PASS", "verify_certificates": False }
-
Optionally, change the cluster configuration parameters:
BASE_CLUSTER_PARAMS = { "Credentials" : "azure", # Or your CC account name "AzccMachineTypes" : ["Standard_F72S_v2", "Standard_D2_v3"], "SubnetId" : "SUBNET_ID", "ImageName" : "cycle.image.centos7", "UseLowPrio" : False, "Region" : "REGION" }
-
Start the demo:
python3 ./demo.py
The demo should create a cluster named "apiTest" and begin scaling it up.
In the console, the demo should show your subscription's current quotas modified by limits imposed
by the NodeArrays in the cluster. That information is used to provide the autoscaler the current
AvailableCoreCount
and AvailableCount
(VM instances) in your subscription for each VM SKU.
The autoscaler uses that information to decide which SKU to scale up.