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

add new indexer work to check node having ipv6 #937

Merged
merged 4 commits into from
Apr 22, 2024

Conversation

Omarabdul3ziz
Copy link
Contributor

Description

add new indexer work to check node having ipv6

Changes

  • add generator/loader for twin ipv6 and update the schema for the new table node_ipv6
  • add handle tests for the new filter on nodes has_ipv6
  • add new indexer work to call up nodes and check if they have ipv6
  • update the db filters with the has_ipv6 filter on nodes
  • add default values for the flags (1 worker runs every 1 day)
  • update makefile with helpful command to get db dump from the dev cluster

Related Issues

Checklist

  • Tests included
  • Build pass
  • Documentation
  • Code format and docstring

- add generator/loader for twin ipv6 and update the schema for the new table `node_ipv6`
- add handle tests for the new filter on nodes `has_ipv6`
- add new indexer work to call up nodes and check if they have ipv6
- update the db filters with the `has_ipv6` filter on nodes
- add default values for the flags (1 worker runs every 1 day)
- update makefile with helpful command to get db dump from the dev cluster
Base automatically changed from development_proxy_indexer to development March 20, 2024 08:21
@@ -3,6 +3,11 @@ PQ_HOST = $(shell docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddr
PQ_CONTAINER = postgres
count = 3

NAMESPACE := tfchain-dev
DB_POD := $(shell kubectl --namespace $(NAMESPACE) get pods | grep processor-db | awk '{print $$1}')
DUMP_CMD := PGPASSWORD="postgres" pg_dump -U postgres tfgrid-graphql > /tmp/dump.sql
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

اتقوا الله

@@ -937,3 +937,30 @@ func (c *Crafter) GeneratePricingPolicies() error {

return err
}

func (c *Crafter) GenerateNodeIpv6() error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this being used in generateData. It should be, right?

@sameh-farouk
Copy link
Member

sameh-farouk commented Apr 17, 2024

Thank you!
I just want to ask why not do this in the GraphQL processor and have real-time data?
We can save this data in a separate table when a node is created or updated.
Also, instead of creating indexes on the indexer, we can define them in the GraphQL schema. This is as simple as adding a few characters to the graphql schema file.
In my opinion, it may be more effective to maximize the utilization of the current solution rather than continuing to implement additional layers of complexity to accomplish similar tasks.
If a task can be performed by the processor, it is completed there. Otherwise, we move it to another layer.

@Omarabdul3ziz
Copy link
Contributor Author

afaik the chain doesn't have this info, does it? and we need to ask the node for it.
so we will need to add a service on the graphql that asks the node for this info, which we already have on the proxy.

@sameh-farouk
Copy link
Member

afaik the chain doesn't have this info, does it? and we need to ask the node for it. so we will need to add a service on the graphql that asks the node for this info, which we already have on the proxy.

Is it something different than the ips in the interface in tfgridmodule ?

{
  version: 5
  id: 29
  farmId: 180
  twinId: 515
  resources: {
    hru: 2,000,398,934,016
    sru: 128,035,676,160
    cru: 4
    mru: 16,693,874,688
  }
  location: {
    city: Unknown
    country: Belgium
    latitude: 50.8509
    longitude: 4.3447
  }
  publicConfig: null
  created: 1,709,817,558
  farmingPolicyId: 1
  interfaces: [
    {
      name: zos
      mac: 00:e0:4c:68:0a:82
      ips: [
        10.4.0.77
        2a02:1802:5e:14:4915:d057:abdd:322f
      ]
    }
  ]
  certification: Diy
  secureBoot: false
  virtualized: false
  serialNumber: Default string
  connectionPrice: 80
}

@Omarabdul3ziz
Copy link
Contributor Author

i thought it was different, but checking the data on chain for different node and the responses of the rmb-call zos.network.has_ipv6 looks it do report for the existence of the IP on the chain response. but i am not sure, @muhamadazmy is this true?

@Omarabdul3ziz
Copy link
Contributor Author

checked with azmy and it turns out they are different:
the call zos.network.has_ipv6 checks if the node can provide ipv6 for the vms running on it.
but the ips on the interfaces are for the node itself.

@Omarabdul3ziz Omarabdul3ziz reopened this Apr 22, 2024
@Omarabdul3ziz Omarabdul3ziz merged commit a7c36fa into development Apr 22, 2024
56 checks passed
@Omarabdul3ziz Omarabdul3ziz deleted the development_proxy_indexer_has_ipv6 branch April 22, 2024 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants