Skip to content

Commit a5502b3

Browse files
committed
correct using dvc with cloud bucket for uv
1 parent 0500321 commit a5502b3

2 files changed

Lines changed: 65 additions & 22 deletions

File tree

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ repos:
2828
additional_dependencies: [tomli]
2929
exclude: pyproject.toml
3030

31-
# - repo: https://github.com/igorshubovych/markdownlint-cli
32-
# rev: v0.47.0
33-
# hooks:
34-
# - id: markdownlint
35-
# args: ["-c", ".github/markdownlint.json"]
31+
- repo: https://github.com/igorshubovych/markdownlint-cli
32+
rev: v0.47.0
33+
hooks:
34+
- id: markdownlint
35+
args: ["-c", ".github/markdownlint.json"]
3636

3737
- repo: https://github.com/crate-ci/typos
3838
rev: v1

s6_the_cloud/using_the_cloud.md

Lines changed: 60 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -223,22 +223,46 @@ We are going to follow the instructions from this [page](https://dvc.org/doc/use
223223

224224
3. Next, we need the Google storage extension for `dvc`.
225225

226-
```bash
227-
pip install dvc-gs
228-
```
226+
=== "Using pip"
227+
228+
```bash
229+
pip install dvc-gs
230+
```
231+
232+
=== "Using uv"
233+
234+
```bash
235+
uv add dvc-gs
236+
```
229237

230238
4. Now in your corrupt MNIST repository where you have already configured `dvc`, we are going to change the storage
231239
from our Google Drive to our newly created Google Cloud storage.
232240

233-
```bash
234-
dvc remote add -d remote_storage <output-from-gsutils>
235-
```
241+
=== "Using pip"
242+
243+
```bash
244+
dvc remote add -d remote_storage <output-from-gsutils>
245+
```
246+
247+
=== "Using uv"
248+
249+
```bash
250+
uv run dvc remote add -d remote_storage <output-from-gsutils>
251+
```
236252

237253
In addition, we are also going to modify the remote to support object versioning (called `version_aware` in `dvc`):
238254

239-
```bash
240-
dvc remote modify remote_storage version_aware true
241-
```
255+
=== "Using pip"
256+
257+
```bash
258+
dvc remote modify remote_storage version_aware true
259+
```
260+
261+
=== "Using uv"
262+
263+
```bash
264+
uv run dvc remote modify remote_storage version_aware true
265+
```
242266

243267
This will change the default way that `dvc` handles data. Instead of just storing the latest version of the data as
244268
[content-addressable storage](https://dvc.org/doc/user-guide/project-structure/internal-files#structure-of-the-cache-directory),
@@ -248,19 +272,38 @@ We are going to follow the instructions from this [page](https://dvc.org/doc/use
248272
5. The above command will change the `.dvc/config` file. `git add` and `git commit` the changes to that file.
249273
Finally, push data to the cloud.
250274

251-
```bash
252-
dvc push --no-run-cache # (1)!
253-
```
275+
=== "Using pip"
254276

255-
1. :man_raising_hand: The `--no-run-cache` flag is used to avoid pushing the cache file to the cloud, which is not
256-
supported by the Google Cloud storage.
277+
```bash
278+
dvc push --no-run-cache # (1)!
279+
```
280+
281+
1. :man_raising_hand: The `--no-run-cache` flag is used to avoid pushing the cache file to the cloud, which is
282+
not supported by the Google Cloud storage.
283+
284+
=== "Using uv"
285+
286+
```bash
287+
uv run dvc push --no-run-cache # (1)!
288+
```
289+
290+
1. :man_raising_hand: The `--no-run-cache` flag is used to avoid pushing the cache file to the cloud, which is
291+
not supported by the Google Cloud storage.
257292

258293
6. Finally, make sure that you can pull without having to give your credentials. The easiest way to see this
259294
is to delete the `.dvc/cache` folder that should be on your laptop and afterward do a
260295

261-
```bash
262-
dvc pull --no-run-cache
263-
```
296+
=== "Using pip"
297+
298+
```bash
299+
dvc pull --no-run-cache
300+
```
301+
302+
=== "Using uv"
303+
304+
```bash
305+
uv run dvc pull --no-run-cache
306+
```
264307

265308
This setup should work when trying to access the data from your laptop, which we authenticated in the previous
266309
module. However, how can you access the data from a virtual machine, inside a docker container or from a different

0 commit comments

Comments
 (0)