Skip to content
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

feat: implement FindCandidatePersistentCacheParents for scheduling persistent cache task #3770

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

gaius-qi
Copy link
Member

Description

This pull request includes significant changes to the scheduler component, primarily focusing on adding new metrics, modifying the Host struct, updating peer states, and enhancing the evaluator logic. Below are the most important changes grouped by theme:

Metrics Addition:

  • Added multiple new counters to track various persistent cache peer activities in scheduler/metrics/metrics.go. These include counts for register, download, and failure events for persistent cache peers and pieces.

Host Struct and Related Functions:

  • Removed ConcurrentUploadLimit, ConcurrentUploadCount, UploadCount, and UploadFailedCount fields from the Host struct in scheduler/resource/persistentcache/host.go. Added SchedulerClusterID field.
  • Updated the NewHost function to remove options for setting concurrent upload limits and counts, and added schedulerClusterId parameter. [1] [2]
  • Modified the Load and Store functions in scheduler/resource/persistentcache/host_manager.go to handle the new SchedulerClusterID field and remove handling of concurrent upload limits and counts. [1] [2] [3] [4]

Peer States and Events:

  • Updated peer states and events to differentiate between empty and normal scope sizes in scheduler/resource/persistentcache/peer.go. Added PeerStateReceivedEmpty, PeerStateReceivedNormal, PeerEventRegisterEmpty, and PeerEventRegisterNormal. [1] [2] [3]

Task Size Scope:

  • Added constants for tiny and empty file sizes and implemented the SizeScope method in the Task struct to determine the size scope type in scheduler/resource/persistentcache/task.go. [1] [2]

Evaluator Enhancements:

  • Updated the evaluator interface and implementation to include methods for evaluating persistent cache parents and determining bad persistent cache parents in scheduler/scheduling/evaluator/evaluator.go. [1] [2] [3] [4]
  • Adjusted imports to include the new persistentcache package in relevant files. [1] [2]

Related Issue

Motivation and Context

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@gaius-qi gaius-qi added the enhancement New feature or request label Jan 16, 2025
@gaius-qi gaius-qi added this to the v2.3.0 milestone Jan 16, 2025
@gaius-qi gaius-qi self-assigned this Jan 16, 2025
@gaius-qi gaius-qi requested a review from a team as a code owner January 16, 2025 14:19
@gaius-qi gaius-qi force-pushed the feature/find branch 3 times, most recently from 2be3860 to 1d65e7a Compare January 16, 2025 14:44
CormickKneey
CormickKneey previously approved these changes Jan 17, 2025
Copy link
Contributor

@CormickKneey CormickKneey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 11.15760% with 637 lines in your changes missing coverage. Please review.

Project coverage is 34.57%. Comparing base (7f0394c) to head (0bd3ccb).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
scheduler/service/service_v2.go 0.78% 507 Missing and 1 partial ⚠️
scheduler/scheduling/scheduling.go 32.94% 51 Missing and 6 partials ⚠️
scheduler/resource/persistentcache/task.go 0.00% 18 Missing ⚠️
scheduler/scheduling/mocks/scheduling_mock.go 0.00% 18 Missing ⚠️
scheduler/scheduling/evaluator/evaluator_base.go 48.38% 16 Missing ⚠️
scheduler/resource/persistentcache/peer.go 0.00% 7 Missing ⚠️
scheduler/scheduling/evaluator/evaluator.go 58.82% 7 Missing ⚠️
scheduler/resource/persistentcache/host_manager.go 0.00% 4 Missing ⚠️
scheduler/resource/persistentcache/peer_manager.go 0.00% 1 Missing ⚠️
scheduler/scheduler.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3770      +/-   ##
==========================================
- Coverage   35.16%   34.57%   -0.59%     
==========================================
  Files         337      337              
  Lines       37998    38533     +535     
==========================================
- Hits        13361    13324      -37     
- Misses      23799    24367     +568     
- Partials      838      842       +4     
Flag Coverage Δ
unittests 34.57% <11.15%> (-0.59%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
scheduler/metrics/metrics.go 10.89% <ø> (ø)
scheduler/resource/persistentcache/host.go 100.00% <100.00%> (ø)
scheduler/resource/persistentcache/task_manager.go 0.00% <ø> (ø)
scheduler/resource/persistentcache/peer_manager.go 0.00% <0.00%> (ø)
scheduler/scheduler.go 0.00% <0.00%> (ø)
scheduler/resource/persistentcache/host_manager.go 0.00% <0.00%> (ø)
scheduler/resource/persistentcache/peer.go 0.00% <0.00%> (ø)
scheduler/scheduling/evaluator/evaluator.go 68.88% <58.82%> (-12.70%) ⬇️
scheduler/scheduling/evaluator/evaluator_base.go 83.83% <48.38%> (-16.17%) ⬇️
scheduler/resource/persistentcache/task.go 0.00% <0.00%> (ø)
... and 3 more

... and 3 files with indirect coverage changes

scheduler/scheduling/evaluator/evaluator.go Outdated Show resolved Hide resolved
scheduler/scheduling/evaluator/evaluator.go Outdated Show resolved Hide resolved
scheduler/scheduling/evaluator/evaluator_base.go Outdated Show resolved Hide resolved
@gaius-qi gaius-qi force-pushed the feature/find branch 4 times, most recently from 750faee to 97d703f Compare January 17, 2025 10:35
@gaius-qi gaius-qi merged commit a63126e into main Jan 17, 2025
27 checks passed
@gaius-qi gaius-qi deleted the feature/find branch January 17, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants