Skip to content

Improve Azure CI performance by enabling pip dependency caching #5255

@vinitjain2005

Description

@vinitjain2005

Currently, the Azure pipeline installs all dependencies from scratch on every run across all matrix jobs (Windows/Linux, multiple Python versions, wheel/normal builds). Given the large scientific dependency stack (NumPy, SciPy, matplotlib, rdkit, etc.), this significantly increases CI runtime.

Azure DevOps provides a built-in Cache@2 task that can cache pip’s download directory across runs. Introducing pip caching keyed by OS and Python version could:

  • Reduce CI runtime
  • Lower redundant network usage
  • Improve overall CI efficiency
  • Not change build behavior or test logic

A possible approach would be:

  • Cache the pip download directory (e.g., ~/.cache/pip on Linux, %LocalAppData%\pip\Cache on Windows)
  • Key the cache on:
  • Agent.OS
  • PYTHON_VERSION
  • Potentially BUILD_TYPE

Example:-

  • task: Cache@2
    inputs:
    key: 'pip | "$(Agent.OS)" | "$(PYTHON_VERSION)"'
    path: $(PIP_CACHE_DIR)

I would be happy to experiment with implementing pip caching in a safe and minimal way that does not affect build reproducibility.

Vinit Jain
GitHub:- @vinitjain2005

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions