Skip to content

Commit d2efa3e

Browse files
committed
feat(Scheduler): Support priority/elder/depends based scheduling.
1 parent cadf1f0 commit d2efa3e

Some content is hidden

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

41 files changed

+2921
-501
lines changed

vermeer/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,7 @@ node_modules/
8383
/output/
8484
/bin/*
8585
!/bin/*.sh
86+
87+
# 其他 #
88+
######################
89+
test/case/

vermeer/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@
33
## Introduction
44
Vermeer is a high-performance distributed graph computing platform based on memory, supporting more than 15 graph algorithms, custom algorithm extensions, and custom data source access.
55

6+
## Run with Docker
7+
8+
Pull the image:
9+
```
10+
docker pull hugegraph/vermeer:latest
11+
```
12+
13+
Create local configuration files, for example, `~/master.ini` and `~/worker.ini`.
14+
15+
Run with Docker. The `--env` flag specifies the file name.
16+
17+
```
18+
master: docker run -v ~/:/go/bin/config hugegraph/vermeer --env=master
19+
worker: docker run -v ~/:/go/bin/config hugegraph/vermeer --env=worker
20+
```
21+
22+
We've also provided a `docker-compose` file. Once you've created `~/master.ini` and `~/worker.ini`, and updated the `master_peer` in `worker.ini` to `172.20.0.10:6689`, you can run it using the following command:
23+
24+
```
25+
docker-compose up -d
26+
```
27+
628
## Start
729

830
```

vermeer/README.zh-CN.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,26 @@
33
## 简介
44
Vermeer是一个基于内存的高性能分布式图计算平台,支持15+图算法。支持自定义算法扩展,支持自定义数据源接入。
55

6+
## 基于 Docker 运行
7+
8+
拉取镜像
9+
```
10+
docker pull hugegraph/vermeer:latest
11+
```
12+
13+
创建好本地配置文件,例如`~/master.ini``~/worker.ini`
14+
15+
基于docker运行,其中`--env`指定的是文件名称。
16+
```
17+
master: docker run -v ~/:/go/bin/config hugegraph/vermeer --env=master
18+
worker: docker run -v ~/:/go/bin/config hugegraph/vermeer --env=worker
19+
```
20+
21+
我们也提供了`docker-compose`文件,当创建好`~/master.ini``~/worker.ini`,将`worker.ini`中的`master_peer`修改为`172.20.0.10:6689`后,即可通过以下命令运行:
22+
```
23+
docker-compose up -d
24+
```
25+
626
## 运行
727

828
```

vermeer/apps/graphio/local_file.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ func (a *LocalMaker) MakeTasks(params map[string]string, taskID int32) ([]LoadPa
8282
logrus.Errorf(s)
8383
return nil, errors.New(s)
8484
}
85+
logrus.Debugf("MakeTask LoadTypeLocal parse file: %s, s:%d, e:%d", files, s, e)
8586
for i := s; i <= e; i++ {
8687
part := LoadPartition{}
8788
part.Init(partID, taskID, LoadPartTypeVertex)

vermeer/apps/master/bl/compute_task.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ func (ctb *ComputeTaskBl) ComputeTaskStatus(
142142
}
143143
}
144144
taskMgr.ForceState(computeTask.Task, structure.TaskStateComplete)
145+
// for scheduler, mark task complete
146+
Scheduler.taskManager.MarkTaskComplete(taskId)
145147
graph.SubUsingNum()
146148
computeTask.FreeMemory()
147149
needQuery := options.GetInt(computeTask.Task.Params, "output.need_query") == 1

vermeer/apps/master/bl/grpc_handlers.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"time"
2727
"vermeer/apps/compute"
2828
"vermeer/apps/graphio"
29+
"vermeer/apps/master/schedules"
2930
"vermeer/apps/master/threshold"
3031
"vermeer/apps/master/workers"
3132
pb "vermeer/apps/protos"
@@ -92,7 +93,7 @@ func (h *ServerHandler) SayHelloMaster(ctx context.Context, req *pb.HelloMasterR
9293
}
9394
}
9495

95-
reqWorker, err := workerMgr.CreateWorker(ip+":"+port, ip, req.Version)
96+
reqWorker, err := workerMgr.CreateWorker(ip+":"+port, ip, req.Version, req.WorkerGroup)
9697
if err != nil {
9798
logrus.Errorf("failed to create a WorkerClient, error: %s", err)
9899
return &pb.HelloMasterResp{WorkerId: -1, WorkerName: reqWorker.Name}, err
@@ -103,8 +104,13 @@ func (h *ServerHandler) SayHelloMaster(ctx context.Context, req *pb.HelloMasterR
103104
logrus.Errorf("failed to add a WorkerClient to the WorkerManager, error: %s", err)
104105
return &pb.HelloMasterResp{}, err
105106
}
107+
_, err = Scheduler.ChangeWorkerStatus(reqWorker.Name, schedules.WorkerOngoingStatusIdle)
108+
if err != nil {
109+
logrus.Errorf("failed to change worker status to idle, error: %s", err)
110+
return &pb.HelloMasterResp{}, err
111+
}
106112

107-
logrus.Infof("worker say hello name: %s, client: %s", reqWorker.Name, p.Addr.String())
113+
logrus.Infof("worker say hello name: %s and set to workgroup: %s, client: %s", reqWorker.Name, reqWorker.Group, p.Addr.String())
108114

109115
resp := pb.HelloMasterResp{
110116
WorkerId: reqWorker.Id,

vermeer/apps/master/bl/load_task.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ func (lb *LoadTaskBl) LoadTaskStatus(taskId int32, state string, workerName stri
204204
loadTask.Task.SetState(structure.TaskStateLoaded)
205205
//TaskMgr.ForceState(loadTask.Task, structure.TaskStateLoaded)
206206

207+
// for scheduler, mark task complete
208+
Scheduler.taskManager.MarkTaskComplete(taskId)
209+
207210
logrus.Infof("graph: %s, vertex: %d, edge: %d", graph.Name, graph.VertexCount, graph.EdgeCount)
208211
for _, w := range graph.Workers {
209212
logrus.Infof(

0 commit comments

Comments
 (0)