Skip to content

Commit

Permalink
more logs for caching
Browse files Browse the repository at this point in the history
  • Loading branch information
dleviminzi committed Mar 4, 2025
1 parent 642456d commit c134a74
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/worker/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,20 @@ func (c *ImageClient) PullLazy(ctx context.Context, request *types.ContainerRequ
if _, err := os.Stat(baseBlobFsContentPath); err == nil && c.cacheClient.IsPathCachedNearby(ctx, "/"+sourcePath) {
localCachePath = baseBlobFsContentPath
} else {
c.logger.Log(request.ContainerId, request.StubId, "Image <%s> not found in worker's region, caching nearby", imageId)
outputLogger.Info("Image <%s> not found in worker's region, caching nearby", imageId)

Check failure on line 131 in pkg/worker/image.go

View workflow job for this annotation

GitHub Actions / lint_and_test_go_pkg

call to slog.Logger.Info missing a final value

// Otherwise, lets cache it in a nearby blobcache host
_, err := c.cacheClient.StoreContentFromSource(sourcePath, sourceOffset)
if err == nil {
localCachePath = baseBlobFsContentPath
c.logger.Log(request.ContainerId, request.StubId, "Image <%s> cached in worker's region", imageId)
outputLogger.Info("Image <%s> cached in worker's region", imageId)

Check failure on line 137 in pkg/worker/image.go

View workflow job for this annotation

GitHub Actions / lint_and_test_go_pkg

call to slog.Logger.Info missing a final value
} else {
c.logger.Log(request.ContainerId, request.StubId, "Failed to cache image in worker's region <%s>: %v", imageId, err)
outputLogger.Info("Failed to cache image in worker's region <%s>: %v", imageId, err)
}
}
}

elapsed := time.Since(startTime)
c.logger.Log(request.ContainerId, request.StubId, "Loaded image <%s>, took: %s", imageId, elapsed)

remoteArchivePath := fmt.Sprintf("%s/%s.%s", c.imageCachePath, imageId, c.registry.ImageFileExtension)
if _, err := os.Stat(remoteArchivePath); err != nil {
Expand Down

0 comments on commit c134a74

Please sign in to comment.