Comments (7)
DVC's caches/remotes are content-addressable. There is no 1:1 mapping between cache <> workspace or remote <> workspace.
We don't always preserve timestamps even on the local cache (see #8602). In DVC, we use checksum rather than timestamp, which is superior to my mind.
Unfortunately, I don't have a workaround to suggest here. The same thing would happen if you track with Git.
from dvc.
But there should be a 1:1 mapping between local DVC cache and remote? As dvc fetch
needs to download the object from S3 to a local file. That step should know the S3 object bucket and key (and maybe version ID) and thus be able to obtain the timestamp from there to be able to set the mtime of the file object in the DVC cache I would expect.
The link from workspace to local DVC cache is done in my particular case with link type symlink
. This makes it not necessary to preserve file attributes such as mtime between cache and workspace. Only during the remote to cache transfer.
from dvc.
With Git, I can use git-restore-mtime
to set the mtime to the last commit timestamp. For DVC, the equivalent would be "last push of a new object to persistent remote storage" timestamp.
from dvc.
I see two workarounds for my particular use case:
- Option 1: Use AWS CLI to populate local DVC cache
aws s3 sync s3://<bucket>/<prefix>/files .dvc/cache/files
This preserves mtime of objects stored in the remote (which is what I would like dvc fetch
to do).
- Option 2: Use GitHub Action to cache
.dvc/cache
folder
jobs:
<name>:
# ...
steps:
- name: Restore media cache
id: cache_media
uses: actions/cache@v4
with:
key: media-${{ hashFiles('.dvc/config') }}
path: .dvc/cache
- name: Obtain AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ***
aws-region: ***
- name: Update media files
run: |
dvc gc --workspace --force
dvc pull media.dvc
After either of these two steps, dvc pull
or dvc checkout
creates the symbolic links in my workspace.
from dvc.
Related Issues (20)
- exp run: unnecessary hashing during experiments HOT 1
- pull specific_file.dvc: SCM-Error when dvc import without access in same repository HOT 13
- `dvc.api.dataset`
- data status returns files as "Not in remote" even though they are marked as push: false in pipeline
- `dvc.api.open`: broken with `no_scm` HOT 2
- experiments: submit to studio
- Failed to create a Pyinstaller app that includes dvc HOT 8
- Gett Error with pushing large file (data.csv ~ 280MB size) HOT 2
- DVC fails to read path to python.exe, if forward slashes "/ " used in windows HOT 6
- API for updating hash and size in dvc.lock file due to changes that'd have no effect on dvc DAG HOT 4
- Forward Agent usage HOT 3
- import: flag / parameter to skip the computation of the checksums HOT 1
- DVC Fetch stuck
- DVC Fetch stuck HOT 8
- Unable to extract dvc Stage Name HOT 3
- pull: S3FileSystem._get_file() got an unexpected keyword argument 'max_concurrency' HOT 3
- Is there a way to print dvc data version of the current data file. I am messing around with dvc.api, but couldnt find a functionality that could print the current version of the data(git tag) inside the python code? HOT 4
- pull: _get_file() got an unexpected keyword argument 'max_concurrency' HOT 4
- datasets: delta lake and huggingface HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dvc.