Commit Graph

73 Commits

Author SHA1 Message Date
Jonathon Anderson
7e742b0d8a Fix DelProfile to operate on profiles, not nodes.
- Fixes: #1622

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-27 05:58:46 -07:00
Jonathon Anderson
a80ba8ee01 Configure nodes.conf path dynamically from config
Removes the use of init() to initialize the variable.

- Closes: #1596
- See also: #1569

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-17 11:04:43 -07:00
Jonathon Anderson
981d11a012 Initial wwctl upgrade command
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:09:38 -07:00
Jonathon Anderson
fdbdf88df0 Rename NodeConf to NodesConf
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:09:02 -07:00
Jonathon Anderson
a2c778b7ee Remove ExportedYml
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:08:59 -07:00
Jonathon Anderson
0665d5dc88 Refactor node
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:08:47 -07:00
Christian Goll
9fdb9ca792 updated overlays
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-17 15:30:54 -04:00
Christian Goll
342236b9b9 updated test for yaml/v3
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-17 15:30:54 -04:00
Christian Goll
5bd4fd4712 use yaml/v3 and don't export Nodes
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>
2024-10-17 15:30:54 -04:00
Christian Goll
28a7b9fe84 removed NodeInfo and using NodeConf instead
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>
2024-10-17 13:35:42 -04:00
Jonathon Anderson
a1832ad8c1 Complete transfer of Warewulf from HPCng
Warewulf is now being maintained in its own GitHub organization at
github.com/warewulf

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-01-26 21:35:04 -07:00
Christian Goll
c55c5a2ac4 Add recursive setter functions
when transforming a NodeInfo struct to a NodeConf (set the NodeConf from
the NodeInfo) nested structures were seperately handled. This means a
there were seperate handles for e.g *Netdevs and *IpmiConfig. The new
getter traverses through the datastucture and sets the right value for a
Entry struct, but calls itself again if a Pointer is detected.

This adds the posiblity to add new nested structures to NodeConf and
NodeInfo without the need of seperately handling them in the transformer
functions.

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-08-21 16:19:13 -06:00
Jonathon Anderson
e693ca9cd4 Merge remote-tracking branch 'jason/issue/658' into development
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-16 18:43:59 -06:00
Jonathon Anderson
cc714008ef Add doc comments for two methods
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-16 07:24:14 -06:00
Jonathon Anderson
2319906d97 Fix writing of nodes.conf
The caching functionality of nodes.conf, and the optional persistence
functionality that came with it, appears to have been preventing
actually writing the configuration to disk in all cases. This change
fixes the ability to write to nodes.conf.

Somewhat opinionatedly, this change removes the caching functionality of
nodes.conf. The tests have also been updated to use real files for i/o
rather than tying into the caching system, making them more accurately
test the ability of Warewulf to actually read and write its
configuration.

Fixes #779

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-14 10:53:31 -06:00
jason yang
0faada6aae refactor the profile add
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-04-12 10:27:44 +00:00
Christian Goll
3367b67b9f added a test for wwctl node add
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-07 09:05:29 +01:00
Jonathon Anderson
0b3e862bea Remove trailing newline from wwlog
I noticed that some wwlog calls included a trailing newline, but others
did not. I tested both in isolation and discovered that the behavior was
consistent regardless of whether a trailing newline was included. I
further confirmed in code that wwlog appends a trailing newline
automatically if it is not present; so a trailing newline is unnecessary
in individual calls.

This commit removes trailing newlines from all calls to make them
consistent. It also replaces two calls to wwlog.Printf. (see #534)

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2022-09-15 12:38:03 -06:00
Jonathon Anderson
22910958b5 Replace all instances of wwlog.Printf
wwlog provides named loggers for each level, which requires
less code and is clearer than wwlog.Printf. The code has
included a mix of both, but this commit consolidates existing
code on the per-level functions.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2022-09-11 08:00:23 -06:00
Christian Goll
2016588f36 fallten the Nodes and NodeProfile before write 2022-08-16 17:15:39 +02:00
Christian Goll
8c2d40881d use reflect on overlays 2022-08-10 17:09:10 +02:00
Christian Goll
41d12888ab reflections for unmarshal 2022-08-10 14:16:48 +02:00
Christian Goll
b548d8583d reflection on constructor 2022-08-03 11:28:15 +02:00
Christian Goll
29573e26ad added more values 2022-07-07 11:39:02 +02:00
MatthewHink
d8cd6049ac Initial cut of wwapi.
We need an API for Warewulf in order to automate around it. The initial version of the API will look a lot like wwctl. wwctl will call the API so that we do not need to maintain separate code paths. In this preview wwctl calls the API via direct function call, but we can change that to a gprc or REST call to a Warewulf server in the future.

This commit contains:
wwapid WareWulf API Daemon. A grpc server with mTLS auth.
wwapic WareWulf API Client. A grpc client with mTLS auth. It's just a sample that reads the version from the server.
wwapird WareWulf API Rest Daemon. A http REST reverse proxy to wwapid.
There are also sample insecure and secure curls to test with.

Implemented Functionality:
wwctl node add
wwctl node delete
wwctl node list
wwctl node set
wwctl node status
wwctl container build
wwctl container delete
wwctl container import
wwctl container list
wwctl container show

Some notes on the files:

    Logic that was in wwctl has moved to warewulf/internal/pkg/api. wwctl just calls the API. wwctl functionality is unchanged.
    Everything under the /google directory is copied google proto code to stand up wwapird. It's a bit strange to copy in the code, but that is currently how it's done.
    Everything in warewulf/internal/pkg/api/routes/wwapiv1 is generated code.

There are some loose ends here, such as no service installers. I just ran off the command line for development.
The Makefile could use improvement. I'm building by make clean setup proto all build wwapid wwapic wwapird ; echo $?
I copied the configs from warewulf/etc to /usr/local/etc/warewulf manually.
2022-06-24 08:39:30 -07:00
jcsiadal
9b6b93a5cb Rename default to primary in src
Signed-off-by: jcsiadal <jeremy.c.siadal@intel.com>
2022-05-05 03:13:21 +00:00
Christian Goll
e29aea8ae3 using stirng for ipmiwrite storage 2022-04-14 12:50:38 +02:00
Christian Goll
e3b2ca39d8 simplified range expression 2022-04-11 14:51:35 +02:00
Christian Goll
4782d7e726 fixup profile handling 2022-04-11 14:41:43 +02:00
MatthewHink
086401a07c unit test + nil check pointers 2022-04-09 09:19:03 -04:00
Christian Goll
3bbddf4a8c create config entries for profiles 2022-04-08 17:34:52 +02:00
Christian Goll
49bb9a40f0 reserve memory ofr kernel and ipmi entry 2022-04-08 14:47:19 +02:00
Christian Goll
95050a44ce add user defined keys for networks/netdev
Every network in the profile and for the nodes can have induvidual keys values
pairs, called Tags, which are propergated to the templates. So they can be used
for things like MTU size like
  `wwct node set node01 --nettag mtu=9000`
and in in ifcfg.xml.ww
```
{{ if $netdev.Tags.mtu -}}
<mtu> {{ $netdev.Tags.mtu }} </mtu>
{{ end -}}
```
2022-04-06 21:36:17 +02:00
jcsiadal
bd3edb9e7f Udated constructors/mods
Signed-off-by: jcsiadal <jeremy.c.siadal@intel.com>
2022-04-04 16:13:09 +00:00
Christian Goll
c0f7ecf357 store the ovelats as yaml list 2022-03-24 19:45:51 +01:00
Christian Goll
5ac75661c9 Only write to IPMI if this is explictly wanted 2022-03-02 21:24:05 +01:00
Gregory Kurtzer
1203186194 Support kernel overrides from the host or other containers 2022-02-17 07:37:04 +00:00
Gregory Kurtzer
104bc7527d Restored deleted kernel components for overrides 2022-02-17 06:21:40 +00:00
Gregory Kurtzer
5a0c13225e Utilize containerized kernel and remove kernel Support 2022-02-15 06:49:24 +00:00
Gregory Kurtzer
49150c172e Reverse compatibility for keys to tags 2022-02-11 15:36:38 +00:00
Gregory Kurtzer
ffaf794a42 Changed "key" paramaters to tags and cleaned up interface 2022-02-11 05:52:46 +00:00
Gregory Kurtzer
b165928699 Change how boolean node members behave (transform two and from strings) 2022-02-10 16:36:14 +00:00
Gregory Kurtzer
d9c13c3f36 Initial commit of asset key tag security check 2022-01-24 00:32:02 +00:00
Gregory Kurtzer
9f53bca1bf Various fixes found in testing 2021-12-29 17:16:53 -08:00
Gregory Kurtzer
1370932cd3 Introduction of netname functionality for network devices 2021-10-23 07:12:57 -07:00
Gregory Kurtzer
c60be743ba Update sources to use upstream errors package 2021-09-06 14:50:27 -07:00
Michael L. Young
13ad67e56e Add IPMI Port Configuration
This commit adds the ability to configure the default IPMI port for a
profile or per node. If the port is not set, we default to 623.

Updated some areas to default to 'lan' for IPMI interface if it has not
been set.
2021-08-24 19:11:39 -04:00
Gregory Kurtzer
a82e1b0ea5 Fixed formatting across entire project 2021-08-21 08:04:47 -07:00
Christian Goll
c6b2fc5795 added configureable ipmiinterface used by ipmitool
ipmitool is now searched from $PATH, so that self
compiled ipmitool can be used
2021-08-06 09:22:31 +02:00
Niko Kivel
17f26e8bf1 Params-->Keys 2021-05-11 08:45:09 +02:00