Skip to content

Commit 1e0cf15

Browse files
committed
Release 0.4.0
- Security patches. - Dependency Updates. - Versions bump for K8s 1.33 and Go 1.24. - Added power & energy actuator. - Refactored RDT actuator. - Tweaks to vertical and horizontal actuators. - Changes to CRDs to support tolerances & active management. - Reworked logging capabilities. Co-authored-by: tmetsch tmetsch@users.noreply.github.com Co-authored-by: togashidm togashidm@users.noreply.github.com Co-authored-by: ddib ddib@users.noreply.github.com Co-authored-by: davecremins davecremins@users.noreply.github.com
1 parent 9f37fe0 commit 1e0cf15

File tree

88 files changed

+5378
-1188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+5378
-1188
lines changed

.github/workflows/test-build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
uses: actions/setup-go@v5
3030
with:
3131
go-version-file: 'go.mod'
32+
- name: List open ports and processes
33+
run: sudo lsof -i -P -n | grep LISTEN
3234
- name: Unit test
3335
run: make utest
3436
race:
@@ -42,4 +44,4 @@ jobs:
4244
with:
4345
go-version-file: 'go.mod'
4446
- name: Test race
45-
run: go test -count=1 -parallel 1 -race ./...
47+
run: go test -count=1 -parallel 1 -race -skip 'TestTracesForSanity/rdt_trace|TestPowerForSanity/power_efficiency' ./...

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2022 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33

4-
FROM golang:1.24.2 AS build
4+
FROM golang:1.24.6 AS build
55

66
WORKDIR /app
77

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ SCALEOUT_PLUGIN=scale_out
33
RMPOD_PLUGIN=rm_pod
44
RDT_PLUGIN=rdt
55
CPU_PLUGIN=cpu_scale
6+
ENERGY_PLUGIN=energy
67
GO_CILINT_CHECKERS=errcheck,goimports,gosec,gosimple,govet,ineffassign,nilerr,revive,staticcheck,unused
7-
DOCKER_IMAGE_VERSION=0.3.0
8+
DOCKER_IMAGE_VERSION=0.4.0
89

910
api:
1011
hack/generate_code.sh
@@ -32,7 +33,10 @@ build-plugin-rdt:
3233
build-plugin-cpu:
3334
CGO_ENABLED=0 go build -o bin/plugins/${CPU_PLUGIN} plugins/${CPU_PLUGIN}/cmd/${CPU_PLUGIN}.go
3435

35-
build-plugins: build-plugin-scaleout build-plugin-rmpod build-plugin-rdt build-plugin-cpu
36+
build-plugin-energy:
37+
CGO_ENABLED=0 go build -o bin/plugins/${ENERGY_PLUGIN} plugins/${ENERGY_PLUGIN}/cmd/${ENERGY_PLUGIN}.go
38+
39+
build-plugins: build-plugin-scaleout build-plugin-rmpod build-plugin-rdt build-plugin-cpu build-plugin-energy
3640

3741
controller-images:
3842
docker build -t planner:${DOCKER_IMAGE_VERSION} . --no-cache --pull
@@ -42,6 +46,7 @@ plugin-images:
4246
docker build -t rmpod:${DOCKER_IMAGE_VERSION} -f plugins/rm_pod/Dockerfile . --no-cache --pull
4347
docker build -t rdt:${DOCKER_IMAGE_VERSION} -f plugins/rdt/Dockerfile . --no-cache --pull
4448
docker build -t cpuscale:${DOCKER_IMAGE_VERSION} -f plugins/cpu_scale/Dockerfile . --no-cache --pull
49+
docker build -t energy:${DOCKER_IMAGE_VERSION} -f plugins/energy/Dockerfile . --no-cache --pull
4550

4651
all-images: controller-images plugin-images
4752

@@ -57,7 +62,8 @@ prepare-build:
5762
go mod tidy
5863

5964
utest:
60-
go test -count=1 -parallel 1 -v ./...
65+
# Skipping certain trace tests, as they cannot be run safely on public runners.
66+
go test -count=1 -parallel 1 -v -skip 'TestTracesForSanity/rdt_trace|TestPowerForSanity/power_efficiency' ./...
6167

6268
test:
6369
hack/run_test.sh

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11

2-
32
# Intent Driven Orchestration Planner
43

54
![planner.png](planner.png)

artefacts/deploy/manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ spec:
199199
serviceAccountName: planner-service-account
200200
containers:
201201
- name: planner
202-
image: 127.0.0.1:5000/planner:0.3.0
202+
image: 127.0.0.1:5000/planner:0.4.0
203203
ports:
204204
- containerPort: 33333
205205
imagePullPolicy: Always

artefacts/examples/default_profiles.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,37 @@ metadata:
55
name: p50latency
66
spec:
77
type: "latency"
8-
description: "Measures P50 latency in ms over a 30ms time window as reported by Linkerd service mesh."
8+
description: "Measures P50 latency in ms over a 30s time window as reported by Linkerd service mesh."
99
---
1010
apiVersion: "ido.intel.com/v1alpha1"
1111
kind: KPIProfile
1212
metadata:
1313
name: p95latency
1414
spec:
1515
type: "latency"
16-
description: "Measures P95 latency in ms over a 30ms time window as reported by Linkerd service mesh."
16+
description: "Measures P95 latency in ms over a 30s time window as reported by Linkerd service mesh."
1717
---
1818
apiVersion: "ido.intel.com/v1alpha1"
1919
kind: KPIProfile
2020
metadata:
2121
name: p99latency
2222
spec:
2323
type: "latency"
24-
description: "Measures P99 latency in ms over a 30ms time window as reported by Linkerd service mesh."
24+
description: "Measures P99 latency in ms over a 30s time window as reported by Linkerd service mesh."
2525
---
2626
apiVersion: "ido.intel.com/v1alpha1"
2727
kind: KPIProfile
2828
metadata:
2929
name: throughput
3030
spec:
3131
type: "throughput"
32-
description: "Measures requests per second aggregated over a 30ms time window as reported by Linkerd service mesh."
32+
minimize: False
33+
description: "Measures requests per second aggregated over a 30s time window as reported by Linkerd service mesh."
3334
---
3435
apiVersion: "ido.intel.com/v1alpha1"
3536
kind: KPIProfile
3637
metadata:
3738
name: availability
3839
spec:
39-
type: "availability"
40+
type: "availability"
41+
minimize: False

artefacts/examples/example_deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
spec:
1717
containers:
1818
- name: sample-function
19-
image: testfunction/rust_function:0.1
19+
image: testfunction/rust_function:0.2
2020
ports:
2121
- containerPort: 8080
2222
env:

artefacts/intents_crds_v1alpha1.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
type: object
2121
properties:
2222
kind:
23-
description: 'Kind of the owner.'
23+
description: 'Kind of the owner (defaults to Deployment kind).'
2424
type: string
2525
enum:
2626
- Deployment
@@ -33,11 +33,15 @@ spec:
3333
- name
3434
priority:
3535
type: number
36-
description: "Priority for a set of PODs"
36+
description: "Priority for a set of PODs (defaults to 0.01)."
3737
format: float
3838
minimum: 0.01 # prevents any div 0!
3939
maximum: 1.0
4040
default: 0.01
41+
active:
42+
type: boolean
43+
description: "Indicates if the planner should actively managed this intent (defaults to true)."
44+
default: true
4145
objectives:
4246
type: array
4347
description: "Objectives for a set of PODs."
@@ -54,6 +58,12 @@ spec:
5458
measuredBy:
5559
type: string
5660
description: "Defines what kind of an objective this is. Also defines if the objective is an upper or lower bound objective."
61+
tolerance:
62+
type: number
63+
description: "Indicates a tolerance as percentage in context of the specified target value for the objective (defaults to 0.0) - e.g. 0.1 & target 10ms ==> 11ms."
64+
format: float
65+
minimum: 0.0
66+
default: 0.0
5767
required:
5868
- name
5969
- value
@@ -108,13 +118,16 @@ spec:
108118
spec:
109119
type: object
110120
properties:
111-
# TODO: add weight.
112121
query:
113122
type: string
114123
description: "This is an optional parameter - if defined, the user needs to provide a query string defining how to capture the objective's KPI. Optional parameters - in accordance with the provide documentation - can be detailed under props."
115124
description:
116125
type: string
117126
description: "Ideally includes a description on what is measured by the query - including e.g. information on units etc."
127+
minimize:
128+
type: boolean
129+
description: "Indicates whether the planner should try to minimize this or not (defaults to true)."
130+
default: true
118131
type:
119132
type: string
120133
description: "Defines the type of the KPI."

cmd/main.go

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package main
22

33
import (
44
"flag"
5+
"io"
6+
"os"
57
"time"
68

79
"github.com/intel/intent-driven-orchestration/pkg/controller"
@@ -38,7 +40,32 @@ func main() {
3840
}
3941
cfg, err := common.ParseConfig(config)
4042
if err != nil {
41-
klog.Fatalf("Error loading planner config: %s", err)
43+
klog.Fatalf("Error loading planner config: %v", err)
44+
}
45+
46+
// set logFile
47+
if cfg.Generic.LogFile != "" {
48+
err := flag.Set("logtostderr", "false")
49+
if err != nil {
50+
klog.Fatalf("Error setting flag logtostderr: %v", err)
51+
}
52+
err = flag.Set("alsologtostderr", "true")
53+
if err != nil {
54+
klog.Fatalf("Error setting flag alsologtostderr: %v", err)
55+
}
56+
57+
logFile, err := os.OpenFile(cfg.Generic.LogFile, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0600)
58+
if err != nil {
59+
klog.Fatalf("Failed to open log file: %v", err)
60+
}
61+
defer logFile.Close()
62+
63+
multiWriter := io.MultiWriter(os.Stdout, logFile)
64+
klog.SetOutput(multiWriter)
65+
defer func() {
66+
klog.Flush()
67+
}()
68+
klog.Infof("Successfuly added to klog output the log file: %s", cfg.Generic.LogFile)
4269
}
4370

4471
// K8s genClient setup
@@ -65,7 +92,7 @@ func main() {
6592
planner := astar.NewAPlanner(actuatorList, cfg)
6693
defer planner.Stop()
6794

68-
// This is main controller.
95+
// This is the main controller.
6996
tracer := controller.NewMongoTracer(cfg.Generic.MongoEndpoint)
7097
c := controller.NewController(cfg, tracer, k8sClient, podInformerFactory.Core().V1().Pods())
7198
c.SetPlanner(planner)

docs/actuators.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ functions in the next section to better understand how the system selects what t
6868
Furthermore, the implementation of ***NextState()*** can support the opportunistic planning capabilities, by adding new
6969
states, that although they do not satisfy the desired still at least move the system in the right direction.
7070

71+
Note that the parameters of the actions are defined by **interface{}**. Ideally a map is used to represent the
72+
parameters. For example, they can be represented as a _map[string]int64_ or _map[string]string_. Other
73+
types of values in the map will be cast to string to support the GRPC plugin mechanism.
74+
7175
#### Utility/Cost functions
7276

7377
Utilities are used to steer the planner. Planners will deem an action to be favorable if the actuator returns a low

0 commit comments

Comments
 (0)