Skip to content

push/pull: properly collect run cache#3768

Merged
efiop merged 1 commit into
treeverse:masterfrom
efiop:1234
May 8, 2020
Merged

push/pull: properly collect run cache#3768
efiop merged 1 commit into
treeverse:masterfrom
efiop:1234

Conversation

@efiop
Copy link
Copy Markdown
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. 🙏

Comment thread dvc/stage/cache.py
entry = self._load_cache(key, value)
if not entry:
continue
stage = create_stage(
Copy link
Copy Markdown
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.

Comment thread dvc/repo/fetch.py
remote is configured
"""

used_run_cache = self.stage_cache.pull(remote) if run_cache else []
Copy link
Copy Markdown
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 treeverse: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