Skip to content

To add the NUMA topology in gophercloud#1833

Closed
sana-aawan wants to merge 4 commits intogophercloud:masterfrom
sana-aawan:add_numadetails
Closed

To add the NUMA topology in gophercloud#1833
sana-aawan wants to merge 4 commits intogophercloud:masterfrom
sana-aawan:add_numadetails

Conversation

@sana-aawan
Copy link
Copy Markdown
Contributor

@sana-aawan sana-aawan commented Jan 30, 2020

For #1825

API for introspection is already implemented, this structure will store NUMA details that we will receive from introspection.
Below is the sample introspection data for NUMA Topology that is received from ironic-inspector after baremetal introspection of a node -:

"numa_topology": {
"nics": [{
"numa_node": 0,
"name": "p2p1"
}, {
"numa_node": 0,
"name": "p2p2"
}, {
"numa_node": 0,
"name": "p1p2"
}],
"ram": [{
"numa_node": 0,
"size_kb": 99289532
}, {
"numa_node": 1,
"size_kb": 100663296
}],
"cpus": [{
"numa_node": 1,
"thread_siblings": [3, 27],
"cpu": 6
}, {
"numa_node": 0,
"thread_siblings": [20, 44],
"cpu": 10
}, {
"numa_node": 0,
"thread_siblings": [8, 32],
"cpu": 3
}, {
"numa_node": 1,
"thread_siblings": [23, 47],
"cpu": 11
}]
}

Gophercloud is introspecting the baremetal-nodes and storing the introspection data in the respective pre-defined structures. There is no structure defined for details like, NUMA topology that we receive from Ironic introspection. To fetch the NUMA details for further use, we recommend adding the NUMA topology structure in the Gophercloud.

type Data struct {
...
NumaTopology  NumaTopology                 `json:"numa_topology"`
}

// Sub Types defined under Data and deeper in the structure for NumaTopology

type NumaTopology struct {
	NumaNics	[] NumaNICS 	`json:"nics"`
	NumaRAM  	[] NumaRAM  	`json:"ram"`
	NumaCPU  	[] NumaCPU  	`json:"cpus"`
}
type NumaNICS struct {
	NumaNodeID 		int    	`json:"numa_node"`
	Name       		string       `json:"name"`
}
type NumaRAM struct {
	NumaNodeID 		int     `json:"numa_node"`
	SizeKb     		int     `json:"size_kb"`
}
type NumaCPU struct {
	NumaNodeID      int 	`json:"numa_node"`
	CPUID                  int 	`json:"cpu"`
	ThreadSiblings   [] int  	`json:"thread_siblings"`
}

@sana-aawan sana-aawan changed the title to add the NUMA topology in gophercloud To add the NUMA topology in gophercloud Jan 30, 2020
@coveralls
Copy link
Copy Markdown

coveralls commented Jan 30, 2020

Coverage Status

Coverage remained the same at 77.044% when pulling 222d025 on sana-aawan:add_numadetails into 46fdd18 on gophercloud:master.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Jan 30, 2020

Build failed.

@jtopjian
Copy link
Copy Markdown
Contributor

@sana-aawan Thank you for submitting this. Per our contributor tutorial, we'll need to see where this structure is defined in the Introspection API. See here for more details.

In addition, can you add some unit tests using real API results as fixtures?

Please let me know if you have any questions.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Feb 3, 2020

Build succeeded.

Copy link
Copy Markdown
Contributor

@jtopjian jtopjian left a comment

Choose a reason for hiding this comment

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

@sana-aawan Thank you again for working on this. Please see the comment and let me know if you have any questions or need any help.

}

func TestNumaTopology(t *testing.T) {
numatopology := `{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of having the JSON fixture embedded in the test function, it should go in the fixtures.go file.

Also, can you confirm that this fixture was pulled from a running installation/environment either from a production environment or devstack? You should be able to pull this data by using the --debug flag in most openstack tools, but I'm not familiar with the introspection service to know if it supports --debug.

… test the details for the same in gophercloud
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Feb 6, 2020

Build succeeded.

@jtopjian
Copy link
Copy Markdown
Contributor

jtopjian commented Feb 7, 2020

@sana-aawan I've opened a new PR with everything cleaned up: #1842.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Feb 7, 2020

Build succeeded.

@jtopjian
Copy link
Copy Markdown
Contributor

jtopjian commented Feb 7, 2020

Implemented in #1842

@jtopjian jtopjian closed this Feb 7, 2020
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.

3 participants