skypilot icon indicating copy to clipboard operation
skypilot copied to clipboard

Support for multiple GCP configurations and remove `default` requirement

Open gmittal opened this issue 2 years ago • 2 comments

I have multiple GCP accounts/configurations (TPU research cloud, personal account, various organization accounts, etc.) and would like to be able to switch between them and have SkyPilot automatically use the currently active configuration (or have some way to hardcode which configuration SkyPilot should always use).

I also would like to name my configurations something other than default and have SkyPilot work (currently fails because it looks for a default credential file).

https://github.com/skypilot-org/skypilot/blob/master/sky/clouds/gcp.py#L21

gmittal avatar Oct 04 '22 18:10 gmittal

Hey @gmittal a few questions:

  • By "the currently active configuration", do you mean whatever is currently encoded in ~/.config/gcloud/active_config? This file contains a string that identifies a file in ~/.config/gcloud/configurations/.
  • For switching, you could run gcloud init to choose the new project and then gcloud auth application-default login. This will switch the config files correctly. We can then make SkyPilot always pick up the config pointed to by active_config. Would this manual switching suffice for your use case?

concretevitamin avatar Oct 05 '22 15:10 concretevitamin

Yes, by currently active configuration I mean the whatever is encoded in ~/.config/gcloud/active_config (also viewable with gcloud config configurations list).

The manual switching works for me, in my other workflows I currently switch configurations using gcloud config configurations activate CONFIG_NAME, and SkyPilot picking up the config pointed to by active_config sounds like a good fix rather than assuming the default configuration.

gmittal avatar Nov 24 '22 09:11 gmittal

Closed by https://github.com/skypilot-org/skypilot/pull/1539. SkyPilot uses the config activated by gcloud config configurations activate CONFIG_NAME @gmittal let us know if it still doesn't work, thanks!

infwinston avatar Dec 20 '22 21:12 infwinston

Reopening, as we may want to pick up the config pointed to by active_config, rather than relying on config_default.

Related discussion in #1535.

concretevitamin avatar Dec 23 '22 03:12 concretevitamin

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[bot] avatar May 26 '23 02:05 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar Jun 05 '23 02:06 github-actions[bot]

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[bot] avatar Oct 04 '23 02:10 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar Oct 15 '23 02:10 github-actions[bot]