Skip to content

introduce dvc update for ext repos#2218

Merged
efiop merged 3 commits into
treeverse:masterfrom
efiop:update
Jul 5, 2019
Merged

introduce dvc update for ext repos#2218
efiop merged 3 commits into
treeverse:masterfrom
efiop:update

Conversation

@efiop
Copy link
Copy Markdown
Contributor

@efiop efiop commented Jul 2, 2019

  • Have you followed the guidelines in our
    Contributing document?

  • Does your PR affect documented changes or does it add new functionality
    that should be documented? If yes, have you created a PR for
    dvc.org documenting it or at
    least opened an issue for it? If so, please add a link to it.

treeverse/dvc.org#474


@efiop efiop changed the title {WIP] introduce dvc update for ext repos [WIP] introduce dvc update for ext repos Jul 2, 2019
@efiop efiop force-pushed the update branch 3 times, most recently from bc45a8e to d03ed49 Compare July 3, 2019 15:21
@efiop efiop changed the title [WIP] introduce dvc update for ext repos introduce dvc update for ext repos Jul 3, 2019
@efiop efiop force-pushed the update branch 4 times, most recently from 8834cee to e16aafc Compare July 3, 2019 19:40
@efiop efiop changed the title introduce dvc update for ext repos [WIP] introduce dvc update for ext repos Jul 3, 2019
@efiop efiop force-pushed the update branch 4 times, most recently from 556ef47 to e21320c Compare July 4, 2019 12:17
@efiop efiop changed the title [WIP] introduce dvc update for ext repos introduce dvc update for ext repos Jul 4, 2019
@efiop efiop requested review from Suor, pared and shcheklein July 4, 2019 13:58
Comment thread dvc/dependency/repo.py Outdated
Comment thread dvc/repo/imp.py Outdated
Comment thread dvc/repo/get.py Outdated
@efiop efiop force-pushed the update branch 5 times, most recently from bfa2f99 to 70f5177 Compare July 5, 2019 12:11
@efiop
Copy link
Copy Markdown
Contributor Author

efiop commented Jul 5, 2019

@Suor Updated my patch to get rid of enter/exit. Please take a look 🙂

Comment thread dvc/stage.py Outdated
Comment thread dvc/stage.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we reuse force or something, to avoid this locked flag manipulation ... does not look really nice

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.

force doesn't affect locked stages. But I'll take a look.

Comment thread dvc/repo/__init__.py Outdated
Comment thread dvc/external_repo.py Outdated
Comment thread dvc/external_repo.py Outdated
Comment thread dvc/external_repo.py Outdated
Comment thread dvc/command/update.py Outdated
@shcheklein
Copy link
Copy Markdown
Contributor

please, update zsh/bash autocompletes if it's not done yet

Comment thread dvc/dependency/repo.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

are we running status for the locked stage?

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.

We do, but not for the dependencies. So update available will only be visible if you dvc unlock import.dvc

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is there a way to check the status before updating it then?

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.

Yes, if you dvc unlock import.dvc first and then run dvc status

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm ... not an easy interface ... don't see an easy way to make it better ... may be make dvc status target.dvc ignore the lock?

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.

@shcheklein Maybe dvc update something.dvc --dry then? Changing dvc status itself doesn't feel right.

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.

@shcheklein In any case, that additional command can be introduced on top, as it doesn't affect the rest of the logic.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

--dry sounds like a good start

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why status ignores locked stages? This doesn't make sense from consistency POV only from optimization one. Is locked about optimization?

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.

Yes, locked is also about not actively going and checking dependencies of the stage(e.g. not re-downloading external repo, not going to s3 to check for external s3 dependency etc). Also, locked is kinda making a data source from any stage, so showing status for its dependencies doesn't seem like a desired behaviour.

Comment thread dvc/dependency/repo.py Outdated
@efiop efiop changed the title introduce dvc update for ext repos [WIP] introduce dvc update for ext repos Jul 5, 2019
Fixes treeverse#1774
Fixes treeverse#2139
Fixes treeverse#2201

Signed-off-by: Ruslan Kuprieiev <ruslan@iterative.ai>
@efiop efiop changed the title [WIP] introduce dvc update for ext repos introduce dvc update for ext repos Jul 5, 2019
@efiop efiop requested a review from shcheklein July 5, 2019 20:55
Comment thread dvc/dependency/repo.py Outdated
Signed-off-by: Ruslan Kuprieiev <ruslan@iterative.ai>
@shcheklein
Copy link
Copy Markdown
Contributor

add a few tickets to update lock flag description, lock/unlock command references, import-url command reference with the new semantics (in case we change it)

Signed-off-by: Ruslan Kuprieiev <ruslan@iterative.ai>
@efiop
Copy link
Copy Markdown
Contributor Author

efiop commented Jul 5, 2019

@shcheklein Added #2238 for import-url. I don't think locked and dvc lock/unlock commands need any updates caused by this PR.

@efiop
Copy link
Copy Markdown
Contributor Author

efiop commented Jul 5, 2019

@shcheklein Ah, you probably mean that those now should mention that it not only dvc lock that is setting up that flag now. Got it.

@shcheklein
Copy link
Copy Markdown
Contributor

@efiop I meant docs, btw :) I think it worth mentioning on their command references that there is an update command. We'll see if it makes sense.

@efiop
Copy link
Copy Markdown
Contributor Author

efiop commented Jul 5, 2019

@shcheklein Got it. Change for import-url will come separately, so we'll handle the docs for it there. Added a ticket for lock treeverse/dvc.org#478

@efiop efiop requested a review from shcheklein July 5, 2019 23:26
Copy link
Copy Markdown
Contributor

@shcheklein shcheklein left a comment

Choose a reason for hiding this comment

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

🎉

@efiop efiop merged commit 932b0d7 into treeverse:master Jul 5, 2019
@efiop efiop deleted the update branch July 5, 2019 23:28
Comment thread dvc/dependency/repo.py

out = repo.find_out_by_relpath(self.def_path)
repo.fetch(out.stage.path)
to.info = copy.copy(out.info)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it safe to change passed argument here?

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.

@Suor yes, we are effectively doing to.info.save(), but it will run later anyway to verify that everything is in check.

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.

3 participants