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: add AllSeedPeersScope for preheating #3698

Merged
merged 1 commit into from
Dec 11, 2024
Merged

feat: add AllSeedPeersScope for preheating #3698

merged 1 commit into from
Dec 11, 2024

Conversation

gaius-qi
Copy link
Member

@gaius-qi gaius-qi commented Dec 11, 2024

Description

This pull request introduces changes to the preheating job functionality, specifically adding support for preheating with seed peers and refactoring related constants and methods. The most important changes include updating the scope constants, modifying the PreheatArgs struct, and implementing the preheatAllSeedPeers method.

Updates to preheating job functionality:

  • manager/types/job.go: Updated scope constants to include SingleSeedPeerScope and AllSeedPeersScope, and modified the PreheatArgs struct to remove the oneof constraint for the Scope field. [1] [2]

  • scheduler/job/job.go: Added the preheatAllSeedPeers method to handle preheating jobs with all seed peers, including error handling and task management.

  • scheduler/job/job.go: Updated the preheat method to handle new scope constants SingleSeedPeerScope and AllSeedPeersScope.

  • manager/service/job.go: Changed the default scope for preheating jobs from SinglePeerScope to SingleSeedPeerScope.

  • scheduler/resource/standard/seed_peer_client.go: Added the SeedPeers method to return the seed peers working for the scheduler. [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 Dec 11, 2024
@gaius-qi gaius-qi added this to the v2.2.0 milestone Dec 11, 2024
@gaius-qi gaius-qi self-assigned this Dec 11, 2024
@gaius-qi gaius-qi requested a review from a team as a code owner December 11, 2024 03:17
yxxhero
yxxhero previously approved these changes Dec 11, 2024
manager/types/job.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 0% with 145 lines in your changes missing coverage. Please review.

Project coverage is 35.19%. Comparing base (79a845e) to head (2d6ac0d).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
scheduler/job/job.go 0.00% 134 Missing ⚠️
...heduler/resource/standard/seed_peer_client_mock.go 0.00% 8 Missing ⚠️
scheduler/resource/standard/seed_peer_client.go 0.00% 2 Missing ⚠️
manager/service/job.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3698      +/-   ##
==========================================
- Coverage   35.36%   35.19%   -0.17%     
==========================================
  Files         335      335              
  Lines       37638    37775     +137     
==========================================
- Hits        13309    13296      -13     
- Misses      23501    23649     +148     
- Partials      828      830       +2     
Flag Coverage Δ
unittests 35.19% <0.00%> (-0.17%) ⬇️

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

Files with missing lines Coverage Δ
manager/service/job.go 0.00% <0.00%> (ø)
scheduler/resource/standard/seed_peer_client.go 75.47% <0.00%> (-1.46%) ⬇️
...heduler/resource/standard/seed_peer_client_mock.go 14.89% <0.00%> (-0.67%) ⬇️
scheduler/job/job.go 0.00% <0.00%> (ø)

... and 4 files with indirect coverage changes

Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

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

lgtm

@gaius-qi gaius-qi merged commit 62b6c37 into main Dec 11, 2024
27 checks passed
@gaius-qi gaius-qi deleted the feature/preheat branch December 11, 2024 03:51
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.

3 participants