unity-builder/src/model/cloud-runner/services/shared-workspace-locking.ts

204 lines
7.4 KiB
TypeScript
Raw Normal View History

2022-10-14 19:04:14 +00:00
import { CloudRunnerSystem } from './cloud-runner-system';
2022-09-16 22:51:19 +00:00
import * as fs from 'fs';
2022-10-14 19:04:14 +00:00
import CloudRunnerLogger from './cloud-runner-logger';
import CloudRunnerOptions from '../cloud-runner-options';
import BuildParameters from '../../build-parameters';
2022-09-16 21:24:23 +00:00
export class SharedWorkspaceLocking {
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
private static readonly workspaceRoot = `s3://game-ci-test-storage/locks/`;
public static async GetAllWorkspaces(buildParametersContext: BuildParameters): Promise<string[]> {
return (
await SharedWorkspaceLocking.ReadLines(
`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/`,
)
).map((x) => x.replace(`/`, ``));
}
public static async DoesWorkspaceTopLevelExist(buildParametersContext: BuildParameters) {
const results = (await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}`)).map(
(x) => x.replace(`/`, ``),
);
return results.includes(buildParametersContext.cacheKey);
}
public static async GetAllLocks(workspace: string, buildParametersContext: BuildParameters): Promise<string[]> {
if (!(await SharedWorkspaceLocking.DoesWorkspaceExist(workspace, buildParametersContext))) {
throw new Error("Workspace doesn't exist, can't call get all locks");
}
return (
await SharedWorkspaceLocking.ReadLines(
`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/${workspace}/`,
)
).map((x) => x.replace(`/`, ``));
}
public static async GetOrCreateLockedWorkspace(
workspaceIfCreated: string,
runId: string,
buildParametersContext: BuildParameters,
) {
2022-09-17 03:41:41 +00:00
if (!CloudRunnerOptions.retainWorkspaces) {
return;
}
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
CloudRunnerLogger.log(`run agent ${runId} is trying to access a workspace`);
if (await SharedWorkspaceLocking.DoesWorkspaceTopLevelExist(buildParametersContext)) {
const workspaces = await SharedWorkspaceLocking.GetFreeWorkspaces(buildParametersContext);
for (const element of workspaces) {
if (await SharedWorkspaceLocking.LockWorkspace(element, runId, buildParametersContext)) {
CloudRunnerLogger.log(`run agent ${runId} locked workspace: ${element}`);
return element;
}
2022-09-16 21:24:23 +00:00
}
}
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
const workspace = await SharedWorkspaceLocking.CreateWorkspace(workspaceIfCreated, buildParametersContext, runId);
CloudRunnerLogger.log(`run agent ${runId} didn't find a free workspace so created: ${workspace}`);
return workspace;
}
public static async DoesWorkspaceExist(workspace: string, buildParametersContext: BuildParameters) {
return (await SharedWorkspaceLocking.GetAllWorkspaces(buildParametersContext)).includes(workspace);
2022-09-16 21:24:23 +00:00
}
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
public static async HasWorkspaceLock(
workspace: string,
runId: string,
buildParametersContext: BuildParameters,
): Promise<boolean> {
if (!(await SharedWorkspaceLocking.DoesWorkspaceExist(workspace, buildParametersContext))) {
return false;
}
2022-10-14 18:51:16 +00:00
CloudRunnerLogger.log(`Checking has workspace ${workspace} was locked`);
const locks = await SharedWorkspaceLocking.GetAllLocks(workspace, buildParametersContext);
const includesRunLock = locks.filter((x) => x.includes(runId)).length > 0;
CloudRunnerLogger.log(`Locks ${locks}, includes ${includesRunLock}`);
2022-09-16 21:24:23 +00:00
2022-10-14 18:51:16 +00:00
return includesRunLock;
2022-09-29 21:03:16 +00:00
}
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
public static async GetFreeWorkspaces(buildParametersContext: BuildParameters): Promise<string[]> {
2022-09-29 20:30:34 +00:00
const result: string[] = [];
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
const workspaces = await SharedWorkspaceLocking.GetAllWorkspaces(buildParametersContext);
2022-09-29 20:30:34 +00:00
for (const element of workspaces) {
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
if (!(await SharedWorkspaceLocking.IsWorkspaceLocked(element, buildParametersContext))) {
2022-09-29 20:30:34 +00:00
result.push(element);
}
}
return result;
}
2022-09-29 21:03:16 +00:00
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
public static async IsWorkspaceLocked(workspace: string, buildParametersContext: BuildParameters): Promise<boolean> {
if (!(await SharedWorkspaceLocking.DoesWorkspaceExist(workspace, buildParametersContext))) {
return false;
}
const files = await SharedWorkspaceLocking.ReadLines(
`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/${workspace}/`,
2022-09-29 20:30:34 +00:00
);
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
const workspaceFileDoesNotExists =
files.filter((x) => {
return x.includes(`_workspace`);
}).length === 0;
const lockFilesExist =
files.filter((x) => {
return x.includes(`_lock`);
}).length > 0;
return workspaceFileDoesNotExists || lockFilesExist;
2022-09-29 20:30:34 +00:00
}
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
public static async CreateWorkspace(workspace: string, buildParametersContext: BuildParameters, lockId: string = ``) {
if (lockId !== ``) {
await SharedWorkspaceLocking.LockWorkspace(workspace, lockId, buildParametersContext);
}
2022-09-29 20:30:34 +00:00
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
const file = `${Date.now()}_workspace`;
fs.writeFileSync(file, '');
await CloudRunnerSystem.Run(
`aws s3 cp ./${file} ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/${workspace}/${file}`,
false,
true,
);
fs.rmSync(file);
2022-09-29 20:30:34 +00:00
2022-10-14 18:51:16 +00:00
const workspaces = await SharedWorkspaceLocking.ReadLines(
`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/`,
);
CloudRunnerLogger.log(`All workspaces ${workspaces}`);
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
return workspace;
2022-09-16 21:24:23 +00:00
}
2022-09-29 20:30:34 +00:00
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
public static async LockWorkspace(
workspace: string,
runId: string,
buildParametersContext: BuildParameters,
): Promise<boolean> {
2022-09-29 20:30:34 +00:00
const file = `${Date.now()}_${runId}_lock`;
2022-09-16 22:51:19 +00:00
fs.writeFileSync(file, '');
2022-09-29 20:30:34 +00:00
await CloudRunnerSystem.Run(
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
`aws s3 cp ./${file} ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/${workspace}/${file}`,
2022-09-29 20:30:34 +00:00
false,
true,
);
2022-09-16 22:51:19 +00:00
fs.rmSync(file);
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
return SharedWorkspaceLocking.HasWorkspaceLock(workspace, runId, buildParametersContext);
2022-09-16 22:51:19 +00:00
}
2022-09-29 20:30:34 +00:00
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
public static async ReleaseWorkspace(
workspace: string,
runId: string,
buildParametersContext: BuildParameters,
): Promise<boolean> {
if (!(await SharedWorkspaceLocking.DoesWorkspaceExist(workspace, buildParametersContext))) {
2022-09-29 21:25:43 +00:00
return true;
}
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
const file = (await SharedWorkspaceLocking.GetAllLocks(workspace, buildParametersContext)).filter((x) =>
x.includes(`_${runId}_lock`),
);
CloudRunnerLogger.log(
`${JSON.stringify(await SharedWorkspaceLocking.GetAllLocks(workspace, buildParametersContext))}`,
);
2022-09-29 20:30:34 +00:00
CloudRunnerLogger.log(`Deleting file ${file}`);
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
CloudRunnerLogger.log(
`aws s3 rm ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/${workspace}/${file}`,
);
await CloudRunnerSystem.Run(
`aws s3 rm ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/${workspace}/${file}`,
false,
true,
);
2022-09-29 20:30:34 +00:00
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
return !SharedWorkspaceLocking.HasWorkspaceLock(workspace, runId, buildParametersContext);
2022-09-29 20:30:34 +00:00
}
2022-09-17 04:09:36 +00:00
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
public static async CleanupWorkspace(workspace: string, buildParametersContext: BuildParameters) {
2022-09-29 20:30:34 +00:00
await CloudRunnerSystem.Run(
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
`aws s3 rm ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/${workspace} --recursive`,
2022-09-29 20:30:34 +00:00
false,
true,
);
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
}
2022-09-17 04:44:07 +00:00
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
private static async ReadLines(command: string): Promise<string[]> {
const result = await CloudRunnerSystem.Run(command, false, true);
return result
.split(`\n`)
.map((x) => x.replace(`\r`, ``))
.filter((x) => x !== ``)
.map((x) => {
const lineValues = x.split(` `);
return lineValues[lineValues.length - 1];
});
2022-09-17 04:09:36 +00:00
}
2022-09-16 21:24:23 +00:00
}
2022-09-16 18:48:40 +00:00
export default SharedWorkspaceLocking;