Closed ghpu closed 1 year ago
Hi @ghpu, thank you for filing the issue.
I see this is the feature that we don't have yet. (In fact nested config reminds me of OmegaConf approach to define nested properties via denormalized keys: https://omegaconf.readthedocs.io/en/2.3_branch/usage.html#from-command-line-arguments)
I would like to revamp the config approach in additional larger changes that are planned. Do you mind sharing your timelines so I can plan those changes better?
For now, I have cloned the FsspecTracker backend, so I can live without this feature and patiently wait :-)
This looks like a pretty simple change in the _read_config()
method in fsspec tracker. Here's the pull request that ought to do it without breaking BC (https://github.com/pytorch/torchx/pull/681). Basically what I did was to enable nested configs as "."
delimited flat keys. For instance in this case the endpointUrl
could be specified as
protocol=s3
root_path=s3://my-bucket
key=***
secret=**
client_kwargs.endpointUrl=http://myminio:9000
Which would be read as kwargs:
{
"protocol": "s3",
"root_path": "s3://my-bucket",
"key": "***",
"secret": "***",
"client_kwargs": {
"endpointUrl": "http://myminio:9000"
}
}
🐛 Bug
Following the tracker example app, In fsspec_backend.conf, we can specify :
In order to use Minio, one needs to pass client_kwargs with "endpointUrl" member as a struct :
But the client_kwargs argument needs to be decoded as an object, not as a str : File "/lib/python3.10/site-packages/s3fs/core.py", line 361, in set_session client_kwargs = self.client_kwargs.copy() AttributeError: 'str' object has no attribute 'copy'
Module (check all that applies):
other
: trackerEnvironment info