Commit Graph

23 Commits

Author SHA1 Message Date
lassulus
082d628497 clan_cli: flake_name -> flake_dir 2023-11-15 16:23:28 +01:00
DavHau
9f716741ef api/machines: add test ensuring empty config is valid 2023-11-13 21:56:02 +07:00
DavHau
d755048dc2 api/machines: allow config verification on imaginary machines
Machines do not need to exist in order to verify their configuration.

This allows verifying a config before creating an actual machine with it.
2023-11-13 21:24:05 +07:00
DavHau
33944cf74e api/machines: verify config by evaluating the .vm output
This fixes the problem where fileSystems were missing, or boot.loader was not set.

SInce we want VMs anyways for now, this strategy aligns well
2023-11-13 20:50:11 +07:00
DavHau
2fafc9a38b api/machines: init put_machine replacing create_machine and set_machine_config
This allows creating and configuring a machine in one single step.
2023-11-13 20:25:52 +07:00
DavHau
1e2e37880c api/machines: ensure name is valid hostname 2023-11-12 07:57:48 +07:00
DavHau
170d29a15a api/schema: return list of missing modules 2023-11-10 15:07:15 +07:00
DavHau
da32031eda api/schema: don't crash on eval error 2023-11-10 14:27:03 +07:00
DavHau
fc1591a0a8 api/schema: get schema without having a machine
Also done:
- add @pytest.mark.with_core indicating that a test depends on clan-core and cannot be cached
- separate unit tests into two derivations, ones that can be cached and ones that cannot.
- fix frontend typescript code
2023-11-09 15:30:25 +07:00
DavHau
6e281dd7c3 api/machines: better input/output validation
Also move contents tof 'config' to the top-level
2023-11-06 17:56:27 +07:00
Qubasa
e389c7cfe7 Updated to main branch. Removed cluttering asyncio and httpx log messages 2023-10-27 23:36:45 +02:00
Qubasa
916fa8e570 All tests passing babyyy !! 2023-10-27 19:26:03 +02:00
Qubasa
0be3dac289 nix fmt 2023-10-27 19:21:50 +02:00
Qubasa
8ff80b025c Fixing a multitude of tests 2023-10-27 19:21:50 +02:00
DavHau
e6b13fd970 api/machines: split off config validation into separate endpoint
- This speeds up PUT /machines{name}/config as it doesn't do the expensive check anymore
- instead use PUT /machines/{name}/verify which allows a dry-run evaluation of a config which is passed without writing it to disk
2023-10-25 17:48:37 +01:00
DavHau
cf0953146d api/machines: allow importing extra modules
- add top-level option `clanImports` to clanCore
- clanImports can be set and checked as any other option
- buildClan resolves the clanImports from the settings.json before calling evalModules to prevent infinite recursions
- new endpoint PUT machines/{name}/schema to allow getting the schema for a specific list of imports
- to retrieve the currently imported modules, cimply do a GET or PU on machines/{name}/config which will return `clanImports` as part of the config

Still missing: get list of available modules
2023-10-25 16:36:30 +01:00
DavHau
607c52149f PUT /machines/{name}/config; ensure is idempotent 2023-10-24 18:48:14 +01:00
DavHau
177be69eda PUT api/machines/{name}/config: ensure only valid config is ever written
- add CLAN_MACHINE_SETTINGS_FILE variable to temporarily override the machine settings file
- do a dry-run evaluation first with the new config before persisting it.
2023-10-24 18:40:48 +01:00
DavHau
f1e7495806 machines: add endpoint machines/{name}/ verify 2023-10-24 16:31:37 +01:00
Jörg Thalheim
87f0b090ef cli: rename clan_flake to test_flake 2023-09-15 12:36:16 +02:00
Jörg Thalheim
02f421546c rename machine_flake back to clan_flake 2023-09-14 17:06:07 +02:00
Jörg Thalheim
2048ffccb0 drop clan_flake fixture 2023-09-14 16:57:48 +02:00
Jörg Thalheim
451ecbb691 rename test_api_machines test to be consistent with the rest 2023-09-14 13:02:58 +02:00