diff --git a/.github/workflows/cloud-runner-ci-pipeline.yml b/.github/workflows/cloud-runner-ci-pipeline.yml index 184df883..47a3410a 100644 --- a/.github/workflows/cloud-runner-ci-pipeline.yml +++ b/.github/workflows/cloud-runner-ci-pipeline.yml @@ -42,7 +42,6 @@ jobs: - 'cloud-runner-end2end-locking' - 'cloud-runner-end2end-caching' - 'cloud-runner-end2end-retaining' - - 'cloud-runner-remote-client' - 'cloud-runner-caching' - 'cloud-runner-environment' - 'cloud-runner-image' diff --git a/dist/index.js b/dist/index.js index 7a5c6643..2f22f8e3 100644 Binary files a/dist/index.js and b/dist/index.js differ diff --git a/dist/index.js.map b/dist/index.js.map index c7afea0a..3f0b11ae 100644 Binary files a/dist/index.js.map and b/dist/index.js.map differ diff --git a/dist/licenses.txt b/dist/licenses.txt index 489190c1..d21d19f2 100644 Binary files a/dist/licenses.txt and b/dist/licenses.txt differ diff --git a/src/model/cloud-runner/providers/k8s/kubernetes-task-runner.ts b/src/model/cloud-runner/providers/k8s/kubernetes-task-runner.ts index 0123dd71..26b97376 100644 --- a/src/model/cloud-runner/providers/k8s/kubernetes-task-runner.ts +++ b/src/model/cloud-runner/providers/k8s/kubernetes-task-runner.ts @@ -5,7 +5,6 @@ import { CloudRunnerSystem } from '../../services/core/cloud-runner-system'; import CloudRunner from '../../cloud-runner'; import KubernetesPods from './kubernetes-pods'; import { FollowLogStreamService } from '../../services/core/follow-log-stream-service'; -import { RemoteClientLogger } from '../../remote-client/remote-client-logger'; class KubernetesTaskRunner { static readonly maxRetry: number = 3; @@ -39,27 +38,6 @@ class KubernetesTaskRunner { // split output chunk and handle per line for (const chunk of outputChunk.split(`\n`)) { - // check if log start included in logs if so log a message - if (chunk.includes(`Collected Logs`)) { - CloudRunnerLogger.log(`Log Start found in logs`); - } - if (chunk.includes(`LOGHASH:`)) { - RemoteClientLogger.HandleLogHash(chunk); - CloudRunnerLogger.log(`Loghash found`); - } - if (chunk.includes(`LOGS:`)) { - CloudRunnerLogger.log(`LOGS: found`); - - // remove "LOGS: " and decode base64 remaining - const unpacked = Buffer.from(chunk.split(`LOGS: `)[1], 'base64').toString('ascii'); - const result = RemoteClientLogger.HandleLogFull(unpacked); - CloudRunnerLogger.log(`Logs found HandleLogChunkLineResult:${result}`); - if (result) { - FollowLogStreamService.DidReceiveEndOfTransmission = true; - } - - return; - } ({ shouldReadLogs, shouldCleanup, output } = FollowLogStreamService.handleIteration( chunk, shouldReadLogs, diff --git a/src/model/cloud-runner/remote-client/remote-client-logger.ts b/src/model/cloud-runner/remote-client/remote-client-logger.ts index 0aa2f5e9..013be0c4 100644 --- a/src/model/cloud-runner/remote-client/remote-client-logger.ts +++ b/src/model/cloud-runner/remote-client/remote-client-logger.ts @@ -3,7 +3,6 @@ import fs from 'node:fs'; import path from 'node:path'; import CloudRunner from '../cloud-runner'; import CloudRunnerOptions from '../options/cloud-runner-options'; -import * as md5 from 'ts-md5'; export class RemoteClientLogger { private static get LogFilePath() { @@ -71,44 +70,13 @@ export class RemoteClientLogger { // } } public static HandleLog(message: string): boolean { - if (message.includes('LOGHASH: ')) { - RemoteClientLogger.HandleLogHash(message); - } else { - if (RemoteClientLogger.value !== '') { - RemoteClientLogger.value += `\n`; - } - - RemoteClientLogger.value += message; - const hashedValue = md5.Md5.hashStr(RemoteClientLogger.value); - if (RemoteClientLogger.md5 === hashedValue) { - CloudRunnerLogger.log(`LOG COMPLETE`); - - return true; - } + if (RemoteClientLogger.value !== '') { + RemoteClientLogger.value += `\n`; } - return false; - } - public static HandleLogHash(message: string) { - if (message.includes('LOGHASH: ')) { - RemoteClientLogger.md5 = message.split(`LOGHASH: `)[1]; - CloudRunnerLogger.log(`LOGHASH: ${RemoteClientLogger.md5}`); - } else { - throw new Error(`LOGHASH: not found`); - } - } - public static HandleLogFull(message: string): boolean { - const hashedValue = md5.Md5.hashStr(message); - if (RemoteClientLogger.md5 === hashedValue) { - CloudRunnerLogger.log(`LOG COMPLETE`); - - return true; - } else { - CloudRunnerLogger.log(`LOG INCOMPLETE ${RemoteClientLogger.md5} ${hashedValue}`); - } + RemoteClientLogger.value += message; return false; } static value: string = ''; - static md5: any; } diff --git a/src/model/cloud-runner/tests/e2e/cloud-runner-remote-client.test.ts b/src/model/cloud-runner/tests/e2e/cloud-runner-remote-client.test.ts deleted file mode 100644 index e08e67d2..00000000 --- a/src/model/cloud-runner/tests/e2e/cloud-runner-remote-client.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { RemoteClientLogger } from '../../remote-client/remote-client-logger'; -import setups from '../cloud-runner-suite.test'; -const md5 = require('md5'); - -describe('Cloud Runner Remote Client', () => { - it('Responds', () => {}); - setups(); - it('Loghash digestion input matches output', async () => { - const testLogStream = 'Test \n Log \n Stream'; - - const splitLogStream = testLogStream.split('\n'); - RemoteClientLogger.HandleLog(`LOGHASH: ${md5(testLogStream)}`); - let completed = false; - for (const element of splitLogStream) { - completed = RemoteClientLogger.HandleLog(element); - } - expect(completed).toBeTruthy(); - }, 1_000_000_000); - // eslint-disable-next-line unicorn/consistent-function-scoping, no-unused-vars - function CreateLogWatcher(callback: (finalMessage: string) => void) { - return (message: string) => { - callback(message); - }; - } -});