Skip to content

Commit

Permalink
Create VM interface, Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
zaelgohary committed Jun 25, 2024
1 parent 2492f60 commit c776d6a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
32 changes: 32 additions & 0 deletions packages/playground/src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,35 @@ export interface IPublicConfig {
gw6?: string;
domain?: string;
}

export interface VM {
version: number;
contractId: number;
nodeId: number;
name: string;
created: number;
status: string;
message: string;
flist: string;
publicIP: string;
planetary: string;
myceliumIP: string;
interfaces: {
network: string;
ip: string;
}[];
capacity: {
cpu: number;
memory: number;
};
mounts: any[];
env: {
SSH_KEY: string;
};
entrypoint: string;
metadata?: any;
description?: any;
rootfs_size: number;
corex: boolean;
gpu: any[];
}
7 changes: 3 additions & 4 deletions packages/playground/src/weblets/tf_node_pilot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ async function deploy() {
? selectionDetails.value.domain.customDomain
: subdomain + "." + selectionDetails.value?.domain?.selectedDomain?.publicConfig.domain;
let vm: any;
let vm: VM;
try {
layout.value?.validateSSH();
Expand Down Expand Up @@ -178,8 +178,6 @@ async function deploy() {
try {
layout.value.setStatus("deploy", "Preparing to deploy gateway...");
console.log("vm[0]", vm[0]);
await deployGatewayName(grid, selectionDetails.value.domain, {
subdomain,
ip: vm[0].interfaces[0].ip,
Expand All @@ -192,7 +190,7 @@ async function deploy() {
layout.value.setStatus("deploy", "Rollbacking back due to fail to deploy gateway...");
await rollbackDeployment(grid!, name.value);
layout.value.setStatus("failed", normalizeError(e, "Failed to deploy a Casperlabs instance."));
layout.value.setStatus("failed", normalizeError(e, "Failed to deploy a Node Pilot instance."));
}
}
Expand All @@ -212,6 +210,7 @@ import type { SelectionDetails } from "../types/nodeSelector";
import { deployGatewayName, getSubdomain, rollbackDeployment } from "../utils/gateway";
import { updateGrid } from "../utils/grid";
import { normalizeError } from "../utils/helpers";
import { VM } from "../utils/types";
export default {
name: "NodePilot",
Expand Down

0 comments on commit c776d6a

Please sign in to comment.