dotnet / dotnet/crank

Add agent files cache

Open
#688 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.1k
Forks
111
Avg merge
2d 21h
Merged PRs (30d)
3

Description

The build and output files that are sent to the agent could be cached on the server by sending a custom etag header in the request which would contain the CRC32 of the file being uploaded.

The `JobsController.SaveBodyAsync` method could check if the header is set. If it is then it would seek a file named with this CRC32 value, and copy it instead of streaming the content from the client. Then stopped prematurely the request with a success code that indicates the content was cached (304). The controller would then log this result to show that the content was already found on the server.

The agent needs to use a folder that is reused across agent instances. This could be in `{_buildPath}/.filecache`.
The agent can check the contents of this file on startup and remove older files when a customizable quotas is reached (argument). A good default could be 10GB (to allow files of 1GB so be kept locally).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.