You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ mkdir storage_1
$ python3 create.py
ClearML results page: https://(...)/output/log
ClearML dataset page: https://(...)
Uploading dataset changes (1 files compressed to 125 B) to file:///home/user/clearml_path_substitution/storage_1
File compression and upload completed: total size 125 B, 1 chunk(s) stored (average size 125 B)
(Loading it at this point by running load.py works as expected.)
Move the storage location:
$ mv storage_1 storage_2
Add the path substitution rule:
$ (...)
$ cat ~/clearml.conf
api {
(...)
}
sdk {
storage {
path_substitution = [
# Replace registered links with local prefixes,# Solve mapping issues, and allow for external resource caching.
{
registered_prefix = "file:///home/user/clearml_path_substitution/storage_1"
local_prefix = "file:///home/user/clearml_path_substitution/storage_2"
}
]
}
}
Try loading from the new location:
$ python3 load.py
Traceback (most recent call last):
File "/home/user/clearml_path_substitution/load.py", line 3, in<module>
dataset = Dataset.get(
File "/home/user/miniconda3/envs/clearml/lib/python3.10/site-packages/clearml/datasets/dataset.py", line 1778, in get
instance = get_instance(dataset_id)
File "/home/user/miniconda3/envs/clearml/lib/python3.10/site-packages/clearml/datasets/dataset.py", line 1690, in get_instance
raise ValueError("Could not load Dataset id={} state".format(task.id))
ValueError: Could not load Dataset id=(...) state
Expected behaviour
Loading should be possible from the new storage location using path substitution.
Hi @nfzd ! Looks like the StorageHelper tries to access file:// links directly, without applying file substitution, and if the referenced file does not exist, then the program will raise an error.
We will need to fix this on our side (or if you wish to contribute you could open a PR that handles path substitutions in
The only workaround I can think of is forcing get_direct_access to return None:
from clearml.storage.helper import _FileStorageDriver
_FileStorageDriver.get_direct_access = lambda *args: None
# should work
from clearml import Dataset
d = Dataset.get("d2412eff1f7f462fb6c81065e043cd8b")
Describe the bug
output_uri
.To reproduce
Contents of
clearml.conf
:In folder
/home/user/clearml_path_substitution
.Contents of file
create.py
:Contents of file
load.py
:Create dataset:
(Loading it at this point by running
load.py
works as expected.)Move the storage location:
Add the path substitution rule:
Try loading from the new location:
Expected behaviour
Loading should be possible from the new storage location using path substitution.
Environment
The text was updated successfully, but these errors were encountered: