Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import clearml
- from pathlib import Path
- from cloudpathlib import S3Path
- # Files in dir:
- # a.txt
- # b.txt
- zip_dir = Path("./files")
- # Files in dir:
- # b.txt
- # c.txt
- ext_dir = S3Path("s3://rnd-dev/temp/broken_zip_example/files")
- ds_v1 = clearml.Dataset.create(
- dataset_project="test",
- dataset_name="broken-links",
- dataset_version="1.0.0",
- description="Contains just file entries",
- )
- ds_v1.add_files(zip_dir)
- ds_v1.upload()
- ds_v1.finalize()
- ds_v2 = clearml.Dataset.create(
- dataset_project="test",
- dataset_name="broken-links",
- dataset_version="2.0.0",
- description="Files modified with ext links",
- parent_datasets=[ds_v1],
- )
- ds_v2.add_external_files("s3://SR_URL/rnd-dev/temp/broken_zip_example/files")
- ds_v2.upload()
- ds_v2.finalize()
- # Files in path
- # a.txt -> Symlinked to v1 a.txt
- # b.txt -> Symlinked to v1 b.txt (broken, should've been the b.txt from S3)
- # c.txt
- ds_v2_path = ds_v2.get_local_copy()
Advertisement
Add Comment
Please, Sign In to add comment