-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/pipeline queue manager #2334
Feature/pipeline queue manager #2334
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2334 +/- ##
==========================================
- Coverage 15.90% 15.72% -0.19%
==========================================
Files 1195 1214 +19
Lines 118228 122682 +4454
==========================================
+ Hits 18810 19286 +476
- Misses 97500 101411 +3911
- Partials 1918 1985 +67
|
fad96fc
to
4790747
Compare
4790747
to
0751721
Compare
Add at least 1000 pipeline to queue and tested it. |
2000 queue item consume about 86kb, one etcd key limit 1.5m value, so, one queue may save 35000 queue item |
cd628b5
to
5ff713c
Compare
r.continueBackupQueueUsage(ctx) | ||
}() | ||
go func() { | ||
r.QueueManager.Listen(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Listen what
costTime = end.Sub(begin) | ||
queueSnapshot := manager.SnapshotObj{} | ||
if err := json.Unmarshal(backup, &queueSnapshot); err != nil { | ||
errDone <- err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return here
}) | ||
} | ||
|
||
func (mgr *defaultManager) SendPipelineIDS(queueID uint64, pipelineIDS []uint64) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDs
) | ||
|
||
const ( | ||
etcdQueueWatchPrefix = "/devops/pipeline/queue/action/update/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queue_manager/actions/
mgr.qLock.Lock() | ||
defer mgr.qLock.Unlock() | ||
|
||
// construct newQueue first for later use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Abstract these code to a function. And I remember already have a function?
return b | ||
} | ||
|
||
// Import default queue manager execute in memory, don't need import |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
load from database
modules/pipeline/pipengine/reconciler/queuemanage/types/manager.go
Outdated
Show resolved
Hide resolved
17d4b5d
to
bf43a39
Compare
modules/pipeline/pipengine/reconciler/queuemanage/manager/usage.go
Outdated
Show resolved
Hide resolved
modules/pipeline/pipengine/reconciler/queuemanage/types/manager.go
Outdated
Show resolved
Hide resolved
modules/pipeline/pipengine/reconciler/queuemanage/types/manager.go
Outdated
Show resolved
Hide resolved
modules/pipeline/pipengine/reconciler/queuemanage/types/manager.go
Outdated
Show resolved
Hide resolved
modules/pipeline/pipengine/reconciler/queuemanage/types/manager.go
Outdated
Show resolved
Hide resolved
bf43a39
to
aa96fdd
Compare
@@ -27,4 +30,9 @@ type QueueManager interface { | |||
PopOutPipelineFromQueue(pipelineID uint64) | |||
BatchUpdatePipelinePriorityInQueue(pq *apistructs.PipelineQueue, pipelineIDs []uint64) error | |||
Stop() | |||
SendQueueToETCD(queueID uint64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all use Etcd
aa96fdd
to
7ef61d5
Compare
7ef61d5
to
b8a6bf7
Compare
/approve |
/cherry-pick release/1.3 |
* annotate backup throttler func * query, update queue usage to etcd * use protobuf marshal unmarshal queue usage * watch etcd to update queue instead of in memory
What type of this PR
Add one of the following kinds:
/kind feature
What this PR does / why we need it:
update queue usage to etcd for multiple pipeline
Which issue(s) this PR fixes:
Specified Reviewers:
/assign @your-reviewer
ChangeLog
Need cherry-pick to release versions?
Add comment like
/cherry-pick release/1.0
when this PR is merged.