Skip to content

Commit c3cdbb4

Browse files
authored
Merge pull request ClickHouse#78961 from ClickHouse/ci_docker_clean_up
CI: Clean up hook in docker server build job
2 parents 3a2434d + f815e87 commit c3cdbb4

File tree

4 files changed

+40
-6
lines changed

4 files changed

+40
-6
lines changed

ci/defs/job_configs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,7 @@ class JobConfigs:
904904
],
905905
),
906906
requires=["Build (amd_release)", "Build (arm_release)"],
907+
post_hooks=["python3 ./ci/jobs/scripts/job_hooks/docker_clean_up_hook.py"],
907908
)
908909
docker_keeper = Job.Config(
909910
name=JobNames.DOCKER_KEEPER,
@@ -918,6 +919,7 @@ class JobConfigs:
918919
],
919920
),
920921
requires=["Build (amd_release)", "Build (arm_release)"],
922+
post_hooks=["python3 ./ci/jobs/scripts/job_hooks/docker_clean_up_hook.py"],
921923
)
922924
sqlancer_master_jobs = Job.Config(
923925
name=JobNames.SQLANCER,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from ci.praktika.utils import Shell
2+
3+
4+
def check():
5+
print("Clean up build cache")
6+
Shell.check("docker builder prune -a -f", verbose=True)
7+
print("Clean up stopped containers")
8+
Shell.check("docker container prune -f", verbose=True)
9+
10+
print("Clean up non-latest images per each Repository")
11+
Shell.check(
12+
"docker images --format '{{.Repository}} {{.ID}} {{.CreatedAt}}' "
13+
" | sort -k1,1 -k3,3M -k4,4n -k5,5n "
14+
" | tac "
15+
" | awk '!seen[$1]++ {next} {print $2}' "
16+
" | xargs -r docker rmi",
17+
verbose=True,
18+
)
19+
return True
20+
21+
22+
if __name__ == "__main__":
23+
check()

ci/jobs/scripts/workflow_hooks/feature_docs.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@
44

55
from ci.jobs.scripts.workflow_hooks.pr_description import Labels
66

7-
files_for_which_docs_autogenerated = ["src/storages/MergeTree/MergeTreeSettings.cpp", "src/Core/Settings.cpp"]
7+
files_for_which_docs_autogenerated = [
8+
"src/storages/MergeTree/MergeTreeSettings.cpp",
9+
"src/Core/Settings.cpp",
10+
]
11+
812

913
def check_docs():
1014
info = Info()
1115
if Labels.PR_FEATURE in info.pr_labels:
1216
changed_files = info.get_custom_data("changed_files")
13-
14-
if not any(file.startswith("docs/") or file in files_for_which_docs_autogenerated for file in changed_files):
17+
18+
if not any(
19+
file.startswith("docs/") or file in files_for_which_docs_autogenerated
20+
for file in changed_files
21+
):
1522
print("No changes in docs for new feature")
1623
return False
1724
return True

ci/praktika/json.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@
564564
const chartWrapper = document.createElement("div");
565565
chartWrapper.className = 'status-widget';
566566

567-
const stats = persistentStorage.statisticsObject?.[jobName]?.["7d"];
567+
const stats = persistentStorage.statisticsObject?.[jobName]?.["3d"];
568568
if (!stats) {
569569
console.warn(`No stats found for job: ${jobName}`);
570570
return;
@@ -1418,7 +1418,9 @@
14181418
let statusWidget = addStatusWidget(result.name, result.status, result.start_time, result.duration);
14191419
if (nameParams.length > 1) {
14201420
addFileLinksWidget(result.links);
1421-
addStatisticsWidget(nameParams[1], result.duration * 1000)
1421+
if (nameParams.length === 2) {
1422+
addStatisticsWidget(nameParams[1], result.duration * 1000)
1423+
}
14221424
} else {
14231425
addTimeTraceWidget(result.results, statusWidget, originalWorkflowDetails);
14241426
}
@@ -1457,7 +1459,7 @@
14571459
!persistentStorage.updatedAt ||
14581460
now > persistentStorage.updatedAt + HALF_DAY
14591461
) {
1460-
const url = `https://s3.amazonaws.com/${bucketName}/statistics/${name.toLowerCase()}.json.gz`;
1462+
const url = `https://s3.amazonaws.com/${bucketName}/statistics/statistics.json.gz`;
14611463

14621464
try {
14631465
const response = await fetch(url);

0 commit comments

Comments
 (0)