-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Consensus simple merging #8953
Open
zhiltsov-max
wants to merge
129
commits into
develop
Choose a base branch
from
zm/consensus-simple-merging
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+10,266
−1,055
Open
Consensus simple merging #8953
Changes from 128 commits
Commits
Show all changes
129 commits
Select commit
Hold shift + click to select a range
3f1feb1
Port server changes
zhiltsov-max 00993e5
Port ui changes
zhiltsov-max 389611f
Rename task Consensus tag
zhiltsov-max 7d05dfd
Move consensus tag to parent jobs
zhiltsov-max 1138992
Fix job item column width
zhiltsov-max 2dc777c
Rename consensus jobs per job to consensus replicas field
zhiltsov-max b7f5f8e
Move to per job replica counts
zhiltsov-max 68c51a3
Revert some changes
zhiltsov-max 0329596
Update changelog
zhiltsov-max ab04a6d
Apply isort
zhiltsov-max 3d7c1a2
Fix double assignment
zhiltsov-max 3226dd7
Refactor
zhiltsov-max 824cf82
Fix backups
zhiltsov-max a866667
Merge branch 'develop' into zm/consensus-task-creation
zhiltsov-max 02d78b9
Fix field sending
zhiltsov-max b8b096c
Add task creation and data access tests
zhiltsov-max 8f8a406
Update test assets
zhiltsov-max 35b7ef1
Add backup tests
zhiltsov-max 4ea54b4
Merge branch 'develop' into zm/consensus-task-creation
zhiltsov-max 4c41c2a
Fix python 3.9 compatibility
zhiltsov-max 2879010
Add annotations test for consensus task
zhiltsov-max f3de175
Fix project backup import
zhiltsov-max f92a3c3
Fix honeypot task selection
zhiltsov-max 7bd100d
Add ui
zhiltsov-max 5b7e2c2
Merge branch 'develop' into zm/consensus-task-creation
zhiltsov-max 2eaddc3
Add server
zhiltsov-max 9fa8dcb
Fixes
zhiltsov-max 0e36b7d
Increase timeouts
zhiltsov-max 16a1570
Fix invalid inheritance in tests
zhiltsov-max 5d62dce
Merge branch 'zm/fix-test-inheritance' into zm/consensus-task-creation
zhiltsov-max 781150a
Merge branch 'develop' into zm/consensus-task-creation
zhiltsov-max 587d802
Revert extra change
zhiltsov-max 259a23f
Update cvat-ui/src/components/jobs-page/jobs-filter-configuration.ts
zhiltsov-max 083e60c
Merge branch 'develop' into zm/consensus-task-creation
zhiltsov-max 489b8ee
Merge remote-tracking branch 'origin/zm/consensus-task-creation' into…
zhiltsov-max b0615d4
Extend job filter tests
zhiltsov-max 1ecd6cf
Merge branch 'zm/consensus-task-creation' into zm/consensus-simple-me…
zhiltsov-max d7db85c
Merge branch 'develop' into zm/consensus-task-creation
klakhov 14bd5d2
Refactor some code
zhiltsov-max 607df7e
Fix consensus settings saves in ui
zhiltsov-max eef091a
applied ui changes
klakhov 34d9515
Merge branch 'develop' into zm/consensus-task-creation
klakhov fb9b1aa
revert not necessary change
klakhov 60bf620
Merge branch 'develop' into zm/consensus-task-creation
klakhov 6c069a3
Refactor merging
zhiltsov-max 815b45e
Refactor
zhiltsov-max 00c3af2
Update server schema
zhiltsov-max 3066452
Include deferred rq jobs in 202 response
zhiltsov-max fe5ef04
Create settings only for tasks with at least 1 consensus job
zhiltsov-max 4983082
Update test assets
zhiltsov-max 651f94a
Add debug task for consensus worker
zhiltsov-max b89ea7b
Add tests
zhiltsov-max 8fee320
Disallow null value in task consensus_replicas
zhiltsov-max aa62db5
Rename related field
zhiltsov-max 78a816e
Rename job type to consensus_replica
zhiltsov-max 9c59005
Format code
zhiltsov-max 9bc2494
Finalize job type renaming
zhiltsov-max 6e20db0
Fix job cards on jobs page
zhiltsov-max 9e60289
Revert extra change
zhiltsov-max 054e262
Fix job type filter name
zhiltsov-max 37400e9
Merge branch 'develop' into zm/consensus-task-creation
zhiltsov-max 1075e0e
Update migration
zhiltsov-max 5e9acb2
Add related query name
zhiltsov-max d3f9e1e
Merge branch 'develop' into zm/consensus-task-creation
zhiltsov-max 7ce6904
Merge branch 'zm/consensus-task-creation' into zm/consensus-simple-me…
zhiltsov-max 98907bf
Update migration
zhiltsov-max bd6268c
Update test data
zhiltsov-max deeac24
Merge branch 'develop' into zm/consensus-task-creation
zhiltsov-max 6d168b3
Merge branch 'zm/consensus-task-creation' into zm/consensus-simple-me…
zhiltsov-max 9c98cb1
Refactor some code
zhiltsov-max 59050e3
Rename action
zhiltsov-max 433cc20
Remove extra file
zhiltsov-max 386d801
Update consensus job type uses
zhiltsov-max 7bfa9c6
Refactor job actions menu, add modal on parent job merge
zhiltsov-max 97f8813
Remove extra code
zhiltsov-max ddc7c58
Remove extra changes
zhiltsov-max 8b2f709
Remove unused method
zhiltsov-max e5492a3
Make symbols public
zhiltsov-max 5f42a3a
Update rq job status handling
zhiltsov-max 2d37ee2
Update field name
zhiltsov-max 0217037
Add type annotations
zhiltsov-max 06434b8
Update test
zhiltsov-max 9c6b747
Merge branch 'develop' into zm/refactor-quality-reports-impl
zhiltsov-max 2a1c126
Add helm chart for consensus worker
zhiltsov-max fc829b1
Fix .gitignore
zhiltsov-max 10019b8
Merge branch 'zm/refactor-quality-reports-impl' into zm/consensus-sim…
zhiltsov-max ba65cfb
Fix merge
zhiltsov-max d951f1a
Merge branch 'zm/refactor-quality-reports-impl' into zm/consensus-sim…
zhiltsov-max 08d8421
Use fully qualified symbol name for internal datumaro symbols
zhiltsov-max 5c2c10d
Merge branch 'zm/refactor-quality-reports-impl' into zm/consensus-sim…
zhiltsov-max 25fb6c3
Fix some type references
zhiltsov-max b94d430
Refactor segment matching
zhiltsov-max abe9823
Merge branch 'zm/refactor-quality-reports-impl' into zm/consensus-sim…
zhiltsov-max 8b7c83f
Fix skeleton cluster distance computation in merging
zhiltsov-max d3dea88
Update merging call to the recent datumaro api
zhiltsov-max d8b9837
t
zhiltsov-max bdb81aa
Refactor, improve code reuse
zhiltsov-max f618be4
Refactor
zhiltsov-max 95ad74c
Merge branch 'develop' into zm/refactor-quality-reports-impl
zhiltsov-max 66a74de
Fix warning
zhiltsov-max 616be3a
Merge branch 'zm/refactor-quality-reports-impl' into zm/consensus-sim…
zhiltsov-max bcbe859
Fix warning
zhiltsov-max 879d05e
Reduce code duplication
zhiltsov-max c0b1f31
Update license headers
zhiltsov-max 41cd670
Fix warning
zhiltsov-max a2e9fc8
Fix warning
zhiltsov-max b1383bd
Fix warning
zhiltsov-max 8002a7a
Merge branch 'zm/refactor-quality-reports-impl' into zm/consensus-sim…
zhiltsov-max 1b6ce43
Refactor
zhiltsov-max bf5d53d
Refactor
zhiltsov-max 6b2e9d1
Improve merge notification message
zhiltsov-max fefb258
Add missing statistics accumulation in skeleton merging
zhiltsov-max 3c1d4cd
Fix merge status checks
zhiltsov-max 61a0f1b
Fix segmentation merging - don't match masks to polygons
zhiltsov-max 340f2c4
Disable annotation grouping
zhiltsov-max dc62d51
remove extra ignore
zhiltsov-max 3ed23e9
Merge branch 'develop' into zm/refactor-quality-reports-impl
zhiltsov-max d45e8b3
Merge branch 'zm/refactor-quality-reports-impl' into zm/consensus-sim…
zhiltsov-max cc51852
Fix merging for tasks with tracks
zhiltsov-max 8ccd0d8
Remove unused statistics collection code
zhiltsov-max 846d477
Fix shape label computation
zhiltsov-max fcbed3a
Remove extra import
zhiltsov-max b9e605e
Fix symbol
zhiltsov-max ff7d32c
Add more tests
zhiltsov-max 45dd8ae
Improve code reuse for rego rules
zhiltsov-max a6e6aa8
Fix task test assets
zhiltsov-max d03eb46
Merge branch 'develop' into zm/consensus-simple-merging
zhiltsov-max f3f9c9a
Fix merge
zhiltsov-max 84df74d
Merge branch 'develop' into zm/consensus-simple-merging
zhiltsov-max File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ import { ArgumentError } from './exceptions'; | |
import { | ||
AnalyticsReportFilter, QualityConflictsFilter, QualityReportsFilter, | ||
QualitySettingsFilter, SerializedAsset, | ||
ConsensusSettingsFilter, | ||
} from './server-response-types'; | ||
import QualityReport from './quality-report'; | ||
import QualityConflict, { ConflictSeverity } from './quality-conflict'; | ||
|
@@ -46,6 +47,7 @@ import { convertDescriptions, getServerAPISchema } from './server-schema'; | |
import { JobType } from './enums'; | ||
import { PaginatedResource } from './core-types'; | ||
import CVATCore from '.'; | ||
import ConsensusSettings from './consensus-settings'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should place it before |
||
|
||
function implementationMixin(func: Function, implementation: Function): void { | ||
Object.assign(func, { implementation }); | ||
|
@@ -414,6 +416,20 @@ export default function implementAPI(cvat: CVATCore): CVATCore { | |
return webhooks; | ||
}); | ||
|
||
implementationMixin(cvat.consensus.settings.get, async (filter: ConsensusSettingsFilter) => { | ||
checkFilter(filter, { | ||
taskID: isInteger, | ||
}); | ||
|
||
const params = fieldsToSnakeCase(filter); | ||
|
||
const settings = await serverProxy.consensus.settings.get(params); | ||
const schema = await getServerAPISchema(); | ||
const descriptions = convertDescriptions(schema.components.schemas.ConsensusSettings.properties); | ||
|
||
return new ConsensusSettings({ ...settings, descriptions }); | ||
}); | ||
|
||
implementationMixin(cvat.analytics.quality.reports, async (filter: QualityReportsFilter) => { | ||
checkFilter(filter, { | ||
page: isInteger, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// Copyright (C) 2024 CVAT.ai Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
import { SerializedConsensusSettingsData } from './server-response-types'; | ||
import PluginRegistry from './plugins'; | ||
import serverProxy from './server-proxy'; | ||
import { convertDescriptions, getServerAPISchema } from './server-schema'; | ||
|
||
export default class ConsensusSettings { | ||
#id: number; | ||
#task: number; | ||
#iouThreshold: number; | ||
#quorum: number; | ||
#descriptions: Record<string, string>; | ||
|
||
constructor(initialData: SerializedConsensusSettingsData) { | ||
this.#id = initialData.id; | ||
this.#task = initialData.task; | ||
this.#iouThreshold = initialData.iou_threshold; | ||
this.#quorum = initialData.quorum; | ||
this.#descriptions = initialData.descriptions; | ||
} | ||
|
||
get id(): number { | ||
return this.#id; | ||
} | ||
|
||
get task(): number { | ||
return this.#task; | ||
} | ||
|
||
get iouThreshold(): number { | ||
return this.#iouThreshold; | ||
} | ||
|
||
set iouThreshold(newVal: number) { | ||
this.#iouThreshold = newVal; | ||
} | ||
|
||
get quorum(): number { | ||
return this.#quorum; | ||
} | ||
|
||
set quorum(newVal: number) { | ||
this.#quorum = newVal; | ||
} | ||
|
||
get descriptions(): Record<string, string> { | ||
const descriptions: Record<string, string> = Object.keys(this.#descriptions).reduce((acc, key) => { | ||
const camelCaseKey = _.camelCase(key); | ||
acc[camelCaseKey] = this.#descriptions[key]; | ||
return acc; | ||
}, {}); | ||
|
||
return descriptions; | ||
} | ||
|
||
public toJSON(): SerializedConsensusSettingsData { | ||
const result: SerializedConsensusSettingsData = { | ||
iou_threshold: this.#iouThreshold, | ||
quorum: this.#quorum, | ||
}; | ||
|
||
return result; | ||
} | ||
|
||
public async save(): Promise<ConsensusSettings> { | ||
const result = await PluginRegistry.apiWrapper.call(this, ConsensusSettings.prototype.save); | ||
return result; | ||
} | ||
} | ||
|
||
Object.defineProperties(ConsensusSettings.prototype.save, { | ||
implementation: { | ||
writable: false, | ||
enumerable: false, | ||
value: async function implementation(): Promise<ConsensusSettings> { | ||
const result = await serverProxy.consensus.settings.update( | ||
this.id, this.toJSON(), | ||
); | ||
const schema = await getServerAPISchema(); | ||
const descriptions = convertDescriptions(schema.components.schemas.ConsensusSettings.properties); | ||
return new ConsensusSettings({ ...result, descriptions }); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.