Skip to content

Conversation

gaius-qi
Copy link
Member

@gaius-qi gaius-qi commented Aug 4, 2025

Description

This pull request introduces a series of updates to dependencies, logging utilities, and the preheating functionality for container images. Key changes include dependency updates in go.mod, the addition of new logging methods, a refactor of the image preheating logic to use a new ManifestRequest structure, and the removal of an unused configuration parameter. These changes improve maintainability, functionality, and code clarity.

Dependency Updates:

  • Updated several dependencies in go.mod, including d7y.io/api/v2 to v2.1.55, google.golang.org/grpc to v1.74.2, and cel.dev/expr to v0.24.0. These updates ensure compatibility with the latest versions of external libraries. [1] [2] [3] [4] [5]

Logging Enhancements:

  • Added new logging methods (WithPreheatImage, WithStatImage, and WithStatImageAndTaskID) in internal/dflog/logger.go to enhance flexibility in logging specific operations.

Preheating Refactor:

  • Introduced a new ManifestRequest structure in internal/job/image.go to encapsulate preheating parameters, replacing the previous PreheatArgs. This refactor simplifies the function signatures and improves readability. [1] [2]
  • Refactored the CreatePreheatRequestsByManifestURL function to use the new ManifestRequest structure and updated related logic for building preheat requests. [1] [2] [3]

Testing and Mocking:

  • Updated tests in internal/job/image_test.go to align with the new ManifestRequest structure. [1] [2] [3]
  • Added a mock for the Image interface in internal/job/mocks/job_mock.go to facilitate unit testing.

Configuration Cleanup:

  • Removed the unused RegistryTimeout parameter from the PreheatConfig in manager/config/config.go, simplifying configuration management. [1] [2] [3]

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.

Signed-off-by: Gaius <gaius.qi@gmail.com>
@gaius-qi gaius-qi added this to the v2.4.0 milestone Aug 4, 2025
@gaius-qi gaius-qi self-assigned this Aug 4, 2025
@gaius-qi gaius-qi added the enhancement New feature or request label Aug 4, 2025
@gaius-qi gaius-qi force-pushed the feature/preheat branch 2 times, most recently from b97af46 to 0109347 Compare August 4, 2025 15:03
@gaius-qi gaius-qi changed the title Feature/preheat feat: implement PreheatImage and StatImage for scheduler Aug 4, 2025
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

❌ Patch coverage is 60.62847% with 213 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.90%. Comparing base (c0c8763) to head (4b41e27).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
scheduler/job/job.go 0.00% 91 Missing ⚠️
manager/service/job.go 0.00% 29 Missing ⚠️
scheduler/rpcserver/scheduler_server_v2.go 3.33% 29 Missing ⚠️
manager/job/preheat.go 0.00% 25 Missing ⚠️
manager/job/task.go 0.00% 11 Missing ⚠️
manager/job/sync_peers.go 0.00% 7 Missing ⚠️
pkg/rpc/credential.go 0.00% 6 Missing ⚠️
manager/job/job.go 0.00% 5 Missing ⚠️
scheduler/service/service_v2.go 98.59% 2 Missing and 1 partial ⚠️
internal/job/image.go 93.10% 1 Missing and 1 partial ⚠️
... and 3 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4246      +/-   ##
==========================================
+ Coverage   32.51%   32.90%   +0.39%     
==========================================
  Files         350      352       +2     
  Lines       41382    41781     +399     
==========================================
+ Hits        13456    13750     +294     
- Misses      27035    27139     +104     
- Partials      891      892       +1     
Flag Coverage Δ
unittests 32.90% <60.62%> (+0.39%) ⬆️

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

Files with missing lines Coverage Δ
internal/dflog/logger.go 57.02% <100.00%> (+2.24%) ⬆️
internal/job/mocks/job_mock.go 100.00% <100.00%> (ø)
manager/config/config.go 96.41% <100.00%> (-0.06%) ⬇️
pkg/net/tls/cert.go 100.00% <100.00%> (ø)
scheduler/job/mocks/job_mock.go 87.50% <100.00%> (+87.50%) ⬆️
scheduler/metrics/metrics.go 10.89% <ø> (ø)
scheduler/resource/standard/seed_peer.go 23.28% <100.00%> (ø)
scheduler/rpcserver/rpcserver.go 100.00% <100.00%> (ø)
scheduler/service/service_v1.go 85.32% <100.00%> (-0.02%) ⬇️
scheduler/scheduler.go 0.00% <0.00%> (ø)
... and 12 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

LunaWhispers
LunaWhispers previously approved these changes Aug 4, 2025
Copy link
Contributor

@LunaWhispers LunaWhispers left a comment

Choose a reason for hiding this comment

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

lgtm

@LunaWhispers LunaWhispers enabled auto-merge (squash) August 4, 2025 15:12
…/preheat

Signed-off-by: Gaius <gaius.qi@gmail.com>
@gaius-qi gaius-qi force-pushed the feature/preheat branch 2 times, most recently from fb4fac5 to 99d9a0d Compare August 5, 2025 05:57
chlins
chlins previously approved these changes Aug 5, 2025
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

…/preheat

Signed-off-by: Gaius <gaius.qi@gmail.com>
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

Copy link
Contributor

@LunaWhispers LunaWhispers left a comment

Choose a reason for hiding this comment

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

lgtm

@LunaWhispers LunaWhispers merged commit baa061a into main Aug 5, 2025
16 checks passed
@LunaWhispers LunaWhispers deleted the feature/preheat branch August 5, 2025 09:35
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.

5 participants