Skip to content

Repository files navigation

Panorama: Unveiling Latent Dependencies for Microservice Autoscaling via Meta-learning

This repository contains a prototyped version of Panorama described in our paper "Panorama: Unveiling Latent Dependencies for Microservice Autoscaling via Meta-learning"

Requirements

Python

  • Python 3.6
  • pip3 install -r requirements.txt

Setup Docker

Docker 24.0.5

Setup Kubernetes Cluster

A running Kubernetes cluster is required before Panorama working, for set-up instructions, refer to this.

Setup Prometheus

Prometheus is an open-source monitoring and alerting toolkit used for collecting and storing metrics from various systems. For detailed installation steps, please refer to this.

Setup Istio

Istio is an open-source service mesh platform that enhances the management and security of microservices in a distributed application. After having a cluster running a supported version of Kubernetes, installing Istio is needed. Follow these steps to get started with Istio.

Setup Jaeger

We use Jaeger to collect traces, which involves establishing an invocation relationship among microservices through automated processes. Follow these steps to get started with Jaeger.

Setup Locust

We utilize the Locust load testing tool, an open-source tool that employs Python code to generate workload.

Deploy Benchmark and Workload Generation

Deploy the Train-Ticket system on K8S with istio.

cd ./benchmark/train-ticket
./deploy.sh

The generated workload intensity is

cd ./workload_generation
locust -f ./load_generator_train.py --headless > ./logs/trainticket.log 2>&1

Tip

⚠️ When starting the Locust script, make sure to update the data collection time in collect_RIDs.py and start RID collection at the same time.

Train and Test

Configuration

The information that needs to be configured before metric fetching is stored in metric_fetch.json, and the training related information is stored in dataset_config.json and model.json.

Prepare Data

Run this code, and the metrics will be stored in the folder location you have set.

cd ./metric_fetch
python3 metrics_fetch.py

Transform the raw dataset into a time-sliced dataset for model training and learning.

cd ./dataset
python3 data_process.py

Dependencies Extract

DID, we can send a http request to Jaeger and save the response to a json file, the request api is http:///api/dependencies, or we can do it in the code. Then we can run the code to generate DID matrix.

cd ./dependencies_extract/DID
python3 DIDs.py

EBD, we first extract the call order of all services use python3 TrainTicket_call_order.py and save it to json file

cd ./dependencies_extract/EBD
python3 TrainTicket_call_order.py
python3 EBDs.py

RID, we run the code at the beginning of workload generation

cd ./dependencies_extract/RID
python3 collect_RIDs.py

Train Model

python3 train_model.py

Evaluate

Replace the workload intensity the locust use in load_generator_train.py. Utilizing well-trained and tested models to enable automatic scaling of various microservices, the configuration is stored in autoscaling.json.

python3 autoscaling.py

Collect the metric during autoscaling phase and calculate the average response time and pod count.

python3 evaluate_avg.py

About

The implementation and data of our ASE '26 paper "Panorama: Unveiling Latent Dependencies for Microservice Autoscaling via Meta-learning"

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages