Skip to content
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

Skip git gc on aix and master/built-in #21034

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions buildenv/jenkins/jobs/infrastructure/Update-Reference-Repos.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,20 @@ timeout(time: 6, unit: 'HOURS') {
continue
}

def gc = true
def sNodeName = sNode.getDisplayName()
if (!sNode.toComputer().name) {
sNodeName = builtInLabel
// Do not gc on aix or master. Seems to be problematic #20346
gc = false
}

setupNodesNames.add(sNodeName)

jobs["${sNodeName}"] = {
node("${sNodeName}") {
stage("${sNodeName} - Update Reference Repo") {
refresh(sNodeName, get_cache_dir(), defaultRepos, true)
refresh(sNodeName, get_cache_dir(), defaultRepos, true, gc)
}
}
}
Expand Down Expand Up @@ -155,10 +158,15 @@ timeout(time: 6, unit: 'HOURS') {
// Remove any dups
repos.unique()

def gc = true
if (nodeLabels.contains('sw.os.aix')) {
// Do not gc on aix or master. Seems to be problematic #20346
gc = false
}
jobs["${nodeName}"] = {
node("${nodeName}") {
stage("${nodeName} - Update Reference Repo") {
refresh(nodeName, get_cache_dir(), repos, foundLabel)
refresh(nodeName, get_cache_dir(), repos, foundLabel, gc)
}
}
}
Expand Down Expand Up @@ -186,7 +194,7 @@ timeout(time: 6, unit: 'HOURS') {
/*
* Creates and updates the git reference repository cache on the node.
*/
def refresh(node, cacheDir, repos, isKnownOs) {
def refresh(node, cacheDir, repos, isKnownOs, gc) {
if (CLEAN_CACHE_DIR) {
sh "rm -fr ${cacheDir}"
}
Expand All @@ -207,8 +215,10 @@ def refresh(node, cacheDir, repos, isKnownOs) {
sh "git fetch --all"
}
}
stage("${node} - GC Repo") {
sh "git gc --aggressive --prune=all"
if (gc) {
stage("${node} - GC Repo") {
sh "git gc --aggressive --prune=all"
}
}
}
}
Expand Down