Skip to content

Commit

Permalink
Merge pull request #2218 from opentensor/fix/roman/local_env_vars
Browse files Browse the repository at this point in the history
Fix the usage of env vars in default settings.
  • Loading branch information
ibraheem-opentensor authored Aug 8, 2024
2 parents 9028263 + ed836e6 commit 0975c7d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions bittensor/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,20 @@ def turn_console_on():
},
}


_BT_AXON_PORT = os.getenv("BT_AXON_PORT")
_BT_AXON_MAX_WORKERS = os.getenv("BT_AXON_MAX_WORKERS")
_BT_PRIORITY_MAX_WORKERS = os.getenv("BT_PRIORITY_MAX_WORKERS")
_BT_PRIORITY_MAXSIZE = os.getenv("BT_PRIORITY_MAXSIZE")

DEFAULTS = munchify(
{
"axon": {
"port": os.getenv("BT_AXON_PORT") or 8091,
"port": int(_BT_AXON_PORT) if _BT_AXON_PORT else 8091,
"ip": os.getenv("BT_AXON_IP") or "[::]",
"external_port": os.getenv("BT_AXON_EXTERNAL_PORT") or None,
"external_ip": os.getenv("BT_AXON_EXTERNAL_IP") or None,
"max_workers": os.getenv("BT_AXON_MAX_WORKERS") or 10,
"max_workers": int(_BT_AXON_MAX_WORKERS) if _BT_AXON_MAX_WORKERS else 10,
},
"logging": {
"debug": os.getenv("BT_LOGGING_DEBUG") or False,
Expand All @@ -178,8 +184,10 @@ def turn_console_on():
"logging_dir": os.getenv("BT_LOGGING_LOGGING_DIR") or str(MINERS_DIR),
},
"priority": {
"max_workers": os.getenv("BT_PRIORITY_MAX_WORKERS") or 5,
"maxsize": os.getenv("BT_PRIORITY_MAXSIZE") or 10,
"max_workers": int(_BT_PRIORITY_MAX_WORKERS)
if _BT_PRIORITY_MAX_WORKERS
else 5,
"maxsize": int(_BT_PRIORITY_MAXSIZE) if _BT_PRIORITY_MAXSIZE else 10,
},
"subtensor": {
"chain_endpoint": DEFAULT_ENDPOINT,
Expand Down

0 comments on commit 0975c7d

Please sign in to comment.