Skip to content

Commit 0397880

Browse files
Ethereal-Oimbajin
andauthored
feat(vermeer): support task priority based scheduling (#336)
* feat(Scheduler): Support priority/elder/depends based scheduling. * chore: some tiny error * Update vermeer/.gitignore * Update CodeQL workflow to use latest actions --------- Co-authored-by: imbajin <[email protected]>
1 parent 68bec0a commit 0397880

38 files changed

+2708
-147
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232

3333
steps:
3434
- name: Checkout repository
35-
uses: actions/checkout@v4
35+
uses: actions/checkout@v5
3636

3737
- name: Setup Java JDK
38-
uses: actions/setup-java@v3
38+
uses: actions/setup-java@v4
3939
with:
4040
distribution: 'zulu'
4141
java-version: '11'
@@ -48,7 +48,7 @@ jobs:
4848
4949
# Initializes the CodeQL tools for scanning.
5050
- name: Initialize CodeQL
51-
uses: github/codeql-action/init@v2
51+
uses: github/codeql-action/init@v3
5252
with:
5353
languages: ${{ matrix.language }}
5454
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -59,7 +59,7 @@ jobs:
5959
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6060
# If this step fails, then you should remove it and run the build manually (see below)
6161
- name: Autobuild
62-
uses: github/codeql-action/autobuild@v2
62+
uses: github/codeql-action/autobuild@v3
6363

6464
# ℹ️ Command-line programs to run using the OS shell.
6565
# 📚 https://git.io/JvXDl
@@ -73,13 +73,13 @@ jobs:
7373
# make release
7474

7575
- name: Perform CodeQL Analysis
76-
uses: github/codeql-action/analyze@v2
76+
uses: github/codeql-action/analyze@v3
7777

7878
dependency-review:
7979
runs-on: ubuntu-latest
8080
steps:
8181
- name: 'Checkout Repository'
82-
uses: actions/checkout@v4
82+
uses: actions/checkout@v5
8383
- name: 'Dependency Review'
84-
uses: actions/dependency-review-action@v3
84+
uses: actions/dependency-review-action@v4
8585

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+
# Others #
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: 6 additions & 0 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"
@@ -103,6 +104,11 @@ 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

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

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)