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

[cudo] Unable to setup credentials on cudo #3385

Closed
romilbhardwaj opened this issue Mar 28, 2024 · 4 comments
Closed

[cudo] Unable to setup credentials on cudo #3385

romilbhardwaj opened this issue Mar 28, 2024 · 4 comments
Labels

Comments

@romilbhardwaj
Copy link
Collaborator

Running sky check after following installation instructions fails with KeyError:

(base) root@f81a9cc47641:/sky_repo/skypilot# sky check
Checking credentials to enable clouds for SkyPilot.
...

  Checking Cudo...Traceback (most recent call last):
  File "/opt/conda/bin/sky", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/sky_repo/skypilot/sky/utils/common_utils.py", line 349, in _record
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/sky_repo/skypilot/sky/cli.py", line 803, in invoke
    return super().invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/sky_repo/skypilot/sky/utils/common_utils.py", line 370, in _record
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/sky_repo/skypilot/sky/cli.py", line 2812, in check
    sky_check.check(verbose=verbose)
  File "/sky_repo/skypilot/sky/check.py", line 48, in check
    check_one_cloud(cloud_tuple)
  File "/sky_repo/skypilot/sky/check.py", line 25, in check_one_cloud
    ok, reason = cloud.check_credentials()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/sky_repo/skypilot/sky/clouds/cudo.py", line 293, in check_credentials
    project_id, error = cudo_api.get_project_id()
                        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/cudo_compute/cudo_api.py", line 34, in get_project_id
    return context_config['project'], None
           ~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'project'

Looks like the credentials file generated by cudoctl has changed formats?

Full logs from running on berkeleyskypilot/skypilot-debug here: https://gist.github.com/romilbhardwaj/7324c222196248c06f92962201140cb1

Versions:

(base) root@f81a9cc47641:/sky_repo/skypilot# cudoctl --version
cudoctl version 0.3.2, commit d495ef5b4e9f8ff37738adc08765567702cec2a5, built at 2023-11-04T19:43:01Z
(base) root@f81a9cc47641:/sky_repo/skypilot# pip freeze | grep cudo
cudo-compute==0.1.8

Here's the config generated by cudoctl:

(base) ➜  ~ cat ~/.config/cudo/cudo.yml
keys:
    - key: <redacted>
      name: sky
configVersion: v0
contexts:
    - name: sky
      key: sky
      data-center: br-saopaulo-1
current-context: sky

cc @JungleCatSW

@JungleCatSW
Copy link
Contributor

Hi thanks I will take a look

@JungleCatSW
Copy link
Contributor

The issue was that if a project hadn't been created in the account or if the command line tool was set up before project creation there wouldn't be a default project in the credentials file. I have added some checks with better error messages and better instructions to handle it: #3438

Copy link

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Aug 11, 2024
@romilbhardwaj
Copy link
Collaborator Author

This is closed with #3438.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants