Skip to content

Commit c3a4711

Browse files
committed
WIP: Test ccache fix hypothesis on ITK.Linux Azure DevOps only
Hypothesis: ITK.Linux Azure ccache has near-0% hit rate because: 1. CCACHE_NODIRECT=1 disables the fast direct mode 2. CCACHE_SLOPPINESS not set (__DATE__/__TIME__ cause misses) 3. Three jobs share one cache key but build different configs 4. ITK_USE_CCACHE=ON conflicts with CMAKE_*_COMPILER_LAUNCHER Fix applied to AzurePipelinesLinux.yml: - Remove CCACHE_NODIRECT (enable direct mode) - Add CCACHE_SLOPPINESS=pch_defines,time_macros - Add job name to cache key (ccache-v5) - Remove ITK_USE_CCACHE (launcher is sufficient) - Minimize build to ITKCommon+IO modules only (fast iteration) - Keep only 1 job (Linux) to avoid cache key collision - Add ccache --show-stats --verbose step All other CI temporarily disabled (trigger: none / workflow_dispatch) to isolate the hypothesis test. This PR must NOT be merged.
1 parent 9e00915 commit c3a4711

File tree

8 files changed

+33
-368
lines changed

8 files changed

+33
-368
lines changed

.github/workflows/arm.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
11
name: ITK.Arm64
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- 'release*'
8-
paths-ignore:
9-
- '*.md'
10-
- LICENSE
11-
- NOTICE
12-
- 'Documentation/**'
13-
- 'Utilities/Debugger/**'
14-
- 'Utilities/ITKv5Preparation/**'
15-
- 'Utilities/Maintenance/**'
16-
- 'Modules/Remote/*.remote.cmake'
17-
pull_request:
18-
paths-ignore:
19-
- '*.md'
20-
- LICENSE
21-
- NOTICE
22-
- 'Documentation/**'
23-
- 'Utilities/Debugger/**'
24-
- 'Utilities/ITKv5Preparation/**'
25-
- 'Utilities/Maintenance/**'
26-
- 'Modules/Remote/*.remote.cmake'
4+
workflow_dispatch: {} # WIP: disabled for ccache hypothesis testing
275

286
concurrency:
297
group: '${{ github.workflow }}@${{ github.head_ref || github.ref }}'

.github/workflows/pixi.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
11
name: ITK.Pixi
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- 'release*'
8-
paths-ignore:
9-
- '*.md'
10-
- LICENSE
11-
- NOTICE
12-
- 'Documentation/**'
13-
- 'Utilities/Debugger/**'
14-
- 'Utilities/ITKv5Preparation/**'
15-
- 'Utilities/Maintenance/**'
16-
- 'Modules/Remote/*.remote.cmake'
17-
pull_request:
18-
paths-ignore:
19-
- '*.md'
20-
- LICENSE
21-
- NOTICE
22-
- 'Documentation/**'
23-
- 'Utilities/Debugger/**'
24-
- 'Utilities/ITKv5Preparation/**'
25-
- 'Utilities/Maintenance/**'
26-
- 'Modules/Remote/*.remote.cmake'
4+
workflow_dispatch: {} # WIP: disabled for ccache hypothesis testing
275

286
concurrency:
297
group: '${{ github.workflow }}@${{ github.head_ref || github.ref }}'

Testing/ContinuousIntegration/AzurePipelinesLinux.yml

Lines changed: 21 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ variables:
3232
CCACHE_BASEDIR: $(Build.SourcesDirectory)
3333
CCACHE_COMPILERCHECK: content
3434
CCACHE_NOHASHDIR: 'true'
35-
CCACHE_NODIRECT: '1'
35+
CCACHE_SLOPPINESS: pch_defines,time_macros
36+
# NOTE: CCACHE_NODIRECT intentionally removed — direct mode is the
37+
# fast path (97%+ hit rate on ARM CI). NODIRECT forced preprocessor
38+
# mode on every file, killing cache efficiency.
3639
jobs:
3740
- job: Linux
3841
timeoutInMinutes: 0
@@ -76,122 +79,36 @@ jobs:
7679
7780
- task: Cache@2
7881
inputs:
79-
key: '"ccache" | "$(Agent.OS)" | "$(Build.SourceVersion)"'
82+
key: '"ccache-v5" | "$(Agent.OS)" | "Linux" | "$(Build.SourceVersion)"'
8083
restoreKeys: |
81-
"ccache" | "$(Agent.OS)"
84+
"ccache-v5" | "$(Agent.OS)" | "Linux"
8285
path: $(CCACHE_DIR)
8386
displayName: 'Restore ccache'
8487

85-
- bash: ccache --evict-older-than 7d
86-
displayName: 'Evict old ccache entries'
87-
88-
- bash: |
89-
cat > dashboard.cmake << EOF
90-
set(CTEST_BUILD_CONFIGURATION "MinSizeRel")
91-
set(CTEST_CMAKE_GENERATOR "Ninja")
92-
set(dashboard_cache "
93-
BUILD_SHARED_LIBS:BOOL=OFF
94-
BUILD_EXAMPLES:BOOL=OFF
95-
ITK_WRAP_PYTHON:BOOL=OFF
96-
ITK_USE_CCACHE:BOOL=ON
97-
CMAKE_C_COMPILER_LAUNCHER:STRING=ccache
98-
CMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache
99-
ITK_COMPUTER_MEMORY_SIZE:STRING=4.5
100-
")
101-
set(CTEST_TEST_ARGS EXCLUDE_LABEL BigIO) # Disabled to conserve disk space
102-
include(\$ENV{AGENT_BUILDDIRECTORY}/ITK-dashboard/azure_dashboard.cmake)
103-
EOF
104-
cat dashboard.cmake
105-
workingDirectory: $(Agent.BuildDirectory)/ITK-dashboard
106-
displayName: 'Configure CTest script'
107-
10888
- bash: |
10989
set -x
110-
111-
c++ --version
112-
cmake --version
113-
114-
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2
115-
displayName: 'Build and test'
116-
env:
117-
CTEST_OUTPUT_ON_FAILURE: 1
118-
CCACHE_MAXSIZE: 2.4G
119-
120-
- bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build
121-
condition: succeededOrFailed()
122-
displayName: 'Report build warnings and errors'
123-
124-
- script: |
125-
ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml
126-
condition: succeededOrFailed()
127-
displayName: 'Format CTest output in JUnit format'
128-
129-
- task: PublishTestResults@2
130-
inputs:
131-
testResultsFiles: "$(Agent.BuildDirectory)/JUnitTestResults.xml"
132-
testRunTitle: 'CTest $(Agent.OS)'
133-
condition: succeededOrFailed()
134-
displayName: 'Publish test results'
135-
136-
- job: LinuxLegacyRemoved
137-
timeoutInMinutes: 0
138-
cancelTimeoutInMinutes: 300
139-
pool:
140-
vmImage: ubuntu-22.04
141-
steps:
142-
- checkout: self
143-
clean: true
144-
fetchDepth: 5
145-
- bash: |
146-
set -x
147-
if [ -n "$(System.PullRequest.SourceCommitId)" ]; then
148-
git checkout $(System.PullRequest.SourceCommitId)
149-
fi
150-
displayName: 'Checkout pull request HEAD'
151-
152-
- bash: |
153-
set -x
154-
sudo pip3 install ninja
155-
sudo apt-get update
156-
sudo apt-get install -y python3-venv ccache locales
157-
sudo locale-gen de_DE.UTF-8
158-
sudo python3 -m pip install lxml scikit-ci-addons
159-
displayName: 'Install dependencies'
160-
161-
- bash: |
162-
set -x
163-
git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
164-
165-
curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O
166-
cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz
167-
cmake -E rename InsightToolkit-$(ExternalDataVersion)/.ExternalData/CID $(Build.SourcesDirectory)/.ExternalData/CID
168-
workingDirectory: $(Agent.BuildDirectory)
169-
displayName: 'Download dashboard script and testing data'
170-
171-
- task: Cache@2
172-
inputs:
173-
key: '"ccache" | "$(Agent.OS)" | "$(Build.SourceVersion)"'
174-
restoreKeys: |
175-
"ccache" | "$(Agent.OS)"
176-
path: $(CCACHE_DIR)
177-
displayName: 'Restore ccache'
178-
179-
- bash: ccache --evict-older-than 7d
180-
displayName: 'Evict old ccache entries'
90+
ccache --zero-stats
91+
ccache --evict-older-than 7d
92+
ccache --show-config
93+
displayName: 'ccache config and maintenance'
18194
18295
- bash: |
18396
cat > dashboard.cmake << EOF
18497
set(CTEST_BUILD_CONFIGURATION "MinSizeRel")
18598
set(CTEST_CMAKE_GENERATOR "Ninja")
186-
set(BUILD_NAME_SUFFIX "LegacyRemoved")
18799
set(dashboard_cache "
188-
ITK_LEGACY_REMOVE:BOOL=ON
189100
BUILD_SHARED_LIBS:BOOL=OFF
190101
BUILD_EXAMPLES:BOOL=OFF
191102
ITK_WRAP_PYTHON:BOOL=OFF
192103
CMAKE_C_COMPILER_LAUNCHER:STRING=ccache
193104
CMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache
194105
ITK_COMPUTER_MEMORY_SIZE:STRING=4.5
106+
ITK_BUILD_DEFAULT_MODULES:BOOL=OFF
107+
Module_ITKCommon:BOOL=ON
108+
Module_ITKIOImageBase:BOOL=ON
109+
Module_ITKIONIFTI:BOOL=ON
110+
Module_ITKIOPNG:BOOL=ON
111+
Module_ITKTestKernel:BOOL=ON
195112
")
196113
set(CTEST_TEST_ARGS EXCLUDE_LABEL BigIO) # Disabled to conserve disk space
197114
include(\$ENV{AGENT_BUILDDIRECTORY}/ITK-dashboard/azure_dashboard.cmake)
@@ -212,6 +129,10 @@ jobs:
212129
CTEST_OUTPUT_ON_FAILURE: 1
213130
CCACHE_MAXSIZE: 2.4G
214131
132+
- bash: ccache --show-stats --verbose
133+
condition: always()
134+
displayName: 'ccache stats'
135+
215136
- bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build
216137
condition: succeededOrFailed()
217138
displayName: 'Report build warnings and errors'
@@ -224,98 +145,6 @@ jobs:
224145
- task: PublishTestResults@2
225146
inputs:
226147
testResultsFiles: "$(Agent.BuildDirectory)/JUnitTestResults.xml"
227-
testRunTitle: 'CTest $(Agent.OS) LegacyRemoved'
148+
testRunTitle: 'CTest $(Agent.OS)'
228149
condition: succeededOrFailed()
229150
displayName: 'Publish test results'
230-
231-
- job: LinuxCxx20
232-
timeoutInMinutes: 0
233-
cancelTimeoutInMinutes: 300
234-
pool:
235-
vmImage: ubuntu-24.04
236-
steps:
237-
- checkout: self
238-
clean: true
239-
fetchDepth: 5
240-
- bash: |
241-
set -x
242-
if [ -n "$(System.PullRequest.SourceCommitId)" ]; then
243-
git checkout $(System.PullRequest.SourceCommitId)
244-
fi
245-
displayName: "Checkout pull request HEAD"
246-
- task: UsePythonVersion@0
247-
inputs:
248-
versionSpec: "3.10"
249-
architecture: "x64"
250-
- bash: |
251-
set -x
252-
sudo pip3 install ninja
253-
sudo apt-get update
254-
sudo apt-get install -y python3-venv ccache locales
255-
sudo locale-gen de_DE.UTF-8
256-
sudo python3 -m pip install lxml scikit-ci-addons
257-
displayName: "Install dependencies"
258-
- bash: |
259-
set -x
260-
git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
261-
curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v$(ExternalDataVersion)/InsightData-$(ExternalDataVersion).tar.gz -O
262-
cmake -E tar xfz InsightData-$(ExternalDataVersion).tar.gz
263-
cmake -E rename InsightToolkit-$(ExternalDataVersion)/.ExternalData/CID $(Build.SourcesDirectory)/.ExternalData/CID
264-
workingDirectory: $(Agent.BuildDirectory)
265-
displayName: "Download dashboard script and testing data"
266-
- task: Cache@2
267-
inputs:
268-
key: '"ccache" | "$(Agent.OS)" | "$(Build.SourceVersion)"'
269-
restoreKeys: |
270-
"ccache" | "$(Agent.OS)"
271-
path: $(CCACHE_DIR)
272-
displayName: 'Restore ccache'
273-
274-
- bash: ccache --evict-older-than 7d
275-
displayName: 'Evict old ccache entries'
276-
277-
- bash: |
278-
cat > dashboard.cmake << EOF
279-
set(CTEST_BUILD_CONFIGURATION "MinSizeRel")
280-
set(CTEST_CMAKE_GENERATOR "Ninja")
281-
set(BUILD_NAME_SUFFIX "Cxx20")
282-
set(dashboard_cache "
283-
CMAKE_CXX_STANDARD:STRING=20
284-
CMAKE_CXX_STANDARD_REQUIRED:BOOL=ON
285-
BUILD_SHARED_LIBS:BOOL=OFF
286-
BUILD_EXAMPLES:BOOL=OFF
287-
ITK_WRAP_PYTHON:BOOL=OFF
288-
CMAKE_C_COMPILER_LAUNCHER:STRING=ccache
289-
CMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache
290-
ITK_COMPUTER_MEMORY_SIZE:STRING=4.5
291-
")
292-
set(CTEST_TEST_ARGS EXCLUDE_LABEL BigIO) # Disabled to conserve disk space
293-
include(\$ENV{AGENT_BUILDDIRECTORY}/ITK-dashboard/azure_dashboard.cmake)
294-
EOF
295-
cat dashboard.cmake
296-
workingDirectory: $(Agent.BuildDirectory)/ITK-dashboard
297-
displayName: "Configure CTest script"
298-
- bash: |
299-
set -x
300-
c++ --version
301-
cmake --version
302-
ctest -S $(Agent.BuildDirectory)/ITK-dashboard/dashboard.cmake -V -j 2
303-
displayName: "Build and test"
304-
env:
305-
CTEST_OUTPUT_ON_FAILURE: 1
306-
CCACHE_MAXSIZE: 2.4G
307-
308-
- bash: python3 $(Build.SourcesDirectory)/Testing/ContinuousIntegration/report_build_diagnostics.py $(Build.SourcesDirectory)-build
309-
condition: succeededOrFailed()
310-
displayName: 'Report build warnings and errors'
311-
312-
- script: |
313-
ci_addons ctest_junit_formatter $(Build.SourcesDirectory)-build > $(Agent.BuildDirectory)/JUnitTestResults.xml
314-
condition: succeededOrFailed()
315-
displayName: "Format CTest output in JUnit format"
316-
- task: PublishTestResults@2
317-
inputs:
318-
testResultsFiles: "$(Agent.BuildDirectory)/JUnitTestResults.xml"
319-
testRunTitle: "CTest $(Agent.OS) Cxx20"
320-
condition: succeededOrFailed()
321-
displayName: "Publish test results"

Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
11
name: ITK.Linux.Python
22

3-
trigger:
4-
branches:
5-
include:
6-
- main
7-
- release*
8-
paths:
9-
exclude:
10-
- '*.md'
11-
- LICENSE
12-
- NOTICE
13-
- Documentation/*
14-
- Utilities/Debugger/*
15-
- Utilities/ITKv5Preparation/*
16-
- Utilities/Maintenance/*
17-
- Modules/Remote/*.remote.cmake
18-
pr:
19-
paths:
20-
exclude:
21-
- '*.md'
22-
- LICENSE
23-
- NOTICE
24-
- Documentation/*
25-
- Utilities/Debugger/*
26-
- Utilities/ITKv5Preparation/*
27-
- Utilities/Maintenance/*
28-
- Modules/Remote/*.remote.cmake
3+
trigger: none
4+
pr: none
295
variables:
306
ExternalDataVersion: 5.4.5
317
CCACHE_DIR: $(Pipeline.Workspace)/.ccache

Testing/ContinuousIntegration/AzurePipelinesMacOS.yml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
11
name: ITK.macOS
22

3-
trigger:
4-
branches:
5-
include:
6-
- main
7-
- release*
8-
paths:
9-
exclude:
10-
- '*.md'
11-
- LICENSE
12-
- NOTICE
13-
- Documentation/*
14-
- Utilities/Debugger/*
15-
- Utilities/ITKv5Preparation/*
16-
- Utilities/Maintenance/*
17-
- Modules/Remote/*.remote.cmake
18-
pr:
19-
paths:
20-
exclude:
21-
- '*.md'
22-
- LICENSE
23-
- NOTICE
24-
- Documentation/*
25-
- Utilities/Debugger/*
26-
- Utilities/ITKv5Preparation/*
27-
- Utilities/Maintenance/*
28-
- Modules/Remote/*.remote.cmake
3+
trigger: none
4+
pr: none
295
variables:
306
ExternalDataVersion: 5.4.5
317
CCACHE_DIR: $(Pipeline.Workspace)/.ccache

0 commit comments

Comments
 (0)