-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Otavio Napoli
committed
May 21, 2021
1 parent
4fc33d8
commit 6217a3e
Showing
18 changed files
with
165 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from dataclasses import dataclass, field | ||
|
||
from typing import List, Any, Dict, Optional | ||
|
||
from clap.configs import InstanceInfo | ||
from clap.utils import get_logger | ||
|
||
logger = get_logger(__name__) | ||
|
||
|
||
class NodeStatus: | ||
UNKNOWN = 'unknown' | ||
STARTED = 'started' | ||
UNREACHABLE = 'unreachable' | ||
REACHABLE = 'reachable' | ||
PAUSED = 'paused' | ||
STOPPED = 'stopped' | ||
|
||
|
||
class NodeType: | ||
TYPE_CLOUD = 'cloud' | ||
TYPE_LOCAL = 'local' | ||
|
||
|
||
class NodeLifecycle: | ||
NORMAL = 'normal' | ||
PREEMPTIBLE = 'preemptible' | ||
|
||
|
||
@dataclass | ||
class NodeDescriptor: | ||
node_id: str | ||
configuration: InstanceInfo | ||
nickname: Optional[str] = '' | ||
ip: Optional[str] = '' | ||
type: Optional[str] = NodeType.TYPE_CLOUD | ||
cloud_instance_id: Optional[str] = '' | ||
cloud_lifecycle: Optional[str] = NodeLifecycle.NORMAL | ||
status: Optional[str] = NodeStatus.UNKNOWN | ||
creation_time: Optional[float] = 0.0 | ||
update_time: Optional[float] = 0.0 | ||
roles: List[str] = field(default_factory=list) | ||
tags: Dict[str, str] = field(default_factory=dict) | ||
extra: Dict[str, Any] = field(default_factory=dict) |
Oops, something went wrong.