oracle / accelerated-data-science

ADS is the Oracle Data Science Cloud Service's python SDK supporting, model ops (train/eval/deploy), along with running workloads on Jobs and Pipeline resources.

Home Page:https://accelerated-data-science.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ADS set_auth() is failing on resource_principal

jrgauthier01 opened this issue · comments

in ADS version 2.7.0

ads.set_auth(auth='resource_principal')
fails and return:

ERROR:ads.common:ADS Exception Traceback (most recent call last): File "/home/datascience/conda/generalml_p38_cpu_v1/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3457, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "/tmp/ipykernel_5566/331412029.py", line 1, in <module> ads.set_auth(auth="resource_principal") File "/home/datascience/conda/generalml_p38_cpu_v1/lib/python3.8/site-packages/ads/common/auth.py", line 156, in set_auth raise ValueError( ValueError: ~/.oci/config path does not exist, please provide existing path to config file.

Looks like ADS is expecting use principal here with config file in path.

Current workaround is to use 2.6.8. We are working on releasing a path version

Fixed in 2.7.1 version -

>>> print(ads.__version__)
2.7.1
>>> ads.set_auth('resource_principal')
>>> ads.auth.default_signer()
{'config': {'additional_user_agent': 'Oracle-ads/version=2.7.1/surface=DATASCIENCE_NOTEBOOK'}, 'signer': <oci.auth.signers.ephemeral_resource_principals_signer.EphemeralResourcePrincipalSigner object at 0x7f20c13e0a30>, 'client_kwargs': None}
>>> exit()

Tested on instance without a config file -

(/home/datascience/conda/pytorch110_p38_gpu_v1) ls -alhr ~/.oci
ls: cannot access /home/datascience/.oci: No such file or directory
(/home/datascience/conda/pytorch110_p38_gpu_v1)