-
Notifications
You must be signed in to change notification settings - Fork 76
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
Showing
2 changed files
with
37 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
STATUS_TO_DISPLAYABLE = { | ||
"BUILDING_MODEL": "BUILDING", | ||
"DEPLOYING_MODEL": "DEPLOYING", | ||
"MODEL_DEPLOY_FAILED": "DEPLOY_FAILED", | ||
"MODEL_LOADING": "LOADING_MODEL", | ||
"MODEL_READY": "ACTIVE", | ||
"MODEL_UNHEALTHY": "UNHEALTHY", | ||
"BUILDING_MODEL_FAILED": "BUILD_FAILED", | ||
"BUILDING_MODEL_STOPPED": "BUILD_STOPPED", | ||
"DEACTIVATING_MODEL": "DEACTIVATING", | ||
"DEACTIVATED_MODEL": "INACTIVE", | ||
"MODEL_DNE_ERROR": "FAILED", | ||
"UPDATING": "UPDATING", | ||
"MIGRATING_WORKLOAD_PLANES": "UPDATING", | ||
"SCALED_TO_ZERO": "SCALED_TO_ZERO", | ||
"SCALING_FROM_ZERO": "WAKING_UP", | ||
} | ||
|
||
|
||
def get_displayable_status(status: str) -> str: | ||
""" | ||
TODO: Remove this method once Chains is supported in the REST API | ||
This is used by the `truss chains deploy` command right now to | ||
print the right status. Once Chains are supported by the REST API, the | ||
Baseten REST API will return status strings matching the ones here, so we don't | ||
need to do any mapping. | ||
""" | ||
return STATUS_TO_DISPLAYABLE[status] |