Skip to content

Commit

Permalink
Add missing file.
Browse files Browse the repository at this point in the history
  • Loading branch information
DFINITYManu committed Jul 31, 2024
1 parent f5623f6 commit 84b3c47
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions rollout-dashboard/frontend/src/lib/types.ts
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[];
};

0 comments on commit 84b3c47

Please sign in to comment.