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

repo: add head_commit_info property for studio live experiments monorepo support #10284

Closed
wants to merge 1 commit into from

Conversation

mattseddon
Copy link
Contributor

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™


Follow up to #10283. Related to https://github.com/iterative/studio/issues/8848.

This PR adds a head_commit_info property to the Repo object. This property provides the information required to correctly display live experiments generated from monorepos in Studio. The information is sent via dvc_studio_client.post_live_metrics as dvc_experiment_parent_data.

Notes:

  • This data collection doesn't fit intuitively/easily anywhere within the DVC ecosystem
  • The property will be used by both dvc and dvclive
  • I considered adding the collection to dvc-studio-client but that would involve making dvc-studio-client aware of scmrepo and/or GitCommits.

Is there a better place to put this functionality?

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (44b78b8) 90.43% compared to head (b1ad23d) 90.43%.

Files Patch % Lines
dvc/repo/__init__.py 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10284   +/-   ##
=======================================
  Coverage   90.43%   90.43%           
=======================================
  Files         494      494           
  Lines       37811    37841   +30     
  Branches     5468     5478   +10     
=======================================
+ Hits        34193    34222   +29     
  Misses       2985     2985           
- Partials      633      634    +1     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@skshetry
Copy link
Member

skshetry commented Feb 7, 2024

Could you share an example how this will be used?

@mattseddon
Copy link
Contributor Author

Could you share an example how this will be used?

@skshetry see iterative/dvclive#774 & #10285

@skshetry
Copy link
Member

skshetry commented Feb 7, 2024

@mattseddon, Repo has a large API surface. So, we don't usually add any API directly to it as possible.
We have split up the parts of Repo into smaller APIs, like repo.scm for example, that houses all git-related procedures and functions.

repo.scm has APIs that gives you all required information, as you have used in the PR already. What you have in head_commit_info is a very specific serialization of GitCommit for Studio, so I don't think it should a Repo property.

Either this should be handled in appropriate places, in dvclive and in dvc separately, or at best, it should be a utility function somewhere in dvc.scm/dvc.utils.studio.

I'd prefer the former, as they are independent clients and can have independent implementations, but I have nothing against the latter.

I considered adding the collection to dvc-studio-client but that would involve making dvc-studio-client aware of scmrepo and/or GitCommits.

In medium/long-term, I'd like to move away from dvc-studio-client. It tries to be independent of dvc, but it has to try to re-implement parts of dvc.
dvclive already depends on dvc and I see no point in maintaining dvc-studio-client at the moment. It just creates issues like this.

@mattseddon mattseddon closed this Feb 7, 2024
@mattseddon mattseddon self-assigned this Feb 7, 2024
@mattseddon
Copy link
Contributor Author

I'll move everything around.

@mattseddon
Copy link
Contributor Author

dvclive already depends on dvc and I see no point in maintaining dvc-studio-client at the moment. It just creates issues like this.

@skshetry is the suggestion here to move dvc-studio-client into dvc? I can take that if that's what you want to do.

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