Skip to content

Be more careful when/how we timeout conda install#3514

Merged
mrmundt merged 6 commits intoPyomo:mainfrom
jsiirola:conda-timeout-update
Mar 11, 2025
Merged

Be more careful when/how we timeout conda install#3514
mrmundt merged 6 commits intoPyomo:mainfrom
jsiirola:conda-timeout-update

Conversation

@jsiirola
Copy link
Copy Markdown
Member

@jsiirola jsiirola commented Mar 10, 2025

Fixes # .

Summary/Motivation:

This should resolve ongoing issues with managing conda environments on Windows. conda install can get stuck (indefinitely) resolving the environment when installing scip on Windows/Python3.12. However, we cannot just kill conda at will: if conda has started installation, we must wait for it to complete. Instead of making the timeout longer (as in #3507), we will monitor the conda install process and only kill conda if it hasn't gotten to the installation phase when the timeout happens.

This PR supersedes #3507

Update: As part of getting this PR building, some additional development was required.

  • we no longer need to explicitly install/activate the mamba solver (this is active by default in current conda environments)
  • this PR enforces strict channel prioritization, which resolves several "indefinite hangs" we have been seeing when attempting to install packages on Python 3.12 and 3.13. Technically, it probably removes the need for the conda timeout logic entirely, however, that seems like a reasonable bit of "future proofing" to leave in.

Changes proposed in this PR:

  • explicitly look up the conda install PID (and signal it directly)
  • only signal conda if it hasn't started the installation process when the timeout happens.
  • do not explicitly install the mamba solver in sufficiently new conda environments
  • enforce strict channel prioritization

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@mrmundt mrmundt merged commit e75a1be into Pyomo:main Mar 11, 2025
35 checks passed
@jsiirola jsiirola deleted the conda-timeout-update branch March 11, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants