Skip to content

Commit

Permalink
Support cluster list at the organization level. (#1266)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandra Belousov <sashabelousovrh@Alexandras-MacBook-Pro.local>
  • Loading branch information
2 people authored and Alexandra Belousov committed Sep 23, 2024
1 parent d62241b commit a738429
Show file tree
Hide file tree
Showing 3 changed files with 208 additions and 151 deletions.
8 changes: 7 additions & 1 deletion runhouse/resources/hardware/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,7 @@ def _folder_mv(
def _folder_exists(self, path: Union[str, Path]):
return self.client.folder_exists(path=path)

###############################

# Cluster list
###############################
@classmethod
Expand Down Expand Up @@ -1984,7 +1984,13 @@ def list(
)

# get clusters from den
<<<<<<< HEAD
den_clusters_resp = get_clusters_from_den(cluster_filters=cluster_filters)
=======
den_clusters_resp = Cluster.get_clusters_from_den(
cluster_filters=cluster_filters, den_folder=rns_client.username
)
>>>>>>> 3345c808 (Support cluster list at the organization level. (#1266))
if den_clusters_resp.status_code != 200:
logger.error(f"Failed to load {rns_client.username}'s clusters from Den")
den_clusters = []
Expand Down
6 changes: 5 additions & 1 deletion runhouse/rns/rns_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ def token(self):

@property
def username(self):
return self._configs.get("username", None)
return self._configs.username or self._configs.get("username", None)

@username.setter
def username(self, value):
self._configs.username = value

@property
def api_server_url(self):
Expand Down
Loading

0 comments on commit a738429

Please sign in to comment.