Skip to content

Commit aeae36a

Browse files
Merge pull request #12 from kerthcet/feat/update-fungibility
Update resource fungibility plugin
2 parents 8cda059 + e3facf2 commit aeae36a

18 files changed

Lines changed: 610 additions & 312 deletions
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: CI Workflow
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
jobs:
10+
golang-ci:
11+
uses: kerthcet/github-workflow-as-kube/.github/workflows/workflow-golang-ci.yaml@v0.1.14

.github/workflows/kube-workflow-init.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ on:
55

66
jobs:
77
init:
8-
uses: kerthcet/github-workflow-as-kube/.github/workflows/workflow-as-kubernetes-init.yaml@v0.1.3
8+
uses: kerthcet/github-workflow-as-kube/.github/workflows/workflow-as-kubernetes-init.yaml@v0.1.14
99
secrets:
1010
AGENT_TOKEN: ${{ secrets.AGENT_TOKEN }}

.github/workflows/kube-workflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ on:
1616

1717
jobs:
1818
event-handler:
19-
uses: kerthcet/github-workflow-as-kube/.github/workflows/workflow-as-kubernetes.yaml@v0.1.3
19+
uses: kerthcet/github-workflow-as-kube/.github/workflows/workflow-as-kubernetes.yaml@v0.1.14
2020
secrets:
2121
AGENT_TOKEN: ${{ secrets.AGENT_TOKEN }}

.golangci.yml renamed to .golangci.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
run:
2-
deadline: 5m
2+
timeout: 5m
33
allow-parallel-runners: true
44

55
issues:
@@ -12,7 +12,11 @@ issues:
1212
- path: "api/*"
1313
linters:
1414
- lll
15-
- path: "internal/*"
15+
- path: "pkg/*"
16+
linters:
17+
- dupl
18+
- lll
19+
- path: "test/*"
1620
linters:
1721
- dupl
1822
- lll
@@ -23,13 +27,11 @@ linters:
2327
- errcheck
2428
- exportloopref
2529
- goconst
26-
- gocyclo
2730
- gofmt
2831
- goimports
2932
- gosimple
3033
- govet
3134
- ineffassign
32-
- lll
3335
- misspell
3436
- nakedret
3537
- prealloc

Makefile

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11

2+
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
3+
ARTIFACTS ?= $(PROJECT_DIR)/bin
4+
25
# Image URL to use all building/pushing image targets
36
BASE_IMAGE ?= gcr.io/distroless/static:nonroot
47
DOCKER_BUILDX_CMD ?= docker buildx
58
IMAGE_BUILD_CMD ?= $(DOCKER_BUILDX_CMD) build
69
IMAGE_BUILD_EXTRA_OPTS ?=
710
IMAGE_REGISTRY ?= inftyai
8-
IMAGE_NAME ?= vscheduler
11+
IMAGE_NAME ?= kube-scheduler
912
IMAGE_REPO := $(IMAGE_REGISTRY)/$(IMAGE_NAME)
1013
GIT_TAG ?= $(shell git describe --tags --dirty --always)
1114
IMG ?= $(IMAGE_REPO):$(GIT_TAG)
1215
GO_VERSION := $(shell awk '/^go /{print $$2}' go.mod|head -n1)
1316
BUILDER_IMAGE ?= golang:$(GO_VERSION)
1417

1518
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
16-
ENVTEST_K8S_VERSION = 1.28.0
19+
ENVTEST_K8S_VERSION = 1.32.0
1720

1821
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
1922
ifeq (,$(shell go env GOBIN))
@@ -36,6 +39,17 @@ SHELL = /usr/bin/env bash -o pipefail
3639
.PHONY: all
3740
all: build
3841

42+
LOCALBIN ?= $(shell pwd)/bin
43+
$(LOCALBIN):
44+
mkdir -p $(LOCALBIN)
45+
46+
GINKGO = $(shell pwd)/bin/ginkgo
47+
GINKGO_VERSION ?= $(shell go list -m -f '{{.Version}}' github.com/onsi/ginkgo/v2)
48+
.PHONY: ginkgo
49+
ginkgo: ## Download ginkgo locally if necessary.
50+
test -s $(LOCALBIN)/ginkgo || \
51+
GOBIN=$(LOCALBIN) go install github.com/onsi/ginkgo/v2/ginkgo@$(GINKGO_VERSION)
52+
3953
##@ General
4054

4155
# The help target prints out all targets with their descriptions organized
@@ -71,17 +85,35 @@ fmt: ## Run go fmt against code.
7185
vet: ## Run go vet against code.
7286
go vet ./...
7387

88+
GOTESTSUM = $(shell pwd)/bin/gotestsum
89+
.PHONY: gotestsum
90+
gotestsum: ## Download gotestsum locally if necessary.
91+
test -s $(LOCALBIN)/gotestsum || \
92+
GOBIN=$(LOCALBIN) go install gotest.tools/gotestsum@v1.8.2
93+
7494
.PHONY: test
75-
test: manifests generate fmt vet envtest ## Run tests.
76-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
95+
test: fmt vet envtest gotestsum ## Run tests.
96+
$(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.xml -- ./api/... ./pkg/... -coverprofile $(ARTIFACTS)/cover.out
97+
98+
.PHONY: test-integration
99+
test-integration: fmt vet envtest ginkgo ## Run integration tests.
100+
@echo "skip integration test"
101+
# KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" \
102+
# $(GINKGO) --junit-report=junit.xml --output-dir=$(ARTIFACTS) -v $(INTEGRATION_TARGET)
103+
104+
test-e2e: fmt vet envtest ginkgo
105+
@echo "skip e2e test"
106+
# E2E_KIND_NODE_VERSION=$(E2E_KIND_NODE_VERSION) KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) KIND=$(KIND) KUBECTL=$(KUBECTL) KUSTOMIZE=$(KUSTOMIZE) GINKGO=$(GINKGO) USE_EXISTING_CLUSTER=$(USE_EXISTING_CLUSTER) IMAGE_TAG=$(IMG) ENVTEST_LWS_VERSION=$(ENVTEST_LWS_VERSION) ./hack/e2e-test.sh
77107

78108
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
79109
GOLANGCI_LINT_VERSION ?= v1.54.2
80110
golangci-lint:
81-
@[ -f $(GOLANGCI_LINT) ] || { \
82-
set -e ;\
83-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
84-
}
111+
@echo "skip golangci-lint"
112+
# golangci-lint:
113+
# @[ -f $(GOLANGCI_LINT) ] || { \
114+
# set -e ;\
115+
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
116+
# }
85117

86118
.PHONY: lint
87119
lint: golangci-lint ## Run golangci-lint linter & yamllint

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
# vScheduler
1+
# Scheduler Plugins
22

3-
A Kubernetes scheduler designed for smart scheduling with llmaz.
3+
Scheduler Plugins maintains multiple plugins used to differentiate the scheduling strategies for different workloads.
44

5-
## Plugins
6-
7-
vScheduler maintains multiple plugins for llm workloads scheduling.
5+
## Plugin List
86

97
### ResourceFungibility Plugin
108

11-
A `llama2-7B` model can be run on __1xA100__ GPU, can also be run on __1xA10__ GPU, this is what we called fungibility.
9+
A `llama2-7B` model can be running on __1xA100__ GPU, also on __1xA10__ GPU, even on __1x4090__ and a variety of other types of GPUs as well, that's what we called resource fungibility. In practical scenarios, we may have a heterogeneous cluster with different GPU types, and high-end GPUs will stock out a lot, to meet the SLOs of the service as well as the cost, we need to schedule the workloads on different GPU types.
10+
11+
With [resourceFungibility](./pkg/plugins/resource_fungibility/README.md) plugin, we can simply achieve this with at most 8 alternative GPU types.
1212

13-
With [resourceFungibility](./docs/plugins/resource_fungibility.md) plugin, we can simply achieve this with at most 8 alternative GPU types.
13+
In the future, we need to explore the GPU usage dynamically, not only for the availability and cost, but also the performance. See related paper about [Mélange: Cost Efficient Large Language Model
14+
Serving by Exploiting GPU Heterogeneity](https://arxiv.org/pdf/2404.14527).

cmd/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ import (
2020
"os"
2121

2222
// Ensure scheme package is initialized.
23-
_ "github.com/inftyai/vscheduler/api/config/scheme"
23+
_ "github.com/inftyai/scheduler/api/config/scheme"
2424

2525
"k8s.io/component-base/cli"
2626
"k8s.io/kubernetes/cmd/kube-scheduler/app"
2727

28-
resourceFungibility "github.com/inftyai/vscheduler/pkg/plugins/resource_fungibility"
28+
resourceFungibility "github.com/inftyai/scheduler/pkg/plugins/resource_fungibility"
2929
//+kubebuilder:scaffold:imports
3030
)
3131

0 commit comments

Comments
 (0)