Documentation

Lake.Config.Cache

Cache Map #

@[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.

Instances For

    The current version of the input-to-output mappings file format.

    Instances For
      def Lake.CacheMap.parse (inputName contents : String) :

      Parse a Cache from a JSON Lines string.

      Instances For

        Loads a CacheMap from a JSON Lines file. Errors if the file is ill-formatted or the read fails for other reasons.

        Instances For

          Save a CacheMap to a JSON Lines file. Entries already in the file but not in the map will not be removed.

          Instances For

            Write a CacheMap to a JSON Lines file.

            Instances For
              def Lake.CacheMap.get? (inputHash : Hash) (cache : CacheMap) :

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

              Instances For
                def Lake.CacheMap.insertCore (inputHash : Hash) (val : Lean.Json) (cache : CacheMap) :

                Associate output data (as JSON) with the given the input hash.

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

                  Associate output data with the given the input hash.

                  Instances For

                    Extract each output from their structured data into a flat array of artifact descriptions.

                    Instances For

                      Cache Ref #

                      @[reducible, inline]

                      A mutable reference to a CacheMap.

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

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

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

                            Associate output data with the given the input hash.

                            Instances For

                              Local Cache #

                              structure Lake.Cache :

                              The Lake cache directory.

                              Instances For
                                @[implicit_reducible]
                                @[inline]

                                Returns the artifact directory for the Lake cache.

                                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.

                                  Instances For

                                    Returns the artifact in the Lake cache corresponding the given artifact description.

                                    Instances For

                                      Returns the artifact in the Lake cache corresponding the given artifact description. Errors if missing.

                                      Instances For

                                        Returns path to the artifact for each output. Errors if any are missing.

                                        Instances For
                                          @[inline]

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

                                          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.

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

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

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

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

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

                                                  Instances For
                                                    @[inline]

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

                                                    Instances For
                                                      @[inline]

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

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

                                                        Instances For
                                                          @[inline]

                                                          Returns the name (if any) used to identifier the service in cached ouptuts.

                                                          Instances For
                                                            @[inline]

                                                            Returns whether this is a Reservoir cache service configuration.

                                                            Instances For

                                                              Constructors #

                                                              @[inline]
                                                              def Lake.CacheService.reservoirService (apiEndpoint : String) (name? : Option String := some "reservoir") :

                                                              Constructs a CacheService for a Reservoir endpoint.

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

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

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

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

                                                                  Instances For
                                                                    @[inline]

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

                                                                    Instances For
                                                                      @[inline]

                                                                      Reconfigures the cache service to use the provided key (for uploads).

                                                                      Instances For
                                                                        @[inline]

                                                                        Reconfigures the cache service to interpret scopes as repositories (or not if false).

                                                                        For custom endpoints, if true, Lake will augment the provided scope with toolchain and platform information in a manner similar to Reservoir.

                                                                        Instances For

                                                                          Artifact Transfer #

                                                                          The MIME type of Lake/Reservoir artifact.

                                                                          Instances For
                                                                            def Lake.CacheService.artifactUrl (contentHash : Hash) (service : CacheService) (scope : String) :
                                                                            Instances For
                                                                              def Lake.CacheService.downloadArtifact (descr : ArtifactDescr) (cache : Cache) (service : CacheService) (scope : String) (force : Bool := false) :
                                                                              Instances For
                                                                                def Lake.CacheService.downloadArtifacts (descrs : Array ArtifactDescr) (cache : Cache) (service : CacheService) (scope : String) (force : Bool := false) :
                                                                                Instances For
                                                                                  def Lake.CacheService.downloadOutputArtifacts (map : CacheMap) (cache : Cache) (service : CacheService) (localScope remoteScope : String) (force : Bool := false) :
                                                                                  Instances For
                                                                                    def Lake.CacheService.uploadArtifact (contentHash : Hash) (art : System.FilePath) (service : CacheService) (scope : String) :
                                                                                    Instances For
                                                                                      Instances For

                                                                                        Output Transfer #

                                                                                        The MIME type of Lake/Reservoir input-to-output mappings for a Git revision.

                                                                                        Instances For
                                                                                          def Lake.CacheService.revisionUrl (rev : String) (service : CacheService) (scope : String) (platform toolchain : String := "") :
                                                                                          Instances For
                                                                                            def Lake.CacheService.downloadRevisionOutputs? (rev : String) (cache : Cache) (service : CacheService) (localScope remoteScope : String) (platform toolchain : String := "") (force : Bool := false) :
                                                                                            Instances For
                                                                                              def Lake.CacheService.uploadRevisionOutputs (rev : String) (outputs : System.FilePath) (service : CacheService) (scope : String) (platform toolchain : String := "") :
                                                                                              Instances For