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

push/pull: properly collect run cache #3768

Merged
merged 1 commit into from
May 8, 2020
Merged

push/pull: properly collect run cache #3768

merged 1 commit into from
May 8, 2020

Conversation

efiop
Copy link
Contributor

@efiop efiop commented May 8, 2020

Ideally run cache should be a part of NamedCache and transferred as a regular cache through push/pull, but that requires a refactor, so for now we keep doing that manually to unblock CICD.

Fixes #1234

  • ❗ I have followed the Contributing to DVC checklist.

  • 📖 If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here. If the CLI API is changed, I have updated tab completion scripts.

  • ❌ I will check DeepSource, CodeClimate, and other sanity checks below. (We consider them recommendatory and don't expect everything to be addressed. Please fix things that actually improve code or fix bugs.)

Thank you for the contribution - we'll try to review it as soon as possible. 🙏

entry = self._load_cache(key, value)
if not entry:
continue
stage = create_stage(
Copy link
Contributor Author

@efiop efiop May 8, 2020

Choose a reason for hiding this comment

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

Yep, this is hacky. But run cache has a very good control over what it can contain (see _get_stage_hash above), so we can do such things without any problems for now.

@@ -34,6 +34,9 @@ def _fetch(
config.NoRemoteError: thrown when downloading only local files and no
remote is configured
"""

used_run_cache = self.stage_cache.pull(remote) if run_cache else []
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shame NamedCache relies on checksums so heavily(or rather push/pull itself), otherwise we could've fed stage_cache to it directly. But for now, this works fine.

@efiop efiop changed the title [WIP] push/pull: properly collect run cache push/pull: properly collect run cache May 8, 2020
@efiop efiop merged commit d62a54c into iterative:master May 8, 2020
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.

repro: use build cache for deterministic stages
1 participant