Project

General

Profile

Actions

Feature #22665

open

Generalize logic for getting cluster credentials

Added by Peter Amstutz 18 days ago. Updated 12 days ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
SDKs
Target version:
Story points:
-

Description

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.


Related issues 2 (1 open1 closed)

Related to Arvados - Feature #22602: arv-copy should recognize when default environment matches instance nameResolvedPeter AmstutzActions
Related to Arvados - Idea #21847: "Get API Token" usability improvementsNewActions
Actions #1

Updated by Peter Amstutz 18 days ago

  • Position changed from -944676 to -944664
Actions #2

Updated by Peter Amstutz 18 days ago

  • Related to Feature #22602: arv-copy should recognize when default environment matches instance name added
Actions #3

Updated by Peter Amstutz 18 days ago

  • Related to Idea #21847: "Get API Token" usability improvements added
Actions #4

Updated by Peter Amstutz 18 days ago

  • Description updated (diff)
Actions #5

Updated by Peter Amstutz 12 days ago

  • Target version changed from Future to Development 2025-04-16
Actions

Also available in: Atom PDF