Commit Graph

39 Commits

Author SHA1 Message Date
Jonathon Anderson
facba28e0f Rename "preferred" kernel to "default" kernel
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-09 10:02:29 +01:00
Jonathon Anderson
8f21d54243 Refactor kernel support
- Remove kernel imports and kmods images
- Repurpose KernelOverride as container path
- Support Kernel.Version as version prefix for kernel selection
- Compare initramfs by version

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-09 10:02:22 +01:00
Jonathon Anderson
5834b82f93 Format errors in logs as strings
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-23 22:47:48 -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
Christian Goll
0dd0317740 replaced errors.Wrap with fmt.Errorf
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-11-07 22:57:29 -07:00
Christian Goll
dbdd85fe2b add platform parameter for container import
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-29 10:35:33 -06:00
Jonathon Anderson
d3cd31fdc0 Restore a commented-out test
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-10-18 00:06:22 -04:00
Christian Goll
ffef31969e api changes for use without NodeInfo
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-17 13:35:42 -04:00
Christian Goll
883de9c4fc no panic if listing non existing container image
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-09-26 18:22:36 -06:00
xu yang
94e203dd2e return non-zero exit code on container sub-commands
Signed-off-by: xu yang <xyang@ciq.com>
2024-09-25 08:50:50 +00:00
xu yang
1f492dfed5 Add flag --build to wwctl container copy, default false
Signed-off-by: xu yang <xyang@ciq.com>
2024-09-20 17:31:17 -06:00
Christian Goll
13349bbf66 adding WAREWULF_OCI vars to wwctl
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-09-04 20:52:43 +02:00
Christian Goll
553e401fe0 enhanced container list
Container list has now options for full, kernel and size listing. Without any
arguments only available containers are listed. Size is no more fine granular
showing also size of the image, chroot and compressed image

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-08-02 16:34:54 -06:00
Jonathon Anderson
6b8ca378d8 Refactor syncuser to reduce walking the container fs
- Closes #1209

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-06-03 19:18:25 -06:00
Christian Goll
2ba9efa57c created kernel.FindKernel reduces code complexity
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-04-19 16:12:22 -06: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
Jonathon Anderson
45542827dd Remove built images when renaming a container
Renaming a container causes its images to be abandoned in the previous
name. This causes those images to be removed after a successful rename.

New images can be rebuilt during the rename using the `--build`
argument.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-01-24 15:11:21 -07:00
jason yang
d262ec10ef Add container rename support
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2024-01-24 15:11:16 -07:00
jason yang
5785d15497 enable the build flag
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-12-12 17:29:50 -07:00
jason yang
231987ecfc fix a bug when replacing existing containers
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-12-12 17:06:28 -07:00
Christian Goll
951dd13866 no error if images for containers don't exist
Signed-off-by: Christian Goll <cgoll@suse.com>
2023-10-14 02:26:03 -06:00
Arnaud Lecomte
f2392f6e37 Updating documentation & API endpoint for container copy 2023-08-28 08:39:15 +02:00
Jonathon Anderson
7b2f278f94 Refactor and fix bugs in syncuids
Closes #840

* SyncUids can now return applicable errors even during showOnly, so
  updated ContainerImport to ignore errors during showOnly.
* Fixed handling of file gids during SyncUids

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2023-08-08 11:25:09 -06:00
jason yang
84bfccba43 add support for resolving absolute path automatically
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-03-22 04:18:50 +00:00
Christian Goll
063c05602d Merge pull request #665 from mslacken/ContainerMnt
Container mnt
2023-02-24 15:13:12 +01:00
Christian Goll
b5725513b3 container show will only show valid containers 2023-02-01 09:30:27 +01:00
Christian Goll
f5b35f7ef8 do not copy resolv.conf, but mount it 2023-01-31 16:04:08 +01:00
Christian Goll
241425f525 react on the error accordingly 2022-12-07 15:10:18 +01:00
Christian Goll
4fe584547b Merge branch 'development' into wwlog-newlines 2022-10-13 14:46:03 +02:00
Christian Goll
fab7e09aeb Merge branch 'development' into container-info2 2022-10-13 10:53:49 +02:00
Christian Goll
396f3238c1 added size of containers 2022-10-13 10:35:17 +02:00
Christian Goll
71bf385cb7 add modifictation and creation date 2022-10-13 10:33:54 +02:00
Jonathon Anderson
4661b02a3d Move "not found" presentation to CLI 2022-09-16 21:56:39 +00:00
Jonathon Anderson
14b45e37c0 Fix output of wwctl container show
Commit d8cd6049 introduced erroneous output coming from an
inner function of container show, and (seemingly) erroneously
replaces valid kernel versions with "not found". This commit
fixes both of those issues, and moves the output to the outer
cli function.
2022-09-16 21:33:49 +00: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
Christian Goll
c75f4e468c remove also the container image on delete 2022-09-14 14:42:33 +02: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
20fa9d2e2a fix regression on container import 2022-08-11 16:38:43 +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