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

removed NodeInfo #1020

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

mslacken
Copy link
Member

@mslacken mslacken commented Dec 15, 2023

  • removed NodeInfo and using NodeConf instead
  • wwctl comands without NodeInfo
  • api changes for use without NodeInfo
  • fixed tests, mostly will use testenv now

@mslacken mslacken marked this pull request as draft December 15, 2023 15:14
@mslacken
Copy link
Member Author

@anderbubble Hoho,, that was my present, merge the grub changes, so that I will a present

@mslacken mslacken force-pushed the RemoveNodeInfoRebased branch 9 times, most recently from c343a6e to e736cb2 Compare December 20, 2023 21:13
@anderbubble anderbubble added this to the v4.6.0 milestone Feb 17, 2024
@mslacken mslacken force-pushed the RemoveNodeInfoRebased branch 4 times, most recently from 542b32a to f07b774 Compare March 11, 2024 07:30
@mslacken
Copy link
Member Author

close #917

@anderbubble
Copy link
Collaborator

@mslacken I'd like to start helping to get this merged. I tried to do the rebase myself, but I think you'll be more readably able to resolve the conflicts in internal/pkg/node/methods.go than I am.

Comment on lines 21 to 22
NodeProfiles map[string]*ProfileConf
Nodes map[string]*NodeConf
nodeProfiles map[string]*ProfileConf
nodes map[string]*NodeConf
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to be consolidated or otherwise updated to not have both exported and non-exported names the same. (I think we can just do everything with the exported names and remove the non-exported, though callers will need to be updated.)

if remoteNode.Kernel.Override != "" {
stage_file = kernel.KernelImage(remoteNode.Kernel.Override)
} else if remoteNode.ContainerName != "" {
stage_file = container.KernelFind(remoteNode.ContainerName)
Copy link
Member

Choose a reason for hiding this comment

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

looks like you need to rebase this branch, the function could not be found during make.

@mslacken mslacken force-pushed the RemoveNodeInfoRebased branch 2 times, most recently from 8dfa371 to fa4b3d4 Compare June 7, 2024 10:14
@griznog
Copy link
Contributor

griznog commented Aug 5, 2024

Updated my test environment, still seems to be working ok.

@griznog
Copy link
Contributor

griznog commented Aug 5, 2024

Almost ok, ran into this with the debug template:

[root@micropterus ~]# wwctl overlay show --render $cpu-vm-1 debug /warewulf/template-variables.md.ww
ERROR: could not execute template: template: template-variables.md.ww:32:36: executing "template-variables.md.ww" at <.TagsDel>: can't evaluate field TagsDel in type overlay.TemplateStruct
[root@micropterus ~]# wwctl overlay show --render cpu-vm-1 debug /warewulf/template-variables.md.ww
ERROR: could not execute template: template: template-variables.md.ww:32:36: executing "template-variables.md.ww" at <.TagsDel>: can't evaluate field TagsDel in type overlay.TemplateStruct
[root@micropterus ~]# wwctl overlay show --render cpu-vm-1 debug /warewulf/template-variables.md.ww
ERROR: could not execute template: template: template-variables.md.ww:32:36: executing "template-variables.md.ww" at <.TagsDel>: can't evaluate field TagsDel in type overlay.TemplateStruct
[root@micropterus ~]# wwctl -d overlay show --render cpu-vm-1 debug /warewulf/template-variables.md.ww
DEBUG  : Set log level to: 10, DEBUG
DEBUG  : Reading warewulf.conf from: /etc/warewulf/warewulf.conf
VERBOSE: dhpd start is not configured in warewulf.conf, using 100.72.0.1
VERBOSE: dhpd end is not configured in warewulf.conf, using 100.72.0.32
DEBUG  : Checking if path exists as a directory: /var/lib/warewulf/overlays/debug/rootfs
DEBUG  : Checking if path exists as a file: /var/lib/warewulf/overlays/debug/rootfs/warewulf/template-variables.md.ww
DEBUG  : Checking if path exists as a file: /var/lib/warewulf/overlays/debug/rootfs/warewulf/template-variables.md.ww
VERBOSE: Opening node configuration file: /etc/warewulf/nodes.conf
DEBUG  : Unmarshaling the node configuration
DEBUG  : UnmarshalYAML called
DEBUG  : Checking nodes for types
DEBUG  : returning node object
DEBUG  : cpu-vm-1: no primary defined, sanitizing to: clusternet
DEBUG  : constructed node: cpu-vm-1
VERBOSE: Opening node configuration file: /etc/warewulf/nodes.conf
DEBUG  : Unmarshaling the node configuration
DEBUG  : UnmarshalYAML called
DEBUG  : Checking nodes for types
DEBUG  : returning node object
DEBUG  : Finding nodes: [cpu-vm-1 gpu-vm-1]
DEBUG  : cpu-vm-1: no primary defined, sanitizing to: clusternet
DEBUG  : constructed node: cpu-vm-1
DEBUG  : gpu-vm-1: no primary defined, sanitizing to: clusternet
DEBUG  : constructed node: gpu-vm-1
ERROR: could not execute template: template: template-variables.md.ww:32:36: executing "template-variables.md.ww" at <.TagsDel>: can't evaluate field TagsDel in type overlay.TemplateStruct

STACK TRACE: template: template-variables.md.ww:32:36: executing "template-variables.md.ww" at <.TagsDel>: can't evaluate field TagsDel in type overlay.TemplateStruct
could not execute template
github.com/warewulf/warewulf/internal/pkg/overlay.RenderTemplateFile
	/home/griznog/rpmbuild/BUILD/warewulf-127735a9/internal/pkg/overlay/overlay.go:412
github.com/warewulf/warewulf/internal/app/wwctl/overlay/show.CobraRunE
	/home/griznog/rpmbuild/BUILD/warewulf-127735a9/internal/app/wwctl/overlay/show/main.go:70
github.com/spf13/cobra.(*Command).execute
	/home/griznog/rpmbuild/BUILD/warewulf-127735a9/vendor/github.com/spf13/cobra/command.go:983
github.com/spf13/cobra.(*Command).ExecuteC
	/home/griznog/rpmbuild/BUILD/warewulf-127735a9/vendor/github.com/spf13/cobra/command.go:1115
github.com/spf13/cobra.(*Command).Execute
	/home/griznog/rpmbuild/BUILD/warewulf-127735a9/vendor/github.com/spf13/cobra/command.go:1039
main.main
	/home/griznog/rpmbuild/BUILD/warewulf-127735a9/cmd/wwctl/main.go:13
runtime.main
	/usr/lib/golang/src/runtime/proc.go:267
runtime.goexit
	/usr/lib/golang/src/runtime/asm_amd64.s:1650

@griznog
Copy link
Contributor

griznog commented Aug 5, 2024

Also for:

ERROR: could not execute template: template: template-variables.md.ww:62:23: executing "template-variables.md.ww" at <$netdev.Default>: can't evaluate field Default in type *node.NetDevs
ERROR: could not execute template: template: template-variables.md.ww:33:33: executing "template-variables.md.ww" at <.Keys>: can't evaluate field Keys in type overlay.TemplateStruct
ERROR: could not execute template: template: template-variables.md.ww:48:43: executing "template-variables.md.ww" at <.Ipmi.TagsDel>: can't evaluate field TagsDel in type *node.IpmiConf

Are these fields eliminated so that the examples in the debug template need to be updated (something I can do) or are they just missing?

anderbubble and others added 17 commits September 23, 2024 15:25
- Closes warewulf#987

To make the overlays testable in isolation, and after discussion with
the TSC, removed host/time/source from overlay files.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Tests already exist for this at internal/pkg/batch/batch_test.go

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This is a significant change in the undelying data model!

nodeDb, err := node.New()

will result in a structure which contains the on disk
values. Only

nodeDb.FindAllNodes() or nodeDb.GetNode(id) will give
the nodes with its merged in profiles.

Signed-off-by: Christian Goll <cgoll@suse.com>
mostly remove Get and calls for the id

Signed-off-by: Christian Goll <cgoll@suse.com>
Signed-off-by: Christian Goll <cgoll@suse.com>
Signed-off-by: Christian Goll <cgoll@suse.com>
introduced wwbool and don't export
Nodes and NodeConfs. This requires new
explict Yaml (un)marshaling as the standard
marshaller won't touch these fields

Signed-off-by: Christian Goll <cgoll@suse.com>
this types like WWbool are needed so that they can
have their own command line parses which allows a UNDEF
for e.g. bool or ints.

Signed-off-by: Christian Goll <cgoll@suse.com>
Signed-off-by: Christian Goll <cgoll@suse.com>
Signed-off-by: Christian Goll <cgoll@suse.com>
changes can now not be done directly but must
go to SetNode or SetProfile. Although its also
now possible to access the field direclty with
GetNodePtr

Signed-off-by: Christian Goll <cgoll@suse.com>
Signed-off-by: Christian Goll <cgoll@suse.com>
Signed-off-by: Christian Goll <cgoll@suse.com>
net.IPMask doesn't have any advantages, as it would
marshalled to
mask:
  - 1
  - 2
  - 3
  - 4

Signed-off-by: Christian Goll <cgoll@suse.com>
tests are updated as
* Get isn't possible any more
* defaults.conf isn't there any more
* bools are now not strings any more in yaml

Signed-off-by: Christian Goll <cgoll@suse.com>
@mslacken
Copy link
Member Author

@anderbubble I have this rebased on the split overlays which had to be updated as we don't have a defaults.conf any more.
For the tests we should move perhaps this values to the default profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Merge NodeConf and NodeInfo
4 participants