# Towards Container-layer-aware Scheduling Policies for Serverless-based Edge-Cloud Continuum

Anderson Andrei Da Silva, Yiannis Georgiou, Michael Mercier, Grégory

Mounié, Denis Trystram

► To cite this version:

Anderson Andrei Da Silva, Yiannis Georgiou, Michael Mercier, Grégory Mounié, Denis Trystram. Towards Container-layer-aware Scheduling Policies for Serverless-based Edge-Cloud Continuum. De-vConf.CZ 2023, Jun 2023, Brno, Czech Republic. hal-04244617

HAL Id: hal-04244617

https://inria.hal.science/hal-04244617

Submitted on 16 Oct 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Towards Container-layer-aware Scheduling Policies for Serverless-based Edge-Cloud Continuum

DevConfcz2023

Anderson Andrei Da Silva¹, ², Y. Georgiou², M. Mercier², G. Mounié¹, D. Trystram¹.

¹Université Grenoble Alpes, ²Ryax Technologies

Contact: anderson-andrei.da-silva@inria.fr, silva.andersonandrei@gmail.com

https://andersonandrei.github.io/

16-18 of Jun of 2023

UGA
Université
Grenoble Alpes

<figure><img src="image_2.png" /></figure>

ryax
technologies

<figure><img src="image_3.png" /></figure>

MIA
Grenoble Alpes

<figure><img src="image_4.png" /></figure>

PHYSICS
<figure><img src="image_5.png" /></figure>

PHYSICS

## Project Goals

* Visual programming environment to create serverless workflows with reusable patterns and increased semantics

### OPTIMIZED HYBRID SPACE-TIME SERVICE CONTINUUM IN FaaS

<figure><img src="image_6.png" /></figure>

* Platform-level functionalities to orchestrate and deploy FaaS workflows and optimize cloud/edge interplay

* Provider-local resource management mechanisms to offer competitive and optimized services execution

14/11/2022

<figure><img src="image_7.png" /></figure>

This project has received funding from the European Union's horizon 2020 research and innovation programme under grant agreement no 101017047

<figure><img src="image_8.png" /></figure>

8
# PHYSICS Talks at DevConf

Friday, June 16 • 2:15pm - 3:35pm

<figure><img src="image_9.png" /></figure>

Writing a K8s Operator for Knative Functions

Click here to remove from My Schedule.

<figure><img src="image_10.png" /></figure>

https://sched.co/1Myp

<figure><img src="image_11.png" /></figure>

Twitter

<figure><img src="image_12.png" /></figure>

Share

<figure><img src="image_13.png" /></figure>

Feedback Submitted

Serverless and Function as a Service (FaaS) are getting more and more attention from customers and developers as a way to develop, run and manage applications functionality without the burden of infrastructure related knowledge. All big cloud providers offer them already, e.g., AWS Lambda, Google Cloud Functions or Microsoft Azure Functions. One of the most relevant upstream projects for serverless is Knative, which recently added support for functions (create, build, and deploy) on top of K8s clusters.

This workshop will introduce you to the FaaS model, as well as to building Kubernetes operators. You will implement a K8s Operator, using the operatorsdk framework, to provide the functionality of the Knative CLI. This will allow to easier create, build and deploy functions with Knative just by creating Kubernetes (CR) objects, and will help you learning the internals about how K8s Operators work in a real life example.

## Speakers

<figure><img src="image_14.png" /><figcaption>Luis Tomas Bolivar
Red Hat</figcaption></figure>

<figure><img src="image_15.png" /><figcaption>Jose Castillo Lema
Senior Software Engineer, Red Hat</figcaption></figure>
# PHYSICS Talks at DevConf

Sunday, June 18 • 2:45pm - 3:20pm

<figure><img src="image_16.png" /></figure>

Design & Deployment of FaaS apps at the edge-cloud

Click here to remove from My Schedule.

<figure><img src="image_17.png" /></figure>

https://sched.co/1MMi

<figure><img src="image_18.png" /></figure>

Twitter

<figure><img src="image_19.png" /></figure>

Share

The talk will focus on a design and development environment coming from the H2020 PHYSICS project, that aims to ease application evolution to the new FaaS model. It uses the Node-RED open source tool as the main function and workflow runtime. The goal of the environment is to enable a more user friendly and abstract function and workflow creation process for complex FaaS applications. To this end, it provides an extendable, pattern-enriched palette of ready-made, reusable functionalities such as workload parallelization, data collection at the edge, function orchestration creation among others. The environment embeds seamless DevOps processes for generating the deployable artefacts of the FaaS platform (OpenWhisk). Annotation mechanisms are also available for the developer to dictate diverse execution options towards the deployment stacks, including sizing and locality considerations, as well as abilities for dynamic FaaS applications to continuously leverage the edge-cloud continuum.

## Speakers

<figure><img src="image_20.png" /><figcaption>Yiannis Georgiou</figcaption></figure>
## Edge-Cloud Continuum
### Infrastructure Level

<figure><img src="image_21.png" /></figure>

Cloud clusters

Edge clusters
or Fog

Edge
resources

Legend

Edge-Cloud Infrastructure Connections

Edge Resource Moving Connections
User's environment view

<figure><img src="image_22.png" /><figcaption>Figure 2: From the cloud to the serverless - step 1.</figcaption></figure>
User's environment view

<figure><img src="image_23.png" /></figure>

<figure><img src="image_24.png" /><figcaption>Figure 3: From the cloud to the serverless - step 2.</figcaption></figure>
User's environment view

<figure><img src="image_25.png" /></figure>

Developer

<figure><img src="image_26.png" /></figure>

Functions

<figure><img src="image_27.png" /></figure>

Code

<figure><img src="image_28.png" /></figure>

Few
Settings

D. Scientists

Physicists

...

<figure><img src="image_29.png" /></figure>

Platform Provider's View

Scheduler

<figure><img src="image_30.png" /></figure>

<figure><img src="image_31.png" /></figure>

Functions Execution Time

<figure><img src="image_32.png" /></figure>

<figure><img src="image_33.png" /></figure>

<figure><img src="image_34.png" /></figure>

<figure><img src="image_35.png" /></figure>

<figure><img src="image_36.png" /></figure>

Edge-Cloud Continuum
Infrastructure Level

Cloud clusters

<figure><img src="image_37.png" /></figure>

Scheduling Objective

Edge clusters
or Fog

Edge resources
# Towards a Multi-objective Scheduling Policy for Serverless-based Edge-Cloud Continuum

## Towards a Multi-objective Scheduling Policy for Serverless-based Edge-Cloud Continuum

The 23rd IEEE/ACM International Symposium on Cluster, Cloud and Internet Computing
Bangalore, India — May 1-4, 2023

L. Angelelli¹, Anderson Andrei Da Silva¹, ², Y. Georgiou²,
M. Mercier², G. Mounié¹, D. Trystram¹.

¹Université Grenoble Alpes, ²Ryax Technologies

<figure><img src="image_38.png" /></figure>

Reproducible
Artifacts

https://andersonandrei.github.io/

https://gitlab.com/andersonandrei/foa-a-multi-objective-scheduling-policy-for-serverless

Thanks to the Intelligence of the Multi-disciplinary Institute on Artificial Intelligence MIAI at Grenoble Alpes (ANR-19-P3IA-0003),
to the European Union's Project H2020 PHYSICS (GA 101017047), and to the Grid'5000 testbed (https://www.grid5000.fr).

UGA

Université
Grenoble Alpes

<figure><img src="image_39.png" /></figure>

ryax
technologies

<figure><img src="image_40.png" /></figure>

MIAI

Grenoble Alpes

<figure><img src="image_41.png" /></figure>

PHYSICS
* Presents an evolution in the sense of use of containers,

* However, containers' deployment time is not negligible,

* Nevertheless, container can share layers.

* Figure of Layers
Motivation 1 and a multi-objective approach

<figure><img src="image_42.png" /></figure>
# FOA: Function Orchestration Algorithm

<figure><img src="image_43.png" /></figure>
# FOA: Function Orchestration Algorithm

<figure><img src="image_44.png" /></figure>

The *Minimum Cost Integral Matching* phase uses the Dual-Approx. Algorithm of Shmoys and Tardos [D. B. Shmoys and E. Tardos, "An approximation algorithm for the generalized assignment problem," Math. Program., vol. 62, no. 1-3, p.461-474, Feb. 1993].
* Adaptation of the benchmark FunctionBench <fnref n="1" />,

* Deployment of OpenWhisk <fnref n="2" /> on GRID5000 <fnref n="3" />,

* Measurement and calibration of results.

* Evaluation of scheduling policies FOA, K8S ImageLocality (baseline):

* In a simulated environment,

* On top of Batsim/ Simgrid [H.Casanova et.al, 2014].

<footnote n="1">¹ https://github.com/kmu-bigdata/serverless-faas-workbench ,</footnote>

<footnote n="2">² https://openwhisk.apache.org/,</footnote>

<footnote n="3">³ https://www.grid5000.fr .</footnote>
<table><caption>Table 1 Design of Experiments. Total of 1620 experiments.</caption><thead><tr><td>Parameters</td><td>Values</td></tr></thead><tbody><tr><td>Workload Size</td><td>200, 600, 1000</td></tr><tr><td>Platform Size</td><td>100, 300, 500</td></tr><tr><td>Heterogeneity Level</td><td>3, 5, 7</td></tr><tr><td>Scheduling Policies</td><td>FOA, <i>K8S ImageLocality</i></td></tr><tr><td>Random Seeds</td><td>30</td></tr></tbody></table>
<table><caption>Table 1 Design of Experiments. Total of 1620 experiments.</caption><thead><tr><td>Parameters</td><td>Values</td></tr></thead><tbody><tr><td>Workload Size</td><td>200, 600, 1000</td></tr><tr><td>Platform Size</td><td>100, 300, 500</td></tr><tr><td>Heterogeneity Level</td><td>3, 5, 7</td></tr><tr><td>Scheduling Policies</td><td>FOA, K8S ImageLocality</td></tr><tr><td>Random Seeds</td><td>30</td></tr></tbody></table>

<table><caption>Table 2: Functions adapted from FunctionBench.</caption><thead><tr><td>Function</td><td>Input Values</td><td>Unit</td></tr></thead><tbody><tr><td>Chameleon</td><td>2.10<sup>3</sup>, 3.10<sup>3</sup></td><td>Matrix size</td></tr><tr><td>Float operation</td><td>10.10<sup>7</sup>, 20.10<sup>7</sup>, 30.10<sup>7</sup></td><td>Operations</td></tr><tr><td>Image processing</td><td>60, 40</td><td>Image size in MB</td></tr><tr><td>Linpack</td><td>5.10<sup>3</sup>, 6.10<sup>3</sup></td><td>Matrix size</td></tr><tr><td>Matrix Multiplication</td><td>3.10<sup>3</sup>, 4.10<sup>3</sup></td><td>Matrix size</td></tr><tr><td>Model Training</td><td>50, 100</td><td>Dataset size</td></tr><tr><td>Pyaes</td><td>3.10<sup>3</sup>, 4.10<sup>3</sup>, 5.10<sup>3</sup></td><td>Length of message</td></tr><tr><td>Video Processing</td><td>30, 50, 100</td><td>Video size in MB</td></tr></tbody></table>
<figure><img src="image_45.png" /></figure>
<figure><img src="image_46.png" /></figure>

<figure><img src="image_47.png" /></figure>
Experimental results: Linear program trade-off

<figure><img src="image_48.png" /><figcaption>Makespan (Minutes)</figcaption></figure>

<figure><img src="image_49.png" /><figcaption>LP Binary Search Iteration</figcaption></figure>
Experimental results: Amount of data downloaded

<figure><img src="image_50.png" /></figure>
Experimental results: Number of machines used

<figure><img src="image_51.png" /></figure>
* Cloud greedy algorithms may not profit from heterogeneity.
* Cloud greedy algorithms may not profit from heterogeneity.

* FOA outperforms our baseline for both data transfers and makespan criteria, in addition to the system utilization by up to two orders of magnitudes.
* Cloud greedy algorithms may not profit from heterogeneity.

* FOA outperforms our baseline for both data transfers and makespan criteria, in addition to the system utilization by up to two orders of magnitudes.

* FOA minimizes cold start delays and speed up functions' execution time.
* Cloud greedy algorithms may not profit from heterogeneity.

* FOA outperforms our baseline for both data transfers and makespan criteria, in addition to the system utilization by up to two orders of magnitudes.

* FOA minimizes cold start delays and speed up functions' execution time.

* However, FOA is very time-consuming.
Motivation 2 = Motivation 1 + Energy Consumption

<figure><img src="image_52.png" /></figure>

Legend

Edge-Cloud Infrastructure Connections

Edge Resource Moving Connections
Motivation 2 = Motivation 1 + Energy Consumption

<figure><img src="image_53.png" /></figure>
# Energy Consumption on Serverless Platforms - Kepler

<figure><img src="image_54.png" /></figure>

<figure><img src="image_55.png" /></figure>
Energy Consumption on Serverless Platforms

<figure><img src="image_56.png" /></figure>

<figure><img src="image_57.png" /></figure>
Energy Consumption on Serverless Platforms

<figure><img src="image_58.png" /></figure>

Function — Inpack_5000 — Inpack_6000

<figure><img src="image_59.png" /></figure>

Function — chameleon_2000 — chameleon_4000
Experimental results: Amount of data downloaded

<figure><img src="image_60.png" /></figure>

Scheduling Policy ☐ FCFS + ImageLocality ☐ FOA-e
Experimental results: Number of machines used

<figure><img src="image_61.png" /></figure>

Scheduling Policy 🐶 FCFS + ImageLocality 🐶 FOA-e
Experimental results: Energy Consumption

<figure><img src="image_62.png" /></figure>

Scheduling Policy ⌧ FCFS + ImageLocality ⌧ FOA-e
* Cloud greedy algorithms may not profit from heterogeneity.
* Cloud greedy algorithms may not profit from heterogeneity.

* FOA-e outperforms our baseline for both data transfers and energy consumption criteria, in addition to the system utilization.
* Cloud greedy algorithms may not profit from heterogeneity.

* FOA-e outperforms our baseline for both data transfers and energy consumption criteria, in addition to the system utilization.

* FOA-e minimizes cold start delays and speed up functions' execution time,
* Cloud greedy algorithms may not profit from heterogeneity.

* FOA-e outperforms our baseline for both data transfers and energy consumption criteria, in addition to the system utilization.

* FOA-e minimizes cold start delays and speed up functions' execution time,

* FOA-e has a scheduling time in order of seconds.
* To improve FOA's **model** and try other linear programs' **solvers**,
* To improve FOA's **model** and try other linear programs' **solvers**,

* To study applications that can be modeled as **workflows** of serverless functions,
* To improve FOA's **model** and try other linear programs' **solvers**,

* To study applications that can be modeled as **workflows** of serverless functions,

* To include and use **Kepler** for a continuous measurement of the energy consumption,
* To improve FOA's **model** and try other linear programs' **solvers**,

* To study applications that can be modeled as **workflows** of serverless functions,

* To include and use **Kepler** for a continuous measurement of the energy consumption,

* To continue the investigations towards the reduction of energy consumption on serverless,
* To improve FOA's **model** and try other linear programs' **solvers**,

* To study applications that can be modeled as **workflows** of serverless functions,

* To include and use Kepler for a continuous measurement of the energy consumption,

* To continue the investigations towards the reduction of energy consumption on serverless,

* To add both schedulers in the PHYSICS platforms.
Towards a Multi-objective Scheduling Policy for
Serverless-based Edge-Cloud Continuum

The 23rd IEEE/ACM International Symposium on Cluster,
Cloud and Internet Computing
Bangalore, India — May 1-4, 2023

L. Angelelli¹, Anderson Andrei Da Silva¹ ², Y. Georgiou²,

M. Mercier², G. Mounié¹, D. Trystram¹.

¹Université Grenoble Alpes, ²Ryax Technologies

<figure><img src="image_63.png" /></figure>

Reproducible
Artifacts

https://andersonandrei.github.io/

https://gitlab.com/andersonandrei/foa-a-multi-objective-scheduling-policy-for-serverless

Thanks to the Intelligence of the Multi-disciplinary Institute on Artificial Intelligence MIAI at Grenoble Alpes (ANR-19-P3IA-0003),
to the European Union's Project H2020 PHYSICS (GA 101017047), and to the Grid'5000 testbed (https://www.grid5000.fr).

UGA
Université

Grenoble Alpes

<figure><img src="image_64.png" /></figure>

ryax
technologies

<figure><img src="image_65.png" /></figure>

MIAI
Grenoble Alpes

<figure><img src="image_66.png" /></figure>

PHYSICS
Experimental results: makespan

<figure><img src="image_67.png" /></figure>

Scheduling Policy ─── K8S ImageLocality ─── FOA
<table><thead><tr><td>Notation</td><td>Description</td></tr></thead><tbody><tr><td>M</td><td>Number of machines</td></tr><tr><td>N</td><td>Number of scheduled functions</td></tr><tr><td>K</td><td>Number of container environments</td></tr><tr><td>c<sub>ij</sub></td><td>Cost of the j-th function on the i-th machine</td></tr><tr><td>p<sub>ij</sub></td><td>Execution time of the j-th function on the i-th machine</td></tr><tr><td>d<sub>ik</sub></td><td>Cost of the k-th environment on the i-th machine</td></tr><tr><td>b<sub>ik</sub></td><td>Execution time of the k-th environment on i-th machine</td></tr><tr><td>env[j]</td><td>Environment id of the j-th function</td></tr><tr><td>x<sub>ij</sub></td><td>Placement of the j-th function on the i-th machine</td></tr><tr><td>e<sub>ik</sub></td><td>Placement of the k-th environment on the i-th machine</td></tr></tbody></table>

**Assumptions:**

1) Functions and environments are independent and known in advance;

2) Their cost and processing time on each machine are known;

3) The dependency between functions and environments is known.

<caption>Table 1: FOA's list of notation and descriptions.</caption>
The Linear Program minimizes the cost under a makespan constraint of value T

$$ \text{Min} \sum_{i=1}^{M} \sum_{j=1}^{N} c_{ij} \times x_{ij} + \sum_{i=1}^{M} \sum_{k=1}^{K} d_{ik} \times e_{ik} \quad (1) $$

$$ \forall i \le M, \quad \sum_{j=1}^{N} p_{ij} \times x_{ij} + \sum_{k=1}^{K} b_{ik} \times e_{ik} \le T \quad (2) $$

$$ \forall j \le N, \quad \sum_{i=1}^{M} x_{ij} \ge 1 \quad (3) $$

$$ \forall i \le M, \forall j \le N, \quad x_{ij} \le e_{i,\text{env}[j]} \quad (4) $$

$$ \forall i \le M, \forall k \le K, \quad \sum_{j=1}^{N} x[i][j] \le N_{ik} \times e[i][k] \quad (5) $$

$$ \forall i \le M, \forall k \le K, \quad e_{ik} \le 1 \quad (6) $$
Exp. results: System utilization and makespan

<figure><img src="image_68.png" /><figcaption>Figure 10: The makespan (y-axis) against the number of machines used (x-axis).</figcaption></figure>
Exp. results: System utilization and data transfers

<figure><img src="image_69.png" /><figcaption>Figure 11: The amount of data downloaded (y-axis) against the number of machines used (x-axis).</figcaption></figure>