reproduce: Update --pull#9375
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
| try: | ||
| if kwargs.get("pull", False) and stage.is_data_source or stage.is_import: | ||
| logger.debug("Pulling '%s'", stage.addressing) | ||
| stage.repo.pull(stage.addressing) |
There was a problem hiding this comment.
I'm -1 on using high-level API in reproduce().
There was a problem hiding this comment.
@skshetry Could you elaborate more?
We currently call stage.repo.cloud.pull as part of reproduce (when --pull is passed), in the restore of the run cache which is way more down the rabbit hole:
Is it better to "hide" it?
There was a problem hiding this comment.
DataCloud.pull() is an internal API and only concerns with pulling objects that you want, so it's a good fit to use here.
The only problem with it is that it does not support cloud versioning.
There was a problem hiding this comment.
only concerns with pulling objects that you want
In the current P.R. I am using repo.pull(dep.addressing) so would only pull what I want.
Should I change to cloud.pull API?
Still don't understand the benefit/reason, though
There was a problem hiding this comment.
self.repo.cloud.pull() has much smaller scope than repo.pull(), so it'll be faster and more reliable, and goes through less code. Also has less chances of getting broken in the future.
0dccb45 to
22eaf57
Compare
pull flag to also pull run cache, data_sources and imports.--pull
22eaf57 to
99dc272
Compare
99dc272 to
61332f7
Compare
|
@dberenbaum Wanted to double-check again the expected high-level behavior from a product perspective before getting into implementation / UX discussion (and fixing a couple of bugs). I pushed a new version with a flag I pushed a couple of runs to the example-get-started remote and tested with the following script: Detailsexport AWS_PROFILE=iterative-sandbox
echo "FRESH CLONE"
git clone git@github.com:iterative/example-get-started.git
cd example-get-started
dvc remote add -d --local storage s3://dvc-public/remote/get-started
dvc exp run --pull --pull-missing-deps
cd ..
rm -rf example-get-started
echo "RUN CACHE TRAIN & UNCHANGED EVALUATE"
git clone git@github.com:iterative/example-get-started.git
cd example-get-started
dvc remote add -d --local storage s3://dvc-public/remote/get-started
dvc exp run -S train.n_est=60 --pull-missing-deps
cd ..
rm -rf example-get-started
echo "RUN TRAIN AND EVALUATE"
git clone git@github.com:iterative/example-get-started.git
cd example-get-started
dvc remote add -d --local storage s3://dvc-public/remote/get-started
dvc exp run -S train.n_est=66 --pull-missing-deps
cd ..
rm -rf example-get-started
echo "RUN-CACHE FEATURIZE & RUN TRAIN AND EVALUATE"
git clone git@github.com:iterative/example-get-started.git
cd example-get-started
dvc remote add -d --local storage s3://dvc-public/remote/get-started
dvc exp run -S featurize.max_features=150 -S train.n_est=77 --pull-missing-deps
cd ..
rm -rf example-get-startedUnless I am missing something, this behaves as you described in the issue. If you agree, now the problem is that the code is a mess as it breaks many previous assumptions that we should discuss. |
61332f7 to
77f8209
Compare
|
@daavoo Yep, the behavior looks good and matches what's described in the issue, but I think it maybe goes further than needed, and it would be better to break this down into smaller pieces. AFAICT, there are 3 main features combined here:
|
|
@dberenbaum Thanks for the synthesis, makes sense. My thoughts:
Makes sense as a non-breaking change for the current
Should we enable that behavior as part of It changes existing assumptions of
To me, it is actually what would add value to the current |
After #8738 , run cache is not saved for a stage if any output has `cache: false`.
It is a redundant check and just prevents using `StageCache._load` in cases where a dependency doesn't exists locally.
77f8209 to
b754444
Compare
Agreed. WDYT about doing that and merging as one PR?
Yes, makes sense as its own flag, at least for now. Maybe
Does it make sense? Do you think behavior is more clear that way?
Sure, it's useful and powerful, just maybe not as obvious. I think it makes sense as part of |
Closes #4742