Skip to content
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

add validation to reqs arg in cluster install pkgs method #1815

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BelSasha
Copy link
Contributor

No description provided.

@BelSasha BelSasha marked this pull request as ready for review March 11, 2025 09:56
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@BelSasha BelSasha force-pushed the sb/fix-cluster-install-pkg-arg-validation branch from 665c7eb to 54c1d7b Compare March 11, 2025 13:41
@BelSasha BelSasha requested a review from carolineechen March 11, 2025 13:42
@@ -832,6 +832,8 @@ def install_packages(
>>> cluster.pip_install(reqs=["accelerate", "diffusers"])
>>> cluster.pip_install(reqs=["accelerate", "diffusers"], conda_env_name="my_conda_env", override_remote_version=True)
"""
reqs = [reqs] if isinstance(reqs, str) else reqs
Copy link
Collaborator

Choose a reason for hiding this comment

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

could we update the type checking in the function arg too? Union[str, List[str]]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also added support for passing a single rh.Package instance (and not a list of rh.Package instances).

@BelSasha BelSasha force-pushed the sb/fix-cluster-install-pkg-arg-validation branch from 54c1d7b to 61ed5f5 Compare March 12, 2025 08:14
@BelSasha BelSasha requested a review from carolineechen March 12, 2025 08:14
@BelSasha BelSasha force-pushed the sb/fix-cluster-install-pkg-arg-validation branch from 61ed5f5 to 5f01b75 Compare March 12, 2025 14:20
Copy link
Collaborator

@carolineechen carolineechen left a comment

Choose a reason for hiding this comment

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

actually do you think we could hold off on this change? there's a couple things

  • with the addition of pip_install, conda_install, etc, it may make sense to eventually turn install_packages internal facing, in which case we might not need to update the signature
  • on that note, if we want to support single packages it probably makes more sense to do it inside those more specific functions, which can be more vague (vs install_packages does indicate plural)
  • I don't think we need to support Package input type for the individual functions, those should be abstracted away internally and push users towards just using strings rather than constructing packages.
  • and given the new direction, maybe we'll end up adjusting these APIs too so I think we can keep this in mind but no need to implement it now?

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