Skip to content

Honour delete_on_complete in the Azure VM runner - #709

Open
VenishPaneliya wants to merge 1 commit into
interpretml:mainfrom
VenishPaneliya:fix-azure-vm-delete-on-complete
Open

VenishPaneliya wants to merge 1 commit into
interpretml:mainfrom
VenishPaneliya:fix-azure-vm-delete-on-complete

Conversation

@VenishPaneliya

@VenishPaneliya VenishPaneliya commented Nov 20, 2026 •

Copy link
Copy Markdown

run_azure_process takes delete_on_complete and never reads it. AzureVMExecutor documents it as "Delete group containers after completion. Defaults to True", stores it, and passes it down — but the startup script calls self_delete unconditionally from thirteen places, so delete_on_complete=False is silently ignored and the VM is deleted anyway. That is the case where you most want the VM kept: inspecting a failed trial.

run/azure_ci.py already guards its cleanup with if delete_on_complete:, so this is the VM runner missing the behaviour its sibling has.

The fix exports the flag alongside the seven variables already exported into the script, and returns early from self_delete when it is off — still exit $1, so termination is unchanged. With the default True the generated script behaves exactly as before.

ruff check on main reports ARG001 Unused function argument: delete_on_complete for this function; that warning is gone after the change.

No test added, since powerlift/run/ has no test coverage to extend and this path needs a live Azure subscription. I did check the generated shell: pulling the startup_script literal out of the module and running self_delete under bash with az stubbed, az vm delete is reached with DELETE_ON_COMPLETE=1 and not reached with 0; on main it is reached either way. ruff format --check passes.

(The red format_clang is not from this diff, which touches no C++: its check_cpp step is continue-on-error, but the follow-up checks.create() needs checks: write, which a fork PR's token does not have. That step only runs because clang-format already finds files to reformat under shared/libebm/ at this commit, so any fork PR shows it red.)

run_azure_process accepted delete_on_complete but never read it, so the
startup script's self_delete ran unconditionally and passing False to
AzureVMExecutor had no effect. Export the flag into the script and skip
the delete when it is off, as run/azure_ci.py already does.

Signed-off-by: VenishPaneliya <141703684+VenishPaneliya@users.noreply.github.com>
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.77%. Comparing base (003136e) to head (8e8a72b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #709      +/-   ##
==========================================
- Coverage   67.82%   67.77%   -0.06%     
==========================================
  Files          77       77              
  Lines       11893    11893              
==========================================
- Hits         8066     8060       -6     
- Misses       3827     3833       +6     
Flag Coverage Δ
bdist_linux_311_python 67.52% <ø> (-0.02%) ⬇️
bdist_linux_312_python ?
bdist_linux_313_python ?
bdist_linux_314_python 67.43% <ø> (-0.02%) ⬇️
bdist_linuxarm_311_python 67.54% <ø> (-0.02%) ⬇️
bdist_linuxarm_312_python ?
bdist_linuxarm_313_python ?
bdist_linuxarm_314_python 67.45% <ø> (-0.02%) ⬇️
bdist_mac_311_python 67.70% <ø> (ø)
bdist_mac_312_python ?
bdist_mac_313_python ?
bdist_mac_314_python 67.59% <ø> (-0.04%) ⬇️
bdist_win_311_python 67.70% <ø> (-0.02%) ⬇️
bdist_win_312_python ?
bdist_win_313_python ?
bdist_win_314_python 67.61% <ø> (-0.02%) ⬇️
sdist_linux_311_python ?
sdist_linux_312_python ?
sdist_linux_313_python ?
sdist_linux_314_python ?
sdist_linuxarm_311_python ?
sdist_linuxarm_312_python ?
sdist_linuxarm_313_python ?
sdist_linuxarm_314_python ?
sdist_mac_311_python ?
sdist_mac_312_python ?
sdist_mac_313_python ?
sdist_mac_314_python ?
sdist_win_311_python ?
sdist_win_312_python ?
sdist_win_313_python ?
sdist_win_314_python ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant