Project

General

Profile

Actions

Idea #21020

closed

Support XDG base directory envvars throughout the Python SDK

Added by Brett Smith 10 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
SDKs
Start date:
05/31/2024
Due date:
Story points:
-

Description

We should support XDG Base Directory environment variables throughout the Python SDK. Things like XDG_CONFIG_PATH and XDG_CACHE_HOME. Note that this includes validations like ensuring the paths are absolute. There are probably packages on PyPI that can help us with this.

Known specific instances:

  • arvados.config.initialize should default to config_file=None. When the value is None, the function should search XDG_CONFIG_PATH to find arvados/settings.conf.
  • arvados.api.http_cache should create and write to to $XDG_CACHE_HOME/arvados/SUBDIR.
  • $ git grep -Fe .cache -e .config --line-number sdk/python/ sdk/cwl/ services/fuse/ services/dockercleaner/ tools/user-activity/ tools/crunchstat-summary/
    sdk/python/arvados/commands/keepdocker.py:186:        os.path.join('.cache', 'arvados', 'docker'), 0o700)
    sdk/python/arvados/commands/put.py:354:    CACHE_DIR = '.cache/arvados/arv-put'
    sdk/python/arvados/commands/put.py:436:    CACHE_DIR = '.cache/arvados/arv-put'
    sdk/python/arvados/keep.py:179:            self._disk_cache_dir = os.path.join(os.path.expanduser("~"), ".cache", "arvados", "keep")
    sdk/python/tests/arvados_testutil.py:285:        disk_cache_dir = os.path.join(os.path.expanduser("~"), ".cache", "arvados", "keep")
    services/fuse/arvados_fuse/command.py:308:            help="Filesystem cache location (default `~/.cache/arvados/keep`)",
    services/fuse/tests/mount_test_base.py:31:        disk_cache_dir = os.path.join(os.path.expanduser("~"), ".cache", "arvados", "keep")
    

Subtasks 1 (0 open1 closed)

Task #21755: Review 21020-pysdk-env-pathsResolvedBrett Smith05/31/2024Actions

Related issues

Related to Arvados - Idea #21323: System services use cache/config directories indicated by XDG env vars / systemd directivesNewActions
Actions

Also available in: Atom PDF