Code repository with modifications to kubernetes (k8s) to use it for LEO compute cloud.
Currently, to run Krios, you need at least 6 ubuntu nodes that can all talk to each other. Amongst these nodes, one node will be Krios orchestrator, one will be the client and the rest will be Krios satellite nodes.
-
Recursively pull the emulator submodule:
git submodule update --init --recursive
-
Install Go, Docker, Kubernetes, python3, and pip from the official sources. This needs to be done on all the nodes. If you are using CloudLab nodes, you can use this script to install all the necessary software on all the CloudLab nodes.
-
Install all the Python requirements listed in
requirements.txt. This needs to be done on the orchestrator and client:pip install -r requirements.txt
-
Create an
ip_mapping.jsonfile that maps each node's fully-qualified hostname to its IP address. Place this file in thekrios-emulatordirectory (wherekrios_setup.pyis run from). The format is:{ "node1.user-123.project.utah.cloudlab.us": "128.110.218.50", "node2.user-123.project.utah.cloudlab.us": "128.110.218.53", ... }Hostnames must contain a numeric index (e.g.
node1,node2) as the setup script uses these indices to assign control and worker roles.Both
krios_setup.pyandscript-main.pywill load fromip_mapping.jsonwhen it is present. If the file is not found,script-main.pyfalls back to parsing a CloudLabmanifest.xmlviacloudlab_fetch_ip_mapping().
The krios_setup.py script in krios-emulator automates cluster initialization, Krios component deployment, emulator launch, and latency measurement.
-
cdinto thekrios-emulatordirectory and ensureip_mapping.jsonis present there. -
Run the setup script with a scenario and a base node index. The base index selects the control node; workers are assigned to the subsequent indices:
cd krios-emulator python krios_setup.py <scenario> <base_node_idx>
Available scenarios:
sf_4workers— San Francisco (37.7749, -122.4194), 4 workersseattle_4workers— Seattle (47.6062, -122.3321), 4 workerstokyo_6workers— Tokyo (35.6762, 139.6503), 6 workers
For example,
python krios_setup.py sf_4workers 1uses node1 as the control node and node2–node5 as workers. -
The script will:
- Reset and initialize the Kubernetes cluster via kubeadm on the control node
- Join all worker nodes to the cluster
- Install the Calico CNI
- Deploy the Krios scheduler, Krios controller, and nginx service from the
yamlsdirectory - Deploy an nginx test pod with the scenario's location as the
leozonelabel
Note: The Krios scheduler and controller require worker nodes to have a
sat_idlabel (set by the emulator). They will be inCrashLoopBackOffuntil the emulator runs and assigns satellite IDs. Use--run-emulatorto start the emulator after setup, which will label the nodes and allow the scheduler/controller to recover automatically. -
Optional flags:
--reuse-cluster— skip cluster creation and reuse an existing cluster (validates that all expected nodes are Ready)--skip-deploy— skip deploying Krios components (useful if they are already running)--run-emulator— launch the satellite emulator (script-main.py) after setup--emulator-time SEC— emulator experiment duration in seconds (default: 60)--measure— run scheduling/deployment/deletion latency benchmarks after setup--latency-ms MS— inject a single latency value in ms for measurement (requires--measure)--samples-per-latency N— number of samples per latency value (default: 10)
Example with emulator and measurements:
python krios_setup.py sf_4workers 1 --run-emulator --emulator-time 120 --measure
- On the client node (alphabetically the last node), run the client script using
python script-client.pyfrom thekrios-emulatordirectory. - On the orchestrator node (alphabetically the first node), setup the cluster using kubeadm and install a CNI.
- Deploy the Krios scheduler and the Krios Controller from the yaml files provided in the
yamlsdirectory. - Install the nginx pod from
yamlsdirectory usingkubectl apply -f nginx_pod.yaml. Ensure that the client location specified in the client and server scripts matches the one provided in this yaml file. - Ensure
ip_mapping.jsonis present in thekrios-emulatordirectory (see Installation step 4). Bothkrios_setup.pyandscript-main.pywill use it. - On the orchestrator, run the emulator using
python script-main.py <yaml_location> <experiment_time>from thekrios-emulatordirectory. This labels worker nodes with satellite IDs, which the scheduler and controller require to function.
Post this, you should start seeing the client getting responses, and also logging the latency values.