Treatment saveCache
work/cache::saveCache
Parameters
↳ var parallel: u32 = 4
Inputs
⇥ filesystem: Block<FileSystem> (fs/filesystem::FileSystem)
⇥ name: Block<string>
⇥ path: Block<string>
Outputs
↦ completed: Block<void>
↦ error: Block<string>
↦ failed: Block<void>
↦ finished: Block<void>
Save a cache on api.melodium.tech.
The directory at path of filesystem is saved as the cache name of the run, a new version
of it that restores get once its upload completes, the last completed one being the current.
completed is emitted once saved, including when it holds what the current version already
holds, api.melodium.tech then keeping that one.
The directory is archived (fs/archive::tar, sorted, keeping modification times so that the
same content gives the same archive), searched for revealed secret values
(std/secret::scan), compressed with zstd, and uploaded in parts, all at once: memory holds a
few parts, whatever the size of the cache, and nothing is written next to path.
parallel parts are uploaded at once.
If a revealed secret value is found in the archive, the save is aborted and error names the
secret. If the directory cannot be archived, api.melodium.tech refuses the save (such as when
the storage of the organization is full), or a part cannot be uploaded, the save is aborted too,
leaving nothing in storage, and error gives the reason. failed is then emitted.
finished is emitted in every case.
Caches are only saved by programs run by api.melodium.tech.