Skip to content

Commit

Permalink
Merge pull request #3 from polaris-slo-cloud/v1-paper-adjustments
Browse files Browse the repository at this point in the history
Adjust module domain
  • Loading branch information
tommazzo89 authored Oct 17, 2022
2 parents 00ede3d + 2b43d7e commit fe4ddcb
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 47 deletions.
15 changes: 3 additions & 12 deletions go/scheduler/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
# RAINBOW Fog-aware Kubernetes Scheduler

## Node Roles

This scheduler assumes existence of the following node roles, i.e., `rainbow-h2020.eu/<role>` labels:

* `fog-node`: a fog node.
* `cloud-node`: a cloud node.

**ToDo**: Maybe we can relax this assumption to not require any fog or cloud labels?

# Polaris SLO-aware Kubernetes Scheduler

## Application Components

This scheduler relies on each pod being associated with a ServiceGraph through the labels `rainbow-h2020.eu/service-graph` and `rainbow-h2020.eu/service-graph-node`.
This scheduler relies on the ServiceGraph abstraction (see [orchestration components](../orchestration/README.md)), developed by the [RAINBOW project](https://rainbow-h2020.eu) (from which Polaris Scheduler has been forked).
Each pod needs to be associated with a ServiceGraph through the labels `rainbow-h2020.eu/service-graph` and `rainbow-h2020.eu/service-graph-node`.
Pods that do not have these labels will still be scheduled, but they cannot benefit from the optimizations brought by this scheduler.


Expand Down
6 changes: 3 additions & 3 deletions go/scheduler/build/scheduler/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ FROM golang:1.16
# Important: The Docker context's root directory is not the `go/scheduler` directory,
# but the `go` directory instead, because the scheduler depends on the orchestrator module.

WORKDIR /go/src/k8s.rainbow-h2020.eu/rainbow
WORKDIR /go/src/polaris-slo-cloud.github.io/polaris-scheduler
COPY . .

WORKDIR /go/src/k8s.rainbow-h2020.eu/rainbow/scheduler
WORKDIR /go/src/polaris-slo-cloud.github.io/polaris-scheduler/scheduler
ARG RELEASE_VERSION
RUN RELEASE_VERSION=${RELEASE_VERSION} make build-scheduler

FROM alpine:3.15

COPY ./scheduler/manifests/polaris-scheduler/default-polaris-scheduler-config.yaml /etc/polaris-scheduler/default-polaris-scheduler-config.yaml
COPY --from=0 /go/src/k8s.rainbow-h2020.eu/rainbow/scheduler/bin/polaris-scheduler /bin/polaris-scheduler
COPY --from=0 /go/src/polaris-slo-cloud.github.io/polaris-scheduler/scheduler/bin/polaris-scheduler /bin/polaris-scheduler

WORKDIR /bin
CMD ["polaris-scheduler"]
6 changes: 3 additions & 3 deletions go/scheduler/build/scheduler/Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ FROM golang:1.16
# Important: The Docker context's root directory is not the `go/scheduler` directory,
# but the `go` directory instead, because the scheduler depends on the orchestrator module.

WORKDIR /go/src/k8s.rainbow-h2020.eu/rainbow
WORKDIR /go/src/polaris-slo-cloud.github.io/polaris-scheduler
COPY . .

WORKDIR /go/src/k8s.rainbow-h2020.eu/rainbow/scheduler
WORKDIR /go/src/polaris-slo-cloud.github.io/polaris-scheduler/scheduler
ARG RELEASE_VERSION
RUN RELEASE_VERSION=${RELEASE_VERSION} make build-scheduler-debug

FROM alpine:3.15

COPY ./scheduler/manifests/polaris-scheduler/default-polaris-scheduler-config.yaml /etc/polaris-scheduler/default-polaris-scheduler-config.yaml
COPY --from=0 /go/src/k8s.rainbow-h2020.eu/rainbow/scheduler/bin/polaris-scheduler /bin/polaris-scheduler
COPY --from=0 /go/src/polaris-slo-cloud.github.io/polaris-scheduler/scheduler/bin/polaris-scheduler /bin/polaris-scheduler

WORKDIR /bin
CMD ["polaris-scheduler"]
12 changes: 6 additions & 6 deletions go/scheduler/cmd/scheduler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ import (
"k8s.rainbow-h2020.eu/rainbow/orchestration/pkg/services/regionmanager"
"k8s.rainbow-h2020.eu/rainbow/orchestration/pkg/services/servicegraphmanager"

"k8s.rainbow-h2020.eu/rainbow/scheduler/pkg/schedulerplugins/atomicdeployment"
"k8s.rainbow-h2020.eu/rainbow/scheduler/pkg/schedulerplugins/networkqos"
"k8s.rainbow-h2020.eu/rainbow/scheduler/pkg/schedulerplugins/nodecost"
"k8s.rainbow-h2020.eu/rainbow/scheduler/pkg/schedulerplugins/podspernode"
"k8s.rainbow-h2020.eu/rainbow/scheduler/pkg/schedulerplugins/servicegraph"
"k8s.rainbow-h2020.eu/rainbow/scheduler/pkg/schedulerplugins/workloadtype"
"polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/pkg/schedulerplugins/atomicdeployment"
"polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/pkg/schedulerplugins/networkqos"
"polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/pkg/schedulerplugins/nodecost"
"polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/pkg/schedulerplugins/podspernode"
"polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/pkg/schedulerplugins/servicegraph"
"polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/pkg/schedulerplugins/workloadtype"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion go/scheduler/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module k8s.rainbow-h2020.eu/rainbow/scheduler
module polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler

go 1.16

Expand Down
2 changes: 1 addition & 1 deletion go/scheduler/hack/integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ runTests() {
kube::log::status "Running integration test cases"

# TODO: make args customizable.
go test -mod=vendor k8s.rainbow-h2020.eu/rainbow/scheduler/test/integration/...
go test -mod=vendor polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/test/integration/...

cleanup
}
Expand Down
4 changes: 2 additions & 2 deletions go/scheduler/hack/unit-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ source "${SCRIPT_ROOT}/hack/lib/init.sh"

# TODO: make args customizable.
go test -mod=vendor \
k8s.rainbow-h2020.eu/rainbow/scheduler/cmd/... \
k8s.rainbow-h2020.eu/rainbow/scheduler/pkg/...
polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/cmd/... \
polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/pkg/...
2 changes: 1 addition & 1 deletion go/scheduler/internal/util/cycle_state_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package util
import (
"k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.rainbow-h2020.eu/rainbow/orchestration/pkg/services/servicegraphmanager"
"k8s.rainbow-h2020.eu/rainbow/scheduler/internal/schedulerstate"
"polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/internal/schedulerstate"
)

// Gets the ServiceGraphState of the specified pod's application from the CycleState.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"k8s.rainbow-h2020.eu/rainbow/orchestration/pkg/kubeutil"
"k8s.rainbow-h2020.eu/rainbow/orchestration/pkg/services/servicegraphmanager"
"k8s.rainbow-h2020.eu/rainbow/scheduler/internal/util"
"polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/internal/util"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"k8s.rainbow-h2020.eu/rainbow/orchestration/pkg/serviceplacement"
"k8s.rainbow-h2020.eu/rainbow/orchestration/pkg/services/regionmanager"
"k8s.rainbow-h2020.eu/rainbow/orchestration/pkg/services/servicegraphmanager"
"k8s.rainbow-h2020.eu/rainbow/scheduler/internal/util"
"polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/internal/util"
)

const (
Expand Down Expand Up @@ -97,11 +97,11 @@ func (me *NetworkQosPlugin) PreFilterExtensions() framework.PreFilterExtensions
// If the node does not meet the requirements, Filter() returns an unschedulable status.
//
// Filter() performs the following operations:
// 1. Check if the candidate K8s node's network links support the minNetworkRequirements.
// 2. FOR EACH incoming service link:
// 2.1. Compute the shortest paths (latency-wise) from all SRC nodes (see PreFilter) to the candidate K8s node.
// 2.2. Pick shortest path that meets the network QoS requirements of the Service Link. If there is none, the candidate node is not suitable.
// 2.3. If the candidate node is suitable, store the path’s highest bandwidth and latency variance values in the networkQosStateData.
// 1. Check if the candidate K8s node's network links support the minNetworkRequirements.
// 2. FOR EACH incoming service link:
// 2.1. Compute the shortest paths (latency-wise) from all SRC nodes (see PreFilter) to the candidate K8s node.
// 2.2. Pick shortest path that meets the network QoS requirements of the Service Link. If there is none, the candidate node is not suitable.
// 2.3. If the candidate node is suitable, store the path’s highest bandwidth and latency variance values in the networkQosStateData.
func (me *NetworkQosPlugin) Filter(ctx context.Context, cycleState *framework.CycleState, pod *core.Pod, candidateK8sNodeInfo *framework.NodeInfo) *framework.Status {
qosState, noSvcGraphStatus := getNetworkQosStateDataOrStatus(cycleState)
if noSvcGraphStatus != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
framework "k8s.io/kubernetes/pkg/scheduler/framework"

"k8s.rainbow-h2020.eu/rainbow/scheduler/internal/util"
"polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/internal/util"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
framework "k8s.io/kubernetes/pkg/scheduler/framework"

"k8s.rainbow-h2020.eu/rainbow/scheduler/internal/util"
"polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/internal/util"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"k8s.rainbow-h2020.eu/rainbow/orchestration/pkg/kubeutil"
"k8s.rainbow-h2020.eu/rainbow/orchestration/pkg/services/servicegraphmanager"
"k8s.rainbow-h2020.eu/rainbow/scheduler/internal/util"
"polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/internal/util"
)

const (
Expand All @@ -38,13 +38,13 @@ var (
// ServiceGraphPlugin handles all managerial operations related to the ServiceGraph.
//
// Specifically, its tasks are:
// - QueueSort: Loads the ServiceGraph CRD and sort pods according to their position in the service graph.
// - PreFilter: Store the ServiceGraphState in the CycleState.
// - PostFilter: Release the ServiceGraphState if no suitable K8s node was found.
// - Reserve: Record the selected K8s node in the ServiceGraphState.
// - Permit: Release the ServiceGraphState.
// Important: Note that the ServiceGraphPlugin should be configured as the last Permit plugin in the scheduler configuration,
// because it will release the ServiceGraphState.
// - QueueSort: Loads the ServiceGraph CRD and sort pods according to their position in the service graph.
// - PreFilter: Store the ServiceGraphState in the CycleState.
// - PostFilter: Release the ServiceGraphState if no suitable K8s node was found.
// - Reserve: Record the selected K8s node in the ServiceGraphState.
// - Permit: Release the ServiceGraphState.
// Important: Note that the ServiceGraphPlugin should be configured as the last Permit plugin in the scheduler configuration,
// because it will release the ServiceGraphState.
type ServiceGraphPlugin struct {
// The original kube-scheduler sorting plugin, which we use after our ServiceGraph node sorting.
origQueueSort *kubequeuesort.PrioritySort
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
framework "k8s.io/kubernetes/pkg/scheduler/framework"

"k8s.rainbow-h2020.eu/rainbow/scheduler/internal/util"
"polaris-slo-cloud.github.io/polaris-scheduler/v1/scheduler/internal/util"
)

const (
Expand Down

0 comments on commit fe4ddcb

Please sign in to comment.