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.
Instances For
The current version of the input-to-output mappings file format.
Equations
- Lake.CacheMap.schemaVersion = { year := 2026, month := 3, day := 17 }
Instances For
Parse a Cache from a JSON Lines string.
If platformIndependent := true, all mappings within the file are considered
platform-independent. Otherwise, they are considered platform-dependent.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Loads a CacheMap from a JSON Lines file.
Errors if the file is ill-formatted or the read fails for other reasons.
If platformIndependent := true, all mappings within the file are considered
platform-independent. Otherwise, they are considered platform-dependent.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Loads a CacheMap from a JSON Lines file. Returns none if the file does not exist.
Errors if the manifest is ill-formatted or the read fails for other reasons.
If platformIndependent := true, all mappings within the file are considered
platform-independent. Otherwise, they are considered platform-dependent.
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.
If platformIndependent := true, platform-dependent mappings within the map
will not be written to the 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 = do let x ← Std.HashMap.get? cache inputHash some x.out
Instances For
Associate output data with the given the input hash.
Equations
- Lake.CacheMap.insert inputHash val cache platformIndependent = Lake.CacheMap.insertCore✝ inputHash (Lean.toJson val) cache platformIndependent
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 platformIndependent = ST.Ref.modify cache fun (x : Lake.CacheMap) => Lake.CacheMap.insert inputHash (Lean.toJson val) x platformIndependent
Instances For
Cache Service Name #
The identifier used for the default Reservoir service (i.e., reservoir).
Equations
- Lake.CacheServiceName.reservoir = { raw := "reservoir" }
Instances For
Constructs a service identifier from a user-provided name.
Equations
- Lake.CacheServiceName.ofString s = { raw := s }
Instances For
Returns the string representation of the service identifier.
Equations
- self.toString = Lake.CacheServiceName.raw✝ self
Instances For
Equations
Cache Service Scope #
Constructs a generic service scope from a user-provided string.
Equations
Instances For
Constructs a service scope from a GitHub repository name.
Equations
- Lake.CacheServiceScope.ofRepo fullName = { impl := Lake.CacheServiceScopeImpl.repo✝ fullName }
Instances For
Returns whether this is a repository scope.
Equations
- self.isRepo = match Lake.CacheServiceScope.impl✝ self with | Lake.CacheServiceScopeImpl.repo✝ s => true | x => false
Instances For
Returns a string representation of the scope.
Equations
- self.toString = match Lake.CacheServiceScope.impl✝ self with | Lake.CacheServiceScopeImpl.str✝ s => s | Lake.CacheServiceScopeImpl.repo✝ s => s
Instances For
Equations
Cache Output #
The current version of the output file format.
Equations
- Lake.CacheOutput.schemaVersion = "2026-02-25"
Instances For
- data : Lean.Json
- service? : Option CacheServiceName
- scope? : Option CacheServiceScope
Instances For
Equations
Equations
Instances For
For internal use only.
Equations
- Lake.CacheOutput.ofData data = { data := data }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.CacheOutput.instToJson = { toJson := Lake.CacheOutput.toJson }
Equations
- One or more equations did not get rendered due to their size.
- Lake.CacheOutput.fromJson? json = (fun (__r : Unit) => pure (Lake.CacheOutput.ofData json)) PUnit.unit
Instances For
Equations
- Lake.CacheOutput.instFromJson = { fromJson? := Lake.CacheOutput.fromJson? }
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
The directory where input-to-output mappings are stored in the Lake cache.
Instances For
The file containing the outputs of the given input for the package.
Equations
Instances For
Cache the outputs corresponding to the given input for the package.
Equations
- cache.writeOutputs scope inputHash outputs = Lake.Cache.writeOutputsCore✝ cache scope inputHash (Lean.toJson outputs) none none
Instances For
Cache the input-to-outputs mappings from a CacheMap.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Retrieve the cached outputs corresponding to the given input for the package (if any).
Equations
- One or more equations did not get rendered due to their size.
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
Cache Platform #
An indicator that no platform should be included in a cache scope.
Equations
- Lake.CachePlatform.none = { raw := "" }
Instances For
Returns true if this platform identifier is the none indicator.
Equations
- self.isNone = (Lake.CachePlatform.raw✝ self).isEmpty
Instances For
Constructs a platform identifier from a user-provided string.
Equations
- Lake.CachePlatform.ofString s = { raw := s }
Instances For
Returns the length of the platform identifier in Unicode code points.
Equations
- self.length = (Lake.CachePlatform.raw✝ self).length
Instances For
Returns a string representation of the platform identifier.
Instances For
Cache Toolchain #
An indicator that no toolchain should be included in a cache scope.
Equations
- Lake.CacheToolchain.none = { raw := "" }
Instances For
Returns true if this toolchain identifier is the none indicator.
Equations
- self.isNone = (Lake.CacheToolchain.raw✝ self).isEmpty
Instances For
Constructs a toolchain identifier from a user-provided string.
Equations
- Lake.CacheToolchain.ofString s = { raw := Lake.normalizeToolchain s }
Instances For
For internal use only. See Lake.Env.cacheToolchain.
Equations
- Lake.CacheToolchain.ofElanToolchain s = { raw := s }
Instances For
Returns the length of the toolchain identifier in Unicode code points.
Equations
- self.length = (Lake.CacheToolchain.raw✝ self).length
Instances For
Returns a string representation of the toolchain identifier.
Instances For
Remote Cache Service #
For internal use only.
Equations
- One or more equations did not get rendered due to their size.
Instances For
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).
- impl : CacheServiceImpl
Instances For
Returns the name (if any) used to identify the service.
Equations
- service.name? = Lake.CacheServiceImpl.name?✝ (Lake.CacheService.impl✝ service)
Instances For
Returns whether this is a Reservoir cache service configuration.
Equations
- service.isReservoir = Lake.CacheServiceImpl.isReservoir✝ (Lake.CacheService.impl✝ service)
Instances For
Constructors #
Constructs a CacheService for a Reservoir endpoint.
Equations
Instances For
Constructs a CacheService to upload artifacts and/or outputs to an S3 endpoint.
Equations
Instances For
Constructs a CacheService to download artifacts and/or outputs from an S3 endpoint.
Equations
Instances For
Constructs a CacheService to download just artifacts from an S3 endpoint.
Equations
Instances For
Reconfigures the cache service to use the provided key (for uploads).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Artifact Transfer #
The MIME type of a 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
Multi-Artifact Transfer #
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
Output Transfer #
The MIME type of a 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.