-
Notifications
You must be signed in to change notification settings - Fork 13
feat: add skip-cleanup flag and fix api-proxy shutdown delay #1099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,6 +94,14 @@ const shallowDepthRegex = /^(\s+)depth: 1\n/gm; | |
| // instead of pre-built GHCR images that may be stale. | ||
| const imageTagRegex = /--image-tag\s+[0-9.]+\s+--skip-pull/g; | ||
|
|
||
| // Add --skip-cleanup after sudo -E awf to skip container shutdown in CI | ||
| // (saves ~10 seconds per run since containers are cleaned up when runner terminates) | ||
| // Match patterns: | ||
| // - sudo -E awf --<flag> ... (with any flags after awf except --skip-cleanup which may already exist) | ||
| // - sudo -E awf "$command" (when command is directly after awf) | ||
| // Strategy: Insert --skip-cleanup right after "awf " if not already present | ||
| const awfCleanupRegex = /sudo -E awf (?!.*--skip-cleanup)/g; | ||
|
|
||
| for (const workflowPath of workflowPaths) { | ||
|
Comment on lines
+97
to
105
|
||
| let content = fs.readFileSync(workflowPath, 'utf-8'); | ||
| let modified = false; | ||
|
|
@@ -139,6 +147,14 @@ for (const workflowPath of workflowPaths) { | |
| console.log(` Replaced ${imageTagMatches.length} --image-tag/--skip-pull with --build-local`); | ||
| } | ||
|
|
||
| // Add --skip-cleanup to all awf invocations (saves ~10s per run in CI) | ||
| const awfCleanupMatches = content.match(awfCleanupRegex); | ||
| if (awfCleanupMatches) { | ||
| content = content.replace(awfCleanupRegex, 'sudo -E awf --skip-cleanup '); | ||
| modified = true; | ||
| console.log(` Added --skip-cleanup to ${awfCleanupMatches.length} awf invocation(s)`); | ||
| } | ||
|
|
||
| if (modified) { | ||
| fs.writeFileSync(workflowPath, content); | ||
| console.log(`Updated ${workflowPath}`); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching api-proxy to exec-form CMD fixes signal handling, but it also removes the
teepipeline that persisted stdout/stderr into the mounted/var/log/api-proxyvolume. The container’slogging.jsexplicitly relies onteefor file persistence, andsrc/docker-manager.tsmounts/createsapi-proxy-logsexpecting files there. Consider preserving file-based logs by writing directly to/var/log/api-proxy/api-proxy.logfrom Node (while keeping exec form), or update the volume mount / log-preservation logic to usedocker logsinstead so troubleshooting/artifact collection doesn’t regress.