allegroai/clearml-agent

Support `git fetch --tags`

reinerp opened this issue · 6 comments

My team is considering an approach where each experiment we run is pushed to a git tag on our repo. Ideally we'd like ClearML to run from that tag.

However, the ClearML agent uses git fetch --all --recurse-submodules on its VCS cache, which only fetches commits from branches, and it ignores commits that are only reachable from tags. Would it be possible to extend the pull command to be git fetch --all --recurse-submodules --tags?

self.call("fetch", "--all", "--recurse-submodules", cwd=self.location)

Hi @reinerp,

If you specify the tag instead of a branch name, it should work out of the box 🙂

I tried that. It works if the VCS cache is disabled, because that uses a git clone command that does in fact fetch tags. However, if I enable the VCS cache then it fails.

The recent commit 4179ac5 looks like it would also "fix" my issue, but it would do so by effectively disabling the VCS cache, since every single tag fetch will be a cache miss and a full repository fetch.

What I'm asking for here is to make tags work under the VCS cache, by extending the git fetch command that I linked.

Oh this seems to be an issue with the git pull (that is called on the VCS cache) but for some reason not updating the new tags (or the tags that moved).
It does call --all when calling the fetch but I think you are correct and we need to add --tags...
We will add that in the next RC release

Thanks!

@reinerp, if you move a tag, does using --tags work and the new tag is fetched correctly?

Hey @reinerp! Just letting you know that this issue has been resolved in the recently released v1.9.0. Let us know if there are any issues :)