Documentation

Lake.Config.Cache

Cache Map #

Instances For
    @[reducible, inline]

    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
      Instances For
        def Lake.CacheMap.parse (inputName contents : String) (platformIndependent : Bool := false) :

        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
          def Lake.CacheMap.load (file : System.FilePath) (platformIndependent : Bool := false) :

          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
            def Lake.CacheMap.load? (file : System.FilePath) (platformIndependent : Bool := false) :

            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
                def Lake.CacheMap.writeFile (file : System.FilePath) (cache : CacheMap) (platformIndependent : Bool := false) :

                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
                  def Lake.CacheMap.get? (inputHash : Hash) (cache : CacheMap) :

                  Returns the output data associated with the input hash in the cache.

                  Equations
                  Instances For
                    @[inline]
                    def Lake.CacheMap.insert {α : Type u_1} [Lean.ToJson α] (inputHash : Hash) (val : α) (cache : CacheMap) (platformIndependent : Bool := false) :

                    Associate output data with the given the input hash.

                    Equations
                    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 #

                        @[reducible, inline]

                        A mutable reference to a CacheMap.

                        Equations
                        Instances For
                          @[inline]
                          Equations
                          Instances For
                            @[inline]
                            def Lake.CacheRef.get? (inputHash : Hash) (cache : CacheRef) :

                            Returns the output data associated with the input hash in the cache.

                            Equations
                            Instances For
                              @[inline]
                              def Lake.CacheRef.insert {α : Type u_1} [Lean.ToJson α] (inputHash : Hash) (val : α) (cache : CacheRef) (platformIndependent : Bool := false) :

                              Associate output data with the given the input hash.

                              Equations
                              Instances For

                                Cache Service Name #

                                The type of service identifiers used by the Lake ache.

                                Instances For

                                  The identifier used for the default Reservoir service (i.e., reservoir).

                                  Equations
                                  Instances For
                                    @[inline]

                                    Constructs a service identifier from a user-provided name.

                                    Equations
                                    Instances For
                                      @[inline]

                                      Returns the string representation of the service identifier.

                                      Equations
                                      Instances For

                                        Cache Service Scope #

                                        The type of artifact prefixes in a Lake cache service.

                                        Instances For

                                          Constructs a generic service scope from a user-provided string.

                                          Equations
                                          Instances For

                                            Constructs a service scope from a GitHub repository name.

                                            Equations
                                            Instances For

                                              Returns whether this is a repository scope.

                                              Equations
                                              Instances For

                                                Returns a string representation of the scope.

                                                Equations
                                                Instances For

                                                  Cache Output #

                                                  The current version of the output file format.

                                                  Equations
                                                  Instances For
                                                    Instances For
                                                      @[inline]

                                                      For internal use only.

                                                      Equations
                                                      Instances For
                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          Equations
                                                          Instances For

                                                            Local Cache #

                                                            structure Lake.Cache :

                                                            The Lake cache directory.

                                                            Instances For
                                                              @[inline]

                                                              Returns the artifact directory for the Lake cache.

                                                              Equations
                                                              Instances For
                                                                @[inline]
                                                                def Lake.Cache.artifactPath (cache : Cache) (contentHash : Hash) (ext : String := "art") :

                                                                Returns the path to artifact in the Lake cache with extension ext.

                                                                Equations
                                                                Instances For
                                                                  @[deprecated "Deprecated without replacelement." (since := "2025-03-04")]

                                                                  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
                                                                    @[deprecated "Deprecated without replacelement." (since := "2025-03-04")]

                                                                    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
                                                                      @[inline]

                                                                      The directory where input-to-output mappings are stored in the Lake cache.

                                                                      Equations
                                                                      Instances For
                                                                        @[inline]
                                                                        def Lake.Cache.outputsFile (cache : Cache) (scope : String) (inputHash : Hash) :

                                                                        The file containing the outputs of the given input for the package.

                                                                        Equations
                                                                        Instances For
                                                                          @[inline]
                                                                          def Lake.Cache.writeOutputs {α : Type u_1} [Lean.ToJson α] (cache : Cache) (scope : String) (inputHash : Hash) (outputs : α) :

                                                                          Cache the outputs corresponding to the given input for the package.

                                                                          Equations
                                                                          Instances For
                                                                            def Lake.Cache.writeMap (cache : Cache) (scope : String) (map : CacheMap) (service? : Option CacheServiceName := none) (remoteScope? : Option CacheServiceScope := none) :

                                                                            Cache the input-to-outputs mappings from a CacheMap.

                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For
                                                                              def Lake.Cache.readOutputs? (cache : Cache) (scope : String) (inputHash : Hash) :

                                                                              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
                                                                                @[inline]

                                                                                The directory where input-to-output mappings of downloaded package revisions are cached.

                                                                                Equations
                                                                                Instances For
                                                                                  @[inline]

                                                                                  Returns path to the input-to-output mappings of a downloaded package revision.

                                                                                  Equations
                                                                                  Instances For

                                                                                    Cache Platform #

                                                                                    The type of platform identifiers used by the Lake ache.

                                                                                    Instances For

                                                                                      An indicator that no platform should be included in a cache scope.

                                                                                      Equations
                                                                                      Instances For
                                                                                        @[inline]

                                                                                        Returns true if this platform identifier is the none indicator.

                                                                                        Equations
                                                                                        Instances For

                                                                                          The identifier of the host platform (e.g., System.Platform.target).

                                                                                          Equations
                                                                                          Instances For
                                                                                            @[inline]

                                                                                            Constructs a platform identifier from a user-provided string.

                                                                                            Equations
                                                                                            Instances For

                                                                                              Returns the length of the platform identifier in Unicode code points.

                                                                                              Equations
                                                                                              Instances For

                                                                                                Returns a string representation of the platform identifier.

                                                                                                Equations
                                                                                                Instances For

                                                                                                  Cache Toolchain #

                                                                                                  The type of toolchain identifiers used by the Lake ache.

                                                                                                  Instances For

                                                                                                    An indicator that no toolchain should be included in a cache scope.

                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      @[inline]

                                                                                                      Returns true if this toolchain identifier is the none indicator.

                                                                                                      Equations
                                                                                                      Instances For

                                                                                                        Constructs a toolchain identifier from a user-provided string.

                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          @[inline]

                                                                                                          For internal use only. See Lake.Env.cacheToolchain.

                                                                                                          Equations
                                                                                                          Instances For

                                                                                                            Returns the length of the toolchain identifier in Unicode code points.

                                                                                                            Equations
                                                                                                            Instances For

                                                                                                              Returns a string representation of the toolchain identifier.

                                                                                                              Equations
                                                                                                              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).

                                                                                                                  Instances For
                                                                                                                    @[inline]

                                                                                                                    Returns the name (if any) used to identify the service.

                                                                                                                    Equations
                                                                                                                    Instances For
                                                                                                                      @[inline]

                                                                                                                      Returns whether this is a Reservoir cache service configuration.

                                                                                                                      Equations
                                                                                                                      Instances For

                                                                                                                        Constructors #

                                                                                                                        @[inline]

                                                                                                                        Constructs a CacheService for a Reservoir endpoint.

                                                                                                                        Equations
                                                                                                                        Instances For
                                                                                                                          @[inline]
                                                                                                                          def Lake.CacheService.uploadService (key artifactEndpoint revisionEndpoint : String) :

                                                                                                                          Constructs a CacheService to upload artifacts and/or outputs to an S3 endpoint.

                                                                                                                          Equations
                                                                                                                          Instances For
                                                                                                                            @[inline]
                                                                                                                            def Lake.CacheService.downloadService (artifactEndpoint revisionEndpoint : String) (name? : Option CacheServiceName := none) :

                                                                                                                            Constructs a CacheService to download artifacts and/or outputs from an S3 endpoint.

                                                                                                                            Equations
                                                                                                                            Instances For
                                                                                                                              @[inline]

                                                                                                                              Constructs a CacheService to download just artifacts from an S3 endpoint.

                                                                                                                              Equations
                                                                                                                              Instances For
                                                                                                                                @[inline]

                                                                                                                                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
                                                                                                                                  Instances For
                                                                                                                                    def Lake.CacheService.artifactUrl (contentHash : Hash) (service : CacheService) (scope : CacheServiceScope) :
                                                                                                                                    Equations
                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                    Instances For
                                                                                                                                      def Lake.CacheService.downloadArtifact (descr : ArtifactDescr) (cache : Cache) (service : CacheService) (scope : CacheServiceScope) (force : Bool := false) :
                                                                                                                                      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
                                                                                                                                            @[deprecated "Deprecated without replacement." (since := "2026-02-27")]
                                                                                                                                            def Lake.CacheService.downloadOutputArtifacts (map : CacheMap) (cache : Cache) (service : CacheService) (localScope : String) (remoteScope : CacheServiceScope) (force : Bool := false) :
                                                                                                                                            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
                                                                                                                                                Instances For
                                                                                                                                                  Equations
                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                  Instances For
                                                                                                                                                    def Lake.CacheService.downloadRevisionOutputs? (rev : String) (cache : Cache) (service : CacheService) (localScope : String) (remoteScope : CacheServiceScope) (platform : CachePlatform := CachePlatform.none) (toolchain : CacheToolchain := CacheToolchain.none) (force : Bool := false) :
                                                                                                                                                    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