no wait, just repeat logs

This commit is contained in:
Frostebite 2023-08-16 00:39:32 +01:00
parent a31896bdeb
commit eba396b69e
6 changed files with 62 additions and 6 deletions

View File

@ -118,6 +118,7 @@ jobs:
- 'cloud-runner-end2end-locking'
- 'cloud-runner-end2end-caching'
- 'cloud-runner-end2end-retaining'
- 'cloud-runner-end2end-kubernetes'
- 'cloud-runner-environment'
- 'cloud-runner-github-checks'
steps:

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -34,6 +34,7 @@ class KubernetesTaskRunner {
`Streaming logs from pod: ${podName} container: ${containerName} namespace: ${namespace} ${CloudRunner.buildParameters.kubeVolumeSize}/${CloudRunner.buildParameters.containerCpu}/${CloudRunner.buildParameters.containerMemory}\n${lastReceivedMessage}`,
);
if (KubernetesTaskRunner.lastReceivedTimestamp > 0) {
CloudRunnerLogger.log(`Last received timestamp was set, including --since-time parameter`);
const currentDate = new Date(KubernetesTaskRunner.lastReceivedTimestamp);
const dateTimeIsoString = currentDate.toISOString();
sinceTime = ` --since-time="${dateTimeIsoString}"`;

View File

@ -43,13 +43,16 @@ export class RemoteClientLogger {
hashedLogs = await await CloudRunnerSystem.Run(`md5sum ${RemoteClientLogger.LogFilePath}`);
for (let index = 0; index < 3; index++) {
CloudRunnerLogger.log(`LOGHASH: ${hashedLogs}`);
const logs = fs.readFileSync(RemoteClientLogger.LogFilePath).toString();
CloudRunnerLogger.log(logs);
CloudRunnerLogger.log(`LOGS: ${Buffer.from(logs).toString('base64')}`);
CloudRunnerLogger.log(
`Game CI's "Cloud Runner System" will cancel the log when it has successfully received the log data to verify all logs have been received.`,
);
// loop for 5 mins logging the logs every minute
for (let index = 0; index < 2; index++) {
CloudRunnerLogger.log(logs);
// wait for 15 seconds to allow the log to be sent
await new Promise((resolve) => setTimeout(resolve, 15000));
}
}
}

View File

@ -0,0 +1,51 @@
import CloudRunner from '../../cloud-runner';
import UnityVersioning from '../../../unity-versioning';
import { Cli } from '../../../cli/cli';
import CloudRunnerLogger from '../../services/core/cloud-runner-logger';
import { v4 as uuidv4 } from 'uuid';
import CloudRunnerOptions from '../../options/cloud-runner-options';
import setups from '../cloud-runner-suite.test';
import BuildParameters from '../../../build-parameters';
import ImageTag from '../../../image-tag';
async function CreateParameters(overrides: any) {
if (overrides) {
Cli.options = overrides;
}
return await BuildParameters.create();
}
describe('Cloud Runner Kubernetes', () => {
it('Responds', () => {});
setups();
if (CloudRunnerOptions.cloudRunnerDebug) {
it('Run one build it using K8s without error', async () => {
if (CloudRunnerOptions.providerStrategy !== `k8s`) {
return;
}
const overrides = {
versioning: 'None',
projectPath: 'test-project',
unityVersion: UnityVersioning.determineUnityVersion('test-project', UnityVersioning.read('test-project')),
targetPlatform: 'StandaloneLinux64',
cacheKey: `test-case-${uuidv4()}`,
containerHookFiles: `debug-cache`,
};
const buildParameter = await CreateParameters(overrides);
expect(buildParameter.projectPath).toEqual(overrides.projectPath);
const baseImage = new ImageTag(buildParameter);
const results = await CloudRunner.run(buildParameter, baseImage.toString());
const libraryString = 'Rebuilding Library because the asset database could not be found!';
const cachePushFail = 'Did not push source folder to cache because it was empty Library';
const buildSucceededString = 'Build succeeded';
expect(results).toContain(libraryString);
expect(results).toContain(buildSucceededString);
expect(results).not.toContain(cachePushFail);
CloudRunnerLogger.log(`run 1 succeeded`);
}, 1_000_000_000);
}
});