Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to list out environmental variables used for configuration #79

Open
matthewfeickert opened this issue Oct 26, 2021 · 0 comments
Labels
API Changes the public API enhancement New feature or request

Comments

@matthewfeickert
Copy link
Member

There are multiple environmental variables that can affect the RECAST config

class Config(object):
@property
def default_run_backend(self):
return os.environ.get('RECAST_DEFAULT_RUN_BACKEND', 'docker')
def default_build_backend(self):
return os.environ.get('RECAST_DEFAULT_BUILD_BACKEND', 'docker')
@property
def backends(self):
return {
"local": {
"metadata": {
"short_description": "runs locally with natively installed tools"
},
"fromstring": conf_from_env(
"RECAST_LOCAL_BACKENDSTRING", "multiproc:auto"
),
},
"docker": {
"metadata": {"short_description": "runs with containerized tools"},
"fromstring": conf_from_env(
"RECAST_DOCKER_BACKENDSTRING", "multiproc:auto"
),
"image": conf_from_env(
"RECAST_DOCKER_IMAGE", "recast/recastatlas:v0.1.8"
),
"cvmfs": {"location": "/cvmfs", "propagation": "rprivate"},
"reg": {
"user": conf_from_env("RECAST_REGISTRY_USERNAME"),
"pass": conf_from_env("RECAST_REGISTRY_PASSWORD"),
"host": conf_from_env("RECAST_REGISTRY_HOST"),
},
"schema_load_token": conf_from_env("YADAGE_SCHEMA_LOAD_TOKEN"),
"init_token": conf_from_env("YADAGE_SCHEMA_LOAD_TOKEN"),
"auth_location": conf_from_env("PACKTIVITY_AUTH_LOCATION"),
},
"kubernetes": {
"metadata": {"short_description": "runs on a Kubernetes cluster"},
"buildkit_addr": conf_from_env(
"RECAST_KUBERNETES_BUILDKIT_ADDR", 'kube-pod://buildkitd'
),
},
"reana": {
"metadata": {"short_description": "runs on a REANA deployment"},
"access_token": conf_from_env('REANA_ACCESS_TOKEN', None),
"cvmfs_repos": conf_from_env(
'RECAST_REANA_CVMFS_REPOS', ['atlas.cern.ch', 'atlas-condb.cern.ch']
),
},
}

though these aren't made explicitly clear to users. It would be helpful to add the ability to check all environmental variables that can affect the config by adding something like recast backends config --check, which would act similar to recast backends ls --check in that it would dump all environmental information for backends to stdout.

@matthewfeickert matthewfeickert added enhancement New feature or request API Changes the public API labels Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes the public API enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant