pr feedback

pull/767/head
Frostebite 2025-12-29 17:00:25 +00:00
parent 5acc6c83ee
commit 59e5531047
5 changed files with 77 additions and 24 deletions

1
$LOG_FILE 100644
View File

@ -0,0 +1 @@
cloud runner build workflow starting

36
dist/index.js vendored
View File

@ -4671,16 +4671,28 @@ class KubernetesTaskRunner {
`kubectl logs ${podName} -c ${containerName} -n ${namespace} 2>/dev/null || echo ""`,
];
for (const attempt of attempts) {
if (logFileContent && logFileContent.trim()) {
break; // We got content, no need to try more
// If we already have content with "Collected Logs", no need to try more
if (logFileContent && logFileContent.trim() && logFileContent.includes('Collected Logs')) {
cloud_runner_logger_1.default.log('Found "Collected Logs" in fallback content, stopping attempts.');
break;
}
try {
cloud_runner_logger_1.default.log(`Trying fallback method: ${attempt.substring(0, 80)}...`);
const result = await cloud_runner_system_1.CloudRunnerSystem.Run(attempt, true, true);
if (result && result.trim()) {
logFileContent = result;
cloud_runner_logger_1.default.log(`Successfully read logs using fallback method (${logFileContent.length} chars): ${attempt.substring(0, 50)}...`);
break;
// Prefer content that has "Collected Logs" over content that doesn't
if (!logFileContent || !logFileContent.includes('Collected Logs')) {
logFileContent = result;
cloud_runner_logger_1.default.log(`Successfully read logs using fallback method (${logFileContent.length} chars): ${attempt.substring(0, 50)}...`);
// If this content has "Collected Logs", we're done
if (logFileContent.includes('Collected Logs')) {
cloud_runner_logger_1.default.log('Fallback method successfully captured "Collected Logs".');
break;
}
}
else {
cloud_runner_logger_1.default.log(`Skipping this result - already have content with "Collected Logs".`);
}
}
else {
cloud_runner_logger_1.default.log(`Fallback method returned empty result: ${attempt.substring(0, 50)}...`);
@ -4718,13 +4730,19 @@ class KubernetesTaskRunner {
// Continue with existing output - this is a best-effort fallback
}
}
// If output is still empty after fallback attempts, add a warning message
// If output is still empty or missing "Collected Logs" after fallback attempts, add a warning message
// This ensures BuildResults is not completely empty, which would cause test failures
if (needsFallback && output.trim().length === 0) {
cloud_runner_logger_1.default.logWarning('Could not retrieve any logs from pod after all attempts. Pod may have been killed before logs were written.');
if ((needsFallback && output.trim().length === 0) || (!output.includes('Collected Logs') && shouldTryFallback)) {
cloud_runner_logger_1.default.logWarning('Could not retrieve "Collected Logs" from pod after all attempts. Pod may have been killed before logs were written.');
// Add a minimal message so BuildResults is not completely empty
// This helps with debugging and prevents test failures due to empty results
output = 'Pod logs unavailable - pod may have been terminated before logs could be collected.\n';
if (output.trim().length === 0) {
output = 'Pod logs unavailable - pod may have been terminated before logs could be collected.\n';
}
else if (!output.includes('Collected Logs')) {
// We have some output but missing "Collected Logs" - append the fallback message
output += '\nPod logs incomplete - "Collected Logs" marker not found. Pod may have been terminated before post-build completed.\n';
}
}
}
catch (fallbackError) {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -262,21 +262,32 @@ class KubernetesTaskRunner {
];
for (const attempt of attempts) {
if (logFileContent && logFileContent.trim()) {
break; // We got content, no need to try more
// If we already have content with "Collected Logs", no need to try more
if (logFileContent && logFileContent.trim() && logFileContent.includes('Collected Logs')) {
CloudRunnerLogger.log('Found "Collected Logs" in fallback content, stopping attempts.');
break;
}
try {
CloudRunnerLogger.log(`Trying fallback method: ${attempt.substring(0, 80)}...`);
const result = await CloudRunnerSystem.Run(attempt, true, true);
if (result && result.trim()) {
logFileContent = result;
CloudRunnerLogger.log(
`Successfully read logs using fallback method (${logFileContent.length} chars): ${attempt.substring(
0,
50,
)}...`,
);
break;
// Prefer content that has "Collected Logs" over content that doesn't
if (!logFileContent || !logFileContent.includes('Collected Logs')) {
logFileContent = result;
CloudRunnerLogger.log(
`Successfully read logs using fallback method (${logFileContent.length} chars): ${attempt.substring(
0,
50,
)}...`,
);
// If this content has "Collected Logs", we're done
if (logFileContent.includes('Collected Logs')) {
CloudRunnerLogger.log('Fallback method successfully captured "Collected Logs".');
break;
}
} else {
CloudRunnerLogger.log(`Skipping this result - already have content with "Collected Logs".`);
}
} else {
CloudRunnerLogger.log(`Fallback method returned empty result: ${attempt.substring(0, 50)}...`);
}
@ -331,15 +342,20 @@ class KubernetesTaskRunner {
}
}
// If output is still empty after fallback attempts, add a warning message
// If output is still empty or missing "Collected Logs" after fallback attempts, add a warning message
// This ensures BuildResults is not completely empty, which would cause test failures
if (needsFallback && output.trim().length === 0) {
if ((needsFallback && output.trim().length === 0) || (!output.includes('Collected Logs') && shouldTryFallback)) {
CloudRunnerLogger.logWarning(
'Could not retrieve any logs from pod after all attempts. Pod may have been killed before logs were written.',
'Could not retrieve "Collected Logs" from pod after all attempts. Pod may have been killed before logs were written.',
);
// Add a minimal message so BuildResults is not completely empty
// This helps with debugging and prevents test failures due to empty results
output = 'Pod logs unavailable - pod may have been terminated before logs could be collected.\n';
if (output.trim().length === 0) {
output = 'Pod logs unavailable - pod may have been terminated before logs could be collected.\n';
} else if (!output.includes('Collected Logs')) {
// We have some output but missing "Collected Logs" - append the fallback message
output += '\nPod logs incomplete - "Collected Logs" marker not found. Pod may have been terminated before post-build completed.\n';
}
}
} catch (fallbackError: any) {
CloudRunnerLogger.logWarning(

18
temp/job-log.txt 100644
View File

@ -0,0 +1,18 @@
[Client] bash -lc 'mkdir -p /data/cache/$CACHE_KEY/Library/ ; mkdir -p /data/cache/$CACHE_KEY/lfs/ ; if command -v rclone > /dev/null 2>&1; then ; rclone copy local:./temp/rclone-remote/cloud-runner-cache/$CACHE_KEY/Library /data/cache/$CACHE_KEY/Library/ || true ; rclone copy local:./temp/rclone-remote/cloud-runner-cache/$CACHE_KEY/lfs /data/cache/$CACHE_KEY/lfs/ || true ; else ; echo "rclone not available, skipping rclone-pull-cache" ; fi'
[Client] [0]
[Client] The system cannot find the path specified.
[Client]
[Client] bash -lc 'echo "cloud runner build workflow starting" ; # skipping apt-get in local-docker or non-container provider ; # skipping toolchain setup in local-docker or non-container provider ; export GITHUB_WORKSPACE="/data/0-linux64-gpkd/repo" ; # skipping df on /data in non-container provider ; export LOG_FILE=$(pwd)/temp/job-log.txt ; export GIT_DISCOVERY_ACROSS_FILESYSTEM=1 ; mkdir -p "$(dirname "$LOG_FILE")" ; echo "log start" >> "$LOG_FILE" ; echo "CACHE_KEY=$CACHE_KEY" ; echo "game ci start" ; echo "game ci start" >> "$LOG_FILE" ; timeout 3s node C:/Users/Mark/OneDrive/Documents/unity-builder/dist/index.js -m remote-cli-log-stream --logFile "$LOG_FILE" || true ; node C:/Users/Mark/OneDrive/Documents/unity-builder/dist/index.js -m remote-cli-post-build'
[Client] [0]
[Client]
[Client] bash -lc 'if command -v rclone > /dev/null 2>&1; then ; rclone copy /data/cache/$CACHE_KEY/build/build-0-linux64-gpkd.tar local:./temp/rclone-remote/cloud-runner-cache/$CACHE_KEY/build/ || true ; rm /data/cache/$CACHE_KEY/build/build-0-linux64-gpkd.tar || true ; else ; echo "rclone not available, skipping rclone-upload-build" ; fi'
[Client] [0]
[Client] The system cannot find the path specified.
[Client]
[Client] bash -lc 'if command -v rclone > /dev/null 2>&1; then ; rclone copy /data/cache/$CACHE_KEY/lfs local:./temp/rclone-remote/cloud-runner-cache/$CACHE_KEY/lfs || true ; rm -r /data/cache/$CACHE_KEY/lfs || true ; rclone copy /data/cache/$CACHE_KEY/Library local:./temp/rclone-remote/cloud-runner-cache/$CACHE_KEY/Library || true ; rm -r /data/cache/$CACHE_KEY/Library || true ; else ; echo "rclone not available, skipping rclone-upload-cache" ; fi'
[Client] [0]
[Client] The system cannot find the path specified.
[Client]
[Client] Error: Command failed: rclone lsf local:./temp/rclone-remote
2025/12/29 16:36:40 CRITICAL: Failed to create file system for "local:./temp/rclone-remote": didn't find section in config file ("local")