Caching cleanup
parent
2b3f235527
commit
212c29e52a
|
|
@ -544,16 +544,14 @@ class Caching {
|
|||
process.chdir(`${sourceFolder}/..`);
|
||||
if (__1.Input.cloudRunnerTests) {
|
||||
cloud_runner_logger_1.default.log(`Hashed cache folder ${yield lfs_hashing_1.LFSHashing.hashAllFiles(sourceFolder)}`);
|
||||
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${sourceFolder}`);
|
||||
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${cacheFolder}`);
|
||||
}
|
||||
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`zip -q -r ${cacheKey} ${path_1.default.basename(sourceFolder)}`);
|
||||
console_1.assert(fs_1.default.existsSync(`${cacheKey}`));
|
||||
console_1.assert(cacheFolder);
|
||||
console_1.assert(sourceFolder);
|
||||
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`mv ${cacheKey}.zip ${cacheFolder}`);
|
||||
remote_client_logger_1.RemoteClientLogger.log(`moved ${cacheKey}.zip to ${cacheFolder}`);
|
||||
if (__1.Input.cloudRunnerTests) {
|
||||
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${cacheFolder}`);
|
||||
}
|
||||
console_1.assert(path_1.default.join(cacheFolder, `${cacheKey}.zip`));
|
||||
if (__1.Input.cloudRunnerTests) {
|
||||
yield Caching.printFullCacheHierarchySize();
|
||||
}
|
||||
|
|
@ -577,13 +575,8 @@ class Caching {
|
|||
.replace(/\n/g, ``)
|
||||
.replace('.zip', '');
|
||||
process.chdir(cacheFolder);
|
||||
if (__1.Input.cloudRunnerTests) {
|
||||
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${cacheFolder}`);
|
||||
}
|
||||
const cacheSelection = cacheKey !== `` && fs_1.default.existsSync(cacheKey) ? cacheKey : latestInBranch;
|
||||
if (__1.Input.cloudRunnerTests) {
|
||||
yield cloud_runner_logger_1.default.log(`cache key ${cacheKey} selection ${cacheSelection}`);
|
||||
}
|
||||
yield cloud_runner_logger_1.default.log(`cache key ${cacheKey} selection ${cacheSelection}`);
|
||||
if (fs_1.default.existsSync(cacheSelection)) {
|
||||
if (__1.Input.cloudRunnerTests) {
|
||||
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${destinationFolder}`);
|
||||
|
|
@ -592,9 +585,7 @@ class Caching {
|
|||
console_1.assert(fs_1.default.existsSync(destinationFolder));
|
||||
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`unzip -q ${cacheSelection}.zip -d ${path_1.default.basename(destinationFolder)}`);
|
||||
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`mv ${path_1.default.basename(destinationFolder)}/* ${destinationFolder}`);
|
||||
if (__1.Input.cloudRunnerTests) {
|
||||
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${destinationFolder}`);
|
||||
}
|
||||
console_1.assert(path_1.default.join(destinationFolder, `${cacheSelection}.zip`));
|
||||
}
|
||||
else {
|
||||
remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -18,17 +18,16 @@ export class Caching {
|
|||
|
||||
if (Input.cloudRunnerTests) {
|
||||
CloudRunnerLogger.log(`Hashed cache folder ${await LFSHashing.hashAllFiles(sourceFolder)}`);
|
||||
await CloudRunnerAgentSystem.Run(`tree ${sourceFolder}`);
|
||||
await CloudRunnerAgentSystem.Run(`tree ${cacheFolder}`);
|
||||
}
|
||||
|
||||
await CloudRunnerAgentSystem.Run(`zip -q -r ${cacheKey} ${path.basename(sourceFolder)}`);
|
||||
assert(fs.existsSync(`${cacheKey}`));
|
||||
assert(cacheFolder);
|
||||
assert(sourceFolder);
|
||||
await CloudRunnerAgentSystem.Run(`mv ${cacheKey}.zip ${cacheFolder}`);
|
||||
RemoteClientLogger.log(`moved ${cacheKey}.zip to ${cacheFolder}`);
|
||||
assert(path.join(cacheFolder, `${cacheKey}.zip`));
|
||||
|
||||
if (Input.cloudRunnerTests) {
|
||||
await CloudRunnerAgentSystem.Run(`tree ${cacheFolder}`);
|
||||
}
|
||||
if (Input.cloudRunnerTests) {
|
||||
await Caching.printFullCacheHierarchySize();
|
||||
}
|
||||
|
|
@ -53,15 +52,8 @@ export class Caching {
|
|||
|
||||
process.chdir(cacheFolder);
|
||||
|
||||
if (Input.cloudRunnerTests) {
|
||||
await CloudRunnerAgentSystem.Run(`tree ${cacheFolder}`);
|
||||
}
|
||||
|
||||
const cacheSelection = cacheKey !== `` && fs.existsSync(cacheKey) ? cacheKey : latestInBranch;
|
||||
|
||||
if (Input.cloudRunnerTests) {
|
||||
await CloudRunnerLogger.log(`cache key ${cacheKey} selection ${cacheSelection}`);
|
||||
}
|
||||
await CloudRunnerLogger.log(`cache key ${cacheKey} selection ${cacheSelection}`);
|
||||
|
||||
if (fs.existsSync(cacheSelection)) {
|
||||
if (Input.cloudRunnerTests) {
|
||||
|
|
@ -71,9 +63,7 @@ export class Caching {
|
|||
assert(fs.existsSync(destinationFolder));
|
||||
await CloudRunnerAgentSystem.Run(`unzip -q ${cacheSelection}.zip -d ${path.basename(destinationFolder)}`);
|
||||
await CloudRunnerAgentSystem.Run(`mv ${path.basename(destinationFolder)}/* ${destinationFolder}`);
|
||||
if (Input.cloudRunnerTests) {
|
||||
await CloudRunnerAgentSystem.Run(`tree ${destinationFolder}`);
|
||||
}
|
||||
assert(path.join(destinationFolder, `${cacheSelection}.zip`));
|
||||
} else {
|
||||
RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);
|
||||
if (cacheSelection !== ``) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue