-
Notifications
You must be signed in to change notification settings - Fork 7k
[ci] sorting requirements and constraints for raydepsets #58414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci] sorting requirements and constraints for raydepsets #58414
Conversation
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces sorting for flags, requirements, and constraints when generating dependency lock files with raydepsets. This is a valuable change for ensuring deterministic and reproducible builds in the CI environment. The core logic change in ci/raydepsets/cli.py is correct, and the updated lock files reflect the intended deterministic ordering. I have one minor suggestion to improve the code's conciseness.
| for requirement in sorted(requirements): | ||
| args.extend([requirement]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| args.extend(["-c", constraint]) | ||
| if requirements: | ||
| for requirement in requirements: | ||
| for requirement in sorted(requirements): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Dependency resolution breaks with sorted requirements files
Sorting requirements files alphabetically can change dependency resolution behavior. The order of requirements files matters in pip/uv because later files can override or add constraints from earlier files. By sorting the requirements list, files that were intentionally ordered (e.g., base requirements before specific overrides) may be processed in the wrong order, potentially leading to different dependency versions being resolved. For example, docker/base-deps/requirements.in will now be processed before release/ray_release/byod/ray_dev_py3.10.in due to alphabetical sorting, which may not be the intended precedence order.
ci/raydepsets/cli.py
Outdated
| args.extend(["--cache-dir", self._uv_cache_dir]) | ||
| if override_flags: | ||
| args = _override_uv_flags(override_flags, args) | ||
| args = _override_uv_flags(sorted(override_flags), args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any unit test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the flag sorting in preparation of building the flag class to handle defaulting, removal and setting flags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added unit tests for requirements and constraints
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
…#58414) Sorting requirements and constraints for raydepsets --------- Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
…#58414) Sorting requirements and constraints for raydepsets --------- Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
…#58414) Sorting requirements and constraints for raydepsets --------- Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> Signed-off-by: Aydin Abiar <aydin@anyscale.com>
…#58414) Sorting requirements and constraints for raydepsets --------- Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> Signed-off-by: YK <1811651+ykdojo@users.noreply.github.com>
…#58414) Sorting requirements and constraints for raydepsets --------- Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Sorting requirements and constraints for raydepsets