Skip to content

Ship Dockerfile.base in the wheel and drop a dead package_data entry - #2743

Open
Oke Iyanuoluwa Enoch (Iyanuoluwa007) wants to merge 2 commits into
microsoft:mainfrom
Iyanuoluwa007:fix-wheel-package-data
Open

Oke Iyanuoluwa Enoch (Iyanuoluwa007) wants to merge 2 commits into
microsoft:mainfrom
Iyanuoluwa007:fix-wheel-package-data

Conversation

@Iyanuoluwa007

Copy link
Copy Markdown

Describe your changes

The codebase review (#2516) flagged a dead olive.auto_optimizer entry in setup.py's package_data. While checking that, I found a real packaging bug next to it.

Dockerfile.base is missing from the wheel. olive/engine/packaging/packaging_generator.py opens Path(__file__).parent / "Dockerfile.base" when packaging a workflow output as Docker, but setup.py never listed that file in package_data (and include_package_data=False). I built a wheel from main with pip wheel . --no-deps, and the file isn't in it, so Docker packaging fails with FileNotFoundError for anyone who installed olive-ai from a wheel. It now ships under olive.engine.packaging.

Dead entry. olive.auto_optimizer no longer exists, so its package_data entry is removed.

Regression test. test/test_package_data.py parses package_data from setup.py with ast and checks that:

  • every entry names an existing package;
  • every non-Python file under olive/ is covered by a pattern.

The only exception is olive/assets/cost_models/*.csv, which the docs link to on GitHub as examples and the code never loads. Both tests fail on main and pass with this change.

I left the uninstallable tf extra (tensorflow==1.15.0) from the review alone, since removing it is a product decision.

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass. (pytest test/test_package_data.py: 2 passed. Rebuilt the wheel and confirmed olive/engine/packaging/Dockerfile.base is now included.)
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a (ruff 0.15.11 check and format on changed files)
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.
    Fixed Docker packaging failing for wheel installs because Dockerfile.base was not included in the package.

(Optional) Issue link

Part of #2516

Copilot AI balanced review requested due to automatic review settings October 17, 2026 09:30
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Docker packaging (packaging_generator) reads
olive/engine/packaging/Dockerfile.base at runtime, but setup.py never listed
it in package_data, so it was missing from built wheels and Docker
packaging failed for pip installs. Add it.

Also remove the olive.auto_optimizer entry: that package no longer exists.

Add a test that every package_data entry is a real package and every data
file under olive/ is covered, except the cost model CSVs, which are only
linked from the docs.

Part of microsoft#2516

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The resource-coverage check accepts incorrectly rooted patterns that would leave files out of the wheel.

1 open issue
What changed in this PR

Fixes Docker packaging for wheel-installed Olive by including its required Dockerfile.

Changes:

  • Adds Dockerfile.base to package data.
  • Removes the obsolete olive.auto_optimizer entry.
  • Adds checks for package existence and resource coverage.
File Description
test/​test_package_data.py Adds package-data regression checks.
setup.py Includes the Dockerfile and removes stale metadata.

Review effort: Balanced

Comment thread test/test_package_data.py Outdated
Path.match only compares trailing path components, so a pattern declared
under the wrong package (or a *.yaml pattern that should not cover nested
files) still passed. Expand each pattern with package_dir.glob, like
setuptools does, and add a test for a pattern rooted at the wrong package.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants