You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inside a python repl on a running pod, trying to create a cortex client throws an error. I know this is not a typical or expected usage of the sdk but thought I'd report it. If irrelevant, please close the issue.
Steps to reproduce
kubectl exec ... bash into a running pod
python
>>> import cortex; cortex.client()
Stack traces
>>> import cortex
>>> cl = cortex.client()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/conda/envs/env/lib/python3.6/site-packages/cortex/telemetry.py", line 106, in wrapper
return func(*args, **kwargs)
File "/opt/conda/envs/env/lib/python3.6/site-packages/cortex/__init__.py", line 38, in client
if not environments.get("default_environment"):
AttributeError: 'list' object has no attribute 'get'
@creatorrr Thanks for bringing this to our attention!
I've made the fix here, and it will be in our next release (scheduled for early next week).
That said, if it had behaved as expected, it would have hit the next line which would have returned the correct error message: "no default environment configured".
Since you are running inside of a Cortex cluster, there exists a CLI configuration ready to go; you can configure your CLI to use it by exporting CORTEX_CLI_CONFIG_DIR=/mnt/client before using your client. In our next release, this env var will automatically be set, so you won't have to manually export it in the future.
If you weren't in a Cortex cluster, you would instead use the cortex.new_client(name, operator_endpoint) constructor.
Version
0.35.0
Description
Inside a python repl on a running pod, trying to create a cortex client throws an error. I know this is not a typical or expected usage of the sdk but thought I'd report it. If irrelevant, please close the issue.
Steps to reproduce
kubectl exec ... bash
into a running podpython
>>> import cortex; cortex.client()
Stack traces
Additional context
(optional)
Suggested solution
Seems to be a problem in cortex/init.py#L38.
The text was updated successfully, but these errors were encountered: