Cache Map #
Maps an input hash to a structure of output artifact content hashes.
These mappings are stored in a per-package JSON Lines file in the Lake cache.
Equations
Instances For
The current version of the input-to-output mappings file format.
Equations
- Lake.CacheMap.schemaVersion = "2025-09-10"
Instances For
Loads a CacheMap from a JSON Lines file.
Errors if the the file is ill-formatted or the read fails for other reasons.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Save a CacheMap to a JSON Lines file.
Entries already in the file but not in the map will not be removed.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Write a CacheMap to a JSON Lines file.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns the output data associated with the input hash in the cache.
Equations
- Lake.CacheMap.get? inputHash cache = Std.HashMap.get? cache inputHash
Instances For
Associate output data (as JSON) with the given the input hash.
Equations
- Lake.CacheMap.insertCore inputHash val cache = Std.HashMap.insert cache inputHash val
Instances For
Associate output data with the given the input hash.
Equations
- Lake.CacheMap.insert inputHash val cache = Lake.CacheMap.insertCore inputHash (Lean.toJson val) cache
Instances For
Extract each output from their structured data into a flat array of artifact descriptions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Cache Ref #
Returns the output data associated with the input hash in the cache.
Equations
- Lake.CacheRef.get? inputHash cache = ST.Ref.modifyGet cache fun (m : Lake.CacheMap) => (Lake.CacheMap.get? inputHash m, m)
Instances For
Associate output data with the given the input hash.
Equations
- Lake.CacheRef.insert inputHash val cache = ST.Ref.modify cache fun (x : Lake.CacheMap) => Lake.CacheMap.insert inputHash (Lean.toJson val) x
Instances For
Local Cache #
Equations
- Lake.instInhabitedCache.default = { dir := default }
Instances For
Equations
- Lake.instInhabitedCache = { default := Lake.instInhabitedCache.default }
Returns the artifact directory for the Lake cache.
Instances For
Returns the path to artifact in the Lake cache with extension ext.
Equations
- cache.artifactPath contentHash ext = cache.artifactDir / Lake.artifactPath contentHash ext
Instances For
Returns the artifact in the Lake cache corresponding the given artifact description.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns the artifact in the Lake cache corresponding the given artifact description. Errors if missing.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns path to the artifact for each output. Errors if any are missing.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The directory where input-to-output mappings are stored in the Lake cache.
Instances For
The file containing the outputs of the the given input for the package.
Equations
Instances For
Cache the outputs corresponding to the given input for the package.
Equations
- cache.writeOutputsCore scope inputHash outputs = do Lake.createParentDirs (cache.outputsFile scope inputHash) IO.FS.writeFile (cache.outputsFile scope inputHash) outputs.compress
Instances For
Cache the outputs corresponding to the given input for the package.
Equations
- cache.writeOutputs scope inputHash outputs = cache.writeOutputsCore scope inputHash (Lean.toJson outputs)
Instances For
Cache the input-to-outputs mappings from a CacheMap.
Equations
- cache.writeMap scope map = Std.HashMap.forM (fun (i : Lake.Hash) (o : Lean.Json) => cache.writeOutputsCore scope i o) map
Instances For
The directory where input-to-output mappings of downloaded package revisions are cached.
Instances For
Returns path to the input-to-output mappings of a downloaded package revision.
Equations
Instances For
Remote Cache Service #
Configuration of a remote cache service (e.g., Reservoir or an S3 bucket).
A given configuration is not required to support all cache service functions, and no validation
of the configuration is performed by its operations. Users should construct a service that supports
the desired functions by using CacheService's smart constructors
(e.g., reservoir, uploadService).
- key : String
- artifactEndpoint : String
- revisionEndpoint : String
- isReservoir : Bool
Is this a Reservoir cache service configuration?
- apiEndpoint : String
- repoScope : Bool
Instances For
Constructors #
Constructs a CacheService for a Reservoir endpoint.
Equations
- Lake.CacheService.reservoirService apiEndpoint repoScope = { isReservoir := true, apiEndpoint := apiEndpoint, repoScope := repoScope }
Instances For
Constructs a CacheService to upload artifacts and/or outputs to an S3 endpoint.
Equations
- Lake.CacheService.uploadService key artifactEndpoint revisionEndpoint = { key := key, artifactEndpoint := artifactEndpoint, revisionEndpoint := revisionEndpoint }
Instances For
Constructs a CacheService to download artifacts and/or outputs from to an S3 endpoint.
Equations
- Lake.CacheService.downloadService artifactEndpoint revisionEndpoint = { artifactEndpoint := artifactEndpoint, revisionEndpoint := revisionEndpoint }
Instances For
Constructs a CacheService to download just artifacts from to an S3 endpoint.
Equations
- Lake.CacheService.downloadArtsService artifactEndpoint = { artifactEndpoint := artifactEndpoint }
Instances For
Reconfigures the cache service to interpret scopes as repositories (or not if false).
For custom endpoints, if true, Lake wil augment the provided scope with
toolchain and platform information in a manner similar to Reservoir.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Artifact Transfer #
The MIME type of Lake/Reservoir artifact.
Equations
- Lake.CacheService.artifactContentType = "application/vnd.reservoir.artifact"
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Output Transfer #
The MIME type of Lake/Reservoir input-to-output mappings for a Git revision.
Equations
- Lake.CacheService.mapContentType = "application/vnd.reservoir.outputs+json-lines"
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.