Skip to content

Commit a92d749

Browse files
EgorBoCopilot
andauthored
Fix aspnet2 spmi collection script (#124399)
This PR makes the script less fragile: * don't allow nuget to use OS disk for cache - the OS disk is too small on helix * increase build timeout to 30min, 10min was not enough for OrchardCMS on some helix machines * unpin .net 10.0, switch to latest public preview of .net 11.0 * decrease number of bombardier connections to be 16 - helix machines are too weak * remove `TieredPGO": "1", "ReadyToRun": "0"` config - it's not too useful + the whole script takes too long already. mch size: 892 MB ``` Individual Flag Appearances 43712 98.61% DEBUG_INFO 3 0.01% MIN_OPT 20 0.05% OSR 44326 100.00% FROZEN_ALLOC_ALLOWED 341 0.77% IL_STUB 11298 25.49% BBINSTR 11595 26.16% BBINSTR_IF_LOOPS 29251 65.99% BBOPT 418 0.94% FRAMED 2 0.00% PUBLISH_SECRET_PARAM 6 0.01% REVERSE_PINVOKE 15072 34.00% TIER0 14343 32.36% TIER1 305 0.69% HAS_METHOD_PROFILE 7034 15.87% HAS_DYNAMIC_PROFILE 3000 6.77% HAS_STATIC_PROFILE 1080 2.44% HAS_LIKELY_CLASS 2144 4.84% HAS_CLASS_PROFILE 9708 21.90% HAS_EDGE_PROFILE 10034 22.64% HAS_PGO ``` --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent f704cce commit a92d749

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

eng/pipelines/coreclr/templates/superpmi-collect-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ extends:
499499
platforms:
500500
- osx_arm64
501501
- linux_arm64
502-
# - linux_x64 # currently runs of disk space too often.
502+
- linux_x64
503503
- windows_x64
504504
- windows_arm64
505505
helixQueueGroup: ci

src/coreclr/scripts/superpmi_aspnet2.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ def setup_and_run_crank_agent(workdir: Path):
152152
os.environ['DOTNET_CLI_TELEMETRY_OPTOUT'] = '1'
153153
os.environ['DOTNET_MULTILEVEL_LOOKUP'] = '0'
154154
os.environ['UseSharedCompilation'] = 'false'
155+
os.environ['NUGET_PLUGINS_CACHE_PATH'] = str(workdir / "NUGET_PLUGINS_CACHE_PATH")
156+
os.environ['NUGET_PACKAGES'] = str(workdir / "NUGET_PACKAGES")
157+
os.environ['NUGET_HTTP_CACHE_PATH'] = str(workdir / "NUGET_HTTP_CACHE_PATH")
158+
os.environ['NUGET_SCRATCH'] = str(workdir / "NUGET_SCRATCH")
155159

156160
print("Installing tools ...")
157161
logs_dir.mkdir(parents=True, exist_ok=True)
@@ -212,6 +216,7 @@ def setup_and_run_crank_agent(workdir: Path):
212216
"--log-path", str(logs_dir),
213217
"--build-path", str(build_dir),
214218
"--dotnethome", str(dotnethome_dir),
219+
"--build-timeout", "30"
215220
],
216221
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, stdin=subprocess.DEVNULL,
217222
creationflags=creation_flags,
@@ -227,6 +232,7 @@ def run_crank_scenario(crank_app: Path, scenario_name: str, framework: str, work
227232
spmi_shim = native_dll("superpmi-shim-collector")
228233
clrjit = native_dll("clrjit")
229234
coreclr = native_dll("coreclr")
235+
systemNative = native_dll("System.Native")
230236
spcorelib = "System.Private.CoreLib.dll"
231237
cmd = [
232238
str(crank_app),
@@ -238,23 +244,13 @@ def run_crank_scenario(crank_app: Path, scenario_name: str, framework: str, work
238244
"--config", str(config_path),
239245
"--profile", "Localhost",
240246
"--scenario", scenario_name,
241-
242-
# "--application.framework", framework,
243-
# "--application.Channel", "edge",
244-
# "--application.noGlobalJson", "false",
245-
246-
# TODO: unpin once it's working again.
247-
"--application.framework", "net10.0",
248-
"--application.aspNetCoreVersion", "10.0.0-rtm.25513.102",
249-
"--application.runtimeVersion", "10.0.0-rtm.25513.102",
250-
"--application.sdkVersion", "10.0.100-rtm.25513.102",
251-
252-
"--application.collectDependencies", "false",
253-
"--application.options.collectCounters", "false",
247+
"--application.framework", framework,
248+
"--application.channel", "edge",
249+
"--application.sdkVersion", "latest",
250+
"--application.noGlobalJson", "false",
254251
"--load.options.reuseBuild", "true",
255-
"--load.variables.duration", "45",
256-
"--load.variables.warmup", "15",
257252
"--load.job", "bombardier", # Bombardier is more cross-platform friendly (wrk is linux only)
253+
"--load.variables.connections", "16",
258254
]
259255

260256
# Only add SPMI collection environment variables and output files if not in dry run mode
@@ -268,6 +264,7 @@ def run_crank_scenario(crank_app: Path, scenario_name: str, framework: str, work
268264
"--application.options.outputFiles", str(core_root_path / clrjit),
269265
"--application.options.outputFiles", str(core_root_path / coreclr),
270266
"--application.options.outputFiles", str(core_root_path / spcorelib),
267+
"--application.options.outputFiles", str(core_root_path / systemNative),
271268
])
272269

273270
# Add custom environment variables for this run
@@ -328,6 +325,11 @@ def main():
328325
print(f"Using temp work directory: {work_dir_base}")
329326

330327
work_dir_base = work_dir_base / "crank_data"
328+
# delete crank_data if it already exists from a previous run to ensure a clean state
329+
if work_dir_base.exists():
330+
print(f"Cleaning existing work directory {work_dir_base} from previous run...")
331+
shutil.rmtree(work_dir_base)
332+
331333
work_dir_base.mkdir(parents=True, exist_ok=True)
332334

333335
# Set current working directory to work_dir_base
@@ -360,8 +362,7 @@ def main():
360362

361363
# Define the environment variable sets to run for each scenario
362364
env_var_sets = [
363-
{"Dummy": "0"},
364-
{"TieredPGO": "1", "ReadyToRun": "0"},
365+
{"Dummy": "0"}, # Baseline with no environment variables set
365366
{"TieredCompilation": "0", "ReadyToRun": "0"},
366367
{"TC_PartialCompilation": "1"},
367368
]

0 commit comments

Comments
 (0)