Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 [Bug]: Can't list deployments #2435

Closed
1 task done
AhmedHanafy725 opened this issue Mar 14, 2024 · 30 comments
Closed
1 task done

🐞 [Bug]: Can't list deployments #2435

AhmedHanafy725 opened this issue Mar 14, 2024 · 30 comments
Assignees
Labels
dashboard type_bug Something isn't working
Milestone

Comments

@AhmedHanafy725
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

which package/s did you face the problem with?

Dashboard

What happened?

can't list the fullvm deployments

Steps To Reproduce

1- Deploy a full vm.
2- Wait to be listed after deployment

Note: I don't have any failed deployments

which network/s did you face the problem on?

Dev

version

2.3.2

Twin ID/s

No response

Node ID/s

No response

Farm ID/s

No response

Contract ID/s

No response

Relevant screenshots/screen records

image

Relevant log output

-
@AhmedHanafy725 AhmedHanafy725 added type_bug Something isn't working dashboard labels Mar 14, 2024
@AhmedHanafy725 AhmedHanafy725 moved this to Accepted in 3.13.x Mar 14, 2024
@AhmedHanafy725 AhmedHanafy725 added this to the 2.3.0 milestone Mar 14, 2024
@0oM4R 0oM4R moved this from Accepted to Pending review in 3.13.x Mar 14, 2024
@AhmedHanafy725 AhmedHanafy725 moved this from Pending review to In Verification in 3.13.x Mar 14, 2024
@A-Harby
Copy link
Contributor

A-Harby commented Mar 17, 2024

Verified, Devnet a9928b8.

Was able to list new deployed VM.
image
As well as the old ones.
image

@A-Harby A-Harby moved this from In Verification to Done in 3.13.x Mar 17, 2024
@RoberL72
Copy link

not fixed. Ever since we changed to the new dash board I can see all the contracts but none of the 8 VM's deployed

@AhmedHanafy725
Copy link
Contributor Author

@RoberL72 Can you provide more info? What are the contract IDs? Which network?

@RoberL72
Copy link

RoberL72 commented Mar 21, 2024 via email

@Cameron1986labeyrie
Copy link

VMs for the following contract IDs are not loading/available in the deployments list under full vms.

Contract : 229142
Contract : 257804

img0486_1lt1fa4 (1)
img0485_ihumt2 (1)
img0491_g6oftz (1)

@0oM4R
Copy link
Contributor

0oM4R commented Apr 16, 2024

VMs for the following contract IDs are not loading/available in the deployments list under full vms.

Contract : 229142 Contract : 257804

img0486_1lt1fa4 (1) img0485_ihumt2 (1) img0491_g6oftz (1)

@Cameron1986labeyrie could you please provide the logs ?

@Mahmoud-Emad
Copy link
Contributor

@Cameron1986labeyrie

Seems to be that the issue persists, we'll actively work on resolving it. we'll investigate further and keep you updated on our progress. Please continue to monitor the issue for any updates. Thank you for your patience and understanding.

My contracts on devnet:

  • image

My listed full VMs on devnet

  • image

The mentioned failed Deployments

  • image

@Mahmoud-Emad Mahmoud-Emad moved this to Accepted in 3.14.x Apr 16, 2024
@Mahmoud-Emad Mahmoud-Emad modified the milestones: 2.3.0, 2.4.0 Apr 16, 2024
@Mahmoud-Emad
Copy link
Contributor

After conducting an investigation, it has come to my attention that we previously adhered to a specific pattern for storing machine details in the old playground. As part of the transition to the new dashboard, we introduced a change to this pattern and implemented a fix to update all instances of the old pattern to the new one. However, it appears that the fix is not functioning as expected.

Old Pattern:

Old Pattern

New Pattern:

New Pattern

@0oM4R 0oM4R moved this from Accepted to In Progress in 3.14.x Apr 17, 2024
@0oM4R
Copy link
Contributor

0oM4R commented Apr 17, 2024

Investigation:
the type in deployment data is Fullvm, this can't be listed in fullvm deployment list, and should be migrated and listed in vm deployment list, trying to confirm that the migration happened and deployments appears on vm deployments table

@0oM4R
Copy link
Contributor

0oM4R commented Apr 18, 2024

I couldn't reproduce deployment with the mentioned deployment data. For now, you should find the missing deployments on vm deployment table.

@0oM4R 0oM4R moved this from In Progress to Accepted in 3.14.x Apr 18, 2024
@0oM4R 0oM4R removed their assignment Apr 18, 2024
@Cameron1986labeyrie
Copy link

Hey @Mahmoud-Emad It's a farmers' issue that was reported over the support chat, and from what I understood, it was a full VM deployment.

@tzumby
Copy link

tzumby commented May 6, 2024

I'm running into a similar problem, trying to list the deployments with this command used to work, but now it returns an empty array:

  const result = await gridClient.machines.getObj(vms);

This is the payload used to create the VM:

  const vms = {
    name: '608e9aa00666',
    network: {
      name: '9cec1820a56f',
      ip_range: '10.238.0.0/16',
      addAccess: undefined,
      accessNodeId: undefined,
      myceliumSeeds: undefined
    },
    machines: [
      {
        name: '52839ffc800d',
        node_id: 312,
        disks: [],
        qsfs_disks: undefined,
        public_ip: true,
        public_ip6: undefined,
        planetary: true,
        mycelium: false,
        myceliumSeed: undefined,
        cpu: 2,
        memory: 2048,
        rootfs_size: 0,
        flist: 'xxx',
        entrypoint: '/sbin/zinit init',
        env: [],
        ip: undefined,
        corex: undefined,
        solutionProviderId: 2,
        zlogsOutput: undefined,
        gpus: undefined
      }
    ],
    metadata: '',
    description: 'xxx node'
  };

@Mahmoud-Emad Mahmoud-Emad self-assigned this May 7, 2024
@Mahmoud-Emad Mahmoud-Emad moved this from Blocked to In Progress in 3.14.x May 7, 2024
@Mahmoud-Emad
Copy link
Contributor

Hello @tzumby :)

I just deployed a machine from the grid-client and I was able to list it from the dashboard

this is the machine data I have used

  const vms: MachinesModel = {
    name,
    network: {
      name: "wedtest",
      ip_range: "10.249.0.0/16",
    },
    machines: [
      {
        name: "tobetested",
        node_id: 11,
        disks: [
          {
            name: "wedDisk",
            size: 8,
            mountpoint: "/testdisk",
          },
        ],
        public_ip: false,
        public_ip6: false,
        planetary: true,
        mycelium: false,
        cpu: 1,
        memory: 1024 * 2,
        rootfs_size: 0,
        flist: "https://hub.grid.tf/tf-official-apps/base:latest.flist",
        entrypoint: "/sbin/zinit init",
        env: {
          SSH_KEY: config.ssh_key,
        },
      },
    ],
    metadata: "",
    description: "test deploying VMs via ts grid3 client",
  };

I named the machine tobetested, and I would like to share that the deployment was successful!:

image

Here's a screenshot from the dashboard showing the deployed machine:
image

Please make sure that you are connecting to the dashboard by the same account wallet secret you used when you deployed the machine from the grid-client

As you can see, the machine tobetested is listed on the dashboard. To ensure a smooth experience:

  1. Connect to the dashboard using the same account wallet secret used during machine deployment.
  2. Enable the Show All Deployments switch to view all deployments.
  3. Make sure you are connected to the same network on both the dashboard and the Grid client.

@tzumby
Copy link

tzumby commented May 7, 2024

Hey @MohamedElmdary , I can already see them in the Dashboard, please read my comment, they don't show up when I try to call getObj

@Mahmoud-Emad
Copy link
Contributor

Hey @MohamedElmdary , I can already see them in the Dashboard, please read my comment, they don't show up when I try to call getObj

If that is the case, I think you need to send the name of the deployment not the vms interface

  const name = "newVMS";
  const grid3 = await getClient(`vm/${name}`);

  const vms: MachinesModel = {
    name,
    network: {
      name: "wedtest",
      ip_range: "10.249.0.0/16",
    },
    machines: [
      {
        name: "testvm",
        node_id: 11,
        disks: [
          {
            name: "wedDisk",
            size: 8,
            mountpoint: "/testdisk",
          },
        ],
        public_ip: false,
        public_ip6: false,
        planetary: true,
        mycelium: false,
        cpu: 1,
        memory: 1024 * 2,
        rootfs_size: 0,
        flist: "https://hub.grid.tf/tf-official-apps/base:latest.flist",
        entrypoint: "/sbin/zinit init",
        env: {
          SSH_KEY: config.ssh_key,
        },
      },
    ],
    metadata: "",
    description: "test deploying VMs via ts grid3 client",
  };

const deployed = await client.machines.deploy(vms);
const deploymentDetails = await client.machines.getObj(name);

@Mahmoud-Emad Mahmoud-Emad moved this from In Progress to Blocked in 3.14.x May 8, 2024
@tzumby
Copy link

tzumby commented May 8, 2024

Let me check this, I'm pretty sure i had both name and vms as parameters there with the same result.

@tzumby
Copy link

tzumby commented May 8, 2024

Yes, confirmed that const deploymentDetails = await client.machines.getObj(name); does not work either

@Mahmoud-Emad
Copy link
Contributor

@tzumby Any errors? logs?

@Mahmoud-Emad
Copy link
Contributor

@tzumby

I just used your payload and was able to deploy/list the deployment

[
  {
    version: 0,
    contractId: 109538,
    nodeId: 11,
    name: '52839ffc800d',
    created: 1715170810,
    status: 'ok',
    message: '',
    flist: 'https://hub.grid.tf/tf-official-apps/base:latest.flist',
    publicIP: null,
    planetary: '302:9e63:7d43:b742:b2a4:5133:63ba:6b5',
    myceliumIP: '',
    interfaces: [ { network: '9cec1820a56f', ip: '10.238.2.2' } ],
    capacity: { cpu: 2, memory: 2048 },
    mounts: [],
    env: {},
    entrypoint: '/sbin/zinit init',
    metadata: '',
    description: 'xxx node',
    rootfs_size: 0,
    corex: false,
    gpu: []
  }
]
'================= Getting deployment information ================='
disconnecting

However, I faced some errors and I'm not sure if you faced some of them or not

  1. The filst should be a valid URL for a real flist not xxx
  2. The other errors were about the availability of reserving a public IP and the deployment name that was taken by you, as you see I just added one more char to fix it
  3. The env should be an object {} not an array []

@tzumby
Copy link

tzumby commented May 8, 2024

Yes, I redacted those fields out for the flist and the name. There's no errors. The deploys are going successfully, it's just that the deployments returns an empty array. In the logs I can see the contract ids and everything, it seems like there's something wrong with getting them after deploying

@tzumby
Copy link

tzumby commented May 8, 2024

Did you try this and successfully returned the deployments ?

const deploymentDetails = await client.machines.getObj(name);

@Mahmoud-Emad
Copy link
Contributor

Mahmoud-Emad commented May 8, 2024

Yeah as you see in the previous comment I listed it

[
  {
    version: 0,
    contractId: 109538,
    nodeId: 11,
    name: '52839ffc800d',
    created: 1715170810,
    status: 'ok',
    message: '',
    flist: 'https://hub.grid.tf/tf-official-apps/base:latest.flist',
    publicIP: null,
    planetary: '302:9e63:7d43:b742:b2a4:5133:63ba:6b5',
    myceliumIP: '',
    interfaces: [ { network: '9cec1820a56f', ip: '10.238.2.2' } ],
    capacity: { cpu: 2, memory: 2048 },
    mounts: [],
    env: {},
    entrypoint: '/sbin/zinit init',
    metadata: '',
    description: 'xxx node',
    rootfs_size: 0,
    corex: false,
    gpu: []
  }
]
'================= Getting deployment information ================='
disconnecting

@Mahmoud-Emad Mahmoud-Emad moved this from Blocked to In Progress in 3.14.x May 14, 2024
@Mahmoud-Emad
Copy link
Contributor

Issue update

Work done

a new migration function added to the Dashboard to migrate the old Fullvm deployment types to vm

@Mahmoud-Emad
Copy link
Contributor

Issue update

Work done

  • Updated the import of 'BaseModule' in 'migration.ts' to be local dir instead of the dist one to fix the un-exported issue
  • Flat the array of the contracts then loop over them all
  • Updated the moduleName after listing the 'Fullvm' to 'vm' again to list the other deployments
  • Pushed the newly changed contract to the 'newContracts' array to avoid the lag of gql
  • Updated the 'moduleName' in 'base.ts' to take 'Fullvm' if the 'moduleNames' is undefined

@zaelgohary zaelgohary moved this from In Progress to Pending Review in 3.14.x May 16, 2024
@Mahmoud-Emad
Copy link
Contributor

issue update

Work done

  • Replaced the 'exact' search with 'contains' algo by adding 'includes' when searching on the 'projectName'.
  • Introduced a new field 'updatedAt' in the 'GqlNodeContract' type to store the updated time in it.
  • Added a condition on checking on the 'updatedAt' field to replace the newly added contract with the Gql contract.

@Mahmoud-Emad Mahmoud-Emad moved this from Pending Review to In Verification in 3.14.x May 21, 2024
@khaledyoussef24
Copy link
Contributor

can you mention where to find the latest fields of updatedAt and search to verify ?

@khaledyoussef24 khaledyoussef24 moved this from In Verification to Accepted in 3.14.x May 21, 2024
@Mahmoud-Emad
Copy link
Contributor

can you mention where to find the latest fields of updatedAt and search to verify ?

it's defined in the GqlNodeContract interface, you can deploy a machine using the gridClient/single_vm.ts script to see it.

@Mahmoud-Emad Mahmoud-Emad moved this from Accepted to In Verification in 3.14.x May 21, 2024
@khaledyoussef24
Copy link
Contributor

khaledyoussef24 commented Jun 11, 2024

verified on staging
version : 408184e
changed the name of the single vm (type,project) in the machine files from vm to Fullvm
and deployed it using the grid client.

Image

Image

on the staging worked fine after @Mahmoud-Emad changes:
Image
while in the dashboard it did not load(normal devnet):
Image

https://app.testlodge.com/a/26076/projects/40893/suites/217765?expand_section=370856#case_3783024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard type_bug Something isn't working
Projects
Status: Done
Status: Done
Development

No branches or pull requests

10 participants