-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
f5623f6
commit 84b3c47
Showing
1 changed file
with
70 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
const subnet_rollout_states = { | ||
pending: { icon: "π", name: "Pending" }, | ||
waiting: { icon: "β", name: "Waiting" }, | ||
proposing: { icon: "π", name: "Proposing update to new revision" }, | ||
waiting_for_election: { | ||
icon: "π³οΈ", | ||
name: "Waiting for revision election", | ||
}, | ||
waiting_for_adoption: { | ||
icon: "β‘", | ||
name: "Waiting for revision adoption", | ||
}, | ||
waiting_for_alerts_gone: { | ||
icon: "π’", | ||
name: "Waiting until no more alerts", | ||
}, | ||
complete: { icon: "β ", name: "Complete" }, | ||
skipped: { icon: "β©", name: "Skipped" }, | ||
error: { icon: "β", name: "Error" }, | ||
predecessor_failed: { icon: "β", name: "Predecessor failed" }, | ||
unknown: { icon: "β", name: "Does not appear in Airflow" }, | ||
}; | ||
export function batchStateIcon(state: keyof typeof subnet_rollout_states): String { | ||
return subnet_rollout_states[state].icon; | ||
} | ||
export function batchStateName(state: keyof typeof subnet_rollout_states): String { | ||
return subnet_rollout_states[state].name; | ||
} | ||
export type Subnet = { | ||
subnet_id: String; | ||
git_revision: String; | ||
state: keyof typeof subnet_rollout_states; | ||
comment: String; | ||
}; | ||
export type Batch = { | ||
subnets: Subnet[]; | ||
planned_start_time: Date; | ||
actual_start_time?: Date; | ||
end_time?: Date; | ||
}; | ||
const rollout_states = { | ||
complete: { icon: "β ", name: "Complete" }, | ||
failed: { icon: "β", name: "Failed" }, | ||
preparing: { icon: "π", name: "Preparing" }, | ||
upgrading_subnets: { icon: "βΆοΈ", name: "Upgrading subnets" }, | ||
upgrading_unassigned_nodes: { | ||
icon: "β©", | ||
name: "Upgrading unassigned nodes", | ||
}, | ||
waiting: { icon: "β", name: "Waiting" }, | ||
problem: { icon: "β οΈ", name: "Problem" }, | ||
}; | ||
export function rolloutStateIcon(state: keyof typeof rollout_states): String { | ||
return rollout_states[state].icon; | ||
} | ||
export function rolloutStateName(state: keyof typeof rollout_states): String { | ||
return rollout_states[state].name; | ||
} | ||
export type RolloutConfiguration = { | ||
simulate: boolean; | ||
}; | ||
export type Rollout = { | ||
name: String; | ||
note?: String; | ||
conf: RolloutConfiguration; | ||
state: keyof typeof rollout_states; | ||
dispatch_time: Date; | ||
last_scheduling_decision?: Date; | ||
batches: Batch[]; | ||
}; |