Feature #22665
Updated by Peter Amstutz 19 days ago
Following on the @api_for_instance@ logic in arv-copy, it would be nice to generalize this and use it in our other tools.
We want behavior like:
* If the target cluster can be inferred (e.g. there's an Arvados uuid in the input somewhere) then the tool can choose the right credentials by default (this is how arv-copy works currently).
* Instead of ARVADOS_API_HOST and ARVADOS_API_TOKEN we could have single environment variable like ARVADOS_CLUSTER (or ARVADOS_INSTANCE) that is just the cluster id
* Getting credentials from workbench and saving them locally should be streamlined (e.g. #21847)
* It would convenient to have the default @settings.conf@ symlink to the config file named by cluster id.
Also, it could be helpful to check token validity using api.api_client_authorizations().current() and providing a standardized error message instead of failing on first use.
We might want to put this logic into the default constructor (e.g. arvados.api()) with a new optional parameter like @cluster_id: str@ as well as looking for ARVADOS_INSTANCE in the environment. This would make the new functionality available for everyone, while the behavior of inferring the right cluster can be phased in to individual tools.