Commit Graph

53 Commits

Author SHA1 Message Date
Johannes Kirschbauer
07965598f5 Classgen: add mapped keys and more stuff 2024-07-18 21:58:36 +02:00
DavHau
75b969b1ad clan-cli: improve runtime dependency management
Many dependencies of clan-cli  are currently dynamically loaded via nix-shell on each execution.
This is nice, as it reduces the initial closure size of clan, but the overhead introduced by nix-shell piles up quickly, as some commands shell out many times during their lifetime. For example, when adding a secret git is called 10+ times.

This reduces the time of a test which adds a secret from around 50 seconds to 15 seconds.

- add run_cmd() as an alternative to nix_shell()
- introduce the concept of static dependencies which do not need to go through nix-shell
- static dependencies are defined at build time and included into the wrapper for clan-cli
- add package: clan-cli-full which statically ships all required dependencies

TODO: deprecate nix_shell() in favor of run_cmd()
2024-07-11 15:34:41 +07:00
DavHau
0367fc1e90 clan-cli tests: remove dynamic inclusion of helpers module
Dynamically extending the python path at runtime is bad for developer experience, as this is not understood by the text editor and therefore jump to definition etc. does not work.

-> Better to remove the dynamic inclusion and force developers to specify the import correctly.
2024-07-05 16:38:22 +07:00
DavHau
802f047341 devShells: make all shells inherit from default shell
Currently, important tools from the default shell are lost as soon as select-shell is used to switch to another shell. select-shell itself, for example is missing, which makes it impossible to switch back to another shell.
2024-07-05 15:01:25 +07:00
Qubasa
4f6d25160f Add --ssh-pubkey FILE argument 2024-05-14 15:41:15 +02:00
Qubasa
e26d1052b6 select-shell: Fix breakage with previous shell.nix change 2024-03-25 00:32:03 +01:00
Qubasa
9dbc71e446 clan-vm-manager: devshell doesn't require clan-cli derivation 2024-03-24 23:52:30 +01:00
Qubasa
8ab9d20342 clan-vm-manager: Working pytest skeleton. clan-cli: Fixing devshell depending on itself 2024-03-24 23:36:00 +01:00
Jörg Thalheim
e296a3019d re-format with nixfmt 2024-03-17 19:48:49 +01:00
Qubasa
7dc2c21517 Deleted everything webui 2023-12-14 18:47:14 +01:00
Jörg Thalheim
b8f5c13553 clan-vm-manager: simplify shellHook 2023-11-23 15:30:44 +01:00
Jörg Thalheim
f68c10a008 clan-vm-manager: add nix package 2023-11-23 15:30:44 +01:00
Qubasa
48f0381fb5 schemathesis: Add as runnable application instead of library to resolve httpx dependency collision issue 2023-11-20 17:14:12 +01:00
Qubasa
aa39a631ac Fix incorrect machine name for shell.nix 2023-11-15 11:29:07 +01:00
DavHau
1652b5c27b 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
Qubasa
f9b1a8fa89 Removing find_git_repo 2023-10-27 19:26:03 +02:00
Qubasa
c1b4fa6d55 nix fmt 2023-10-27 19:21:50 +02:00
Qubasa
d1c35301e3 Added repro_env_break debugging command. This spawn a terminal inside the temp home folder with the same environment as the python test 2023-10-27 19:20:17 +02:00
Qubasa
d02acbe04b nix fmt 2023-10-27 19:19:45 +02:00
Qubasa
9f464dd14e Added ipdb as breakpoint console. Improved logging. 2023-10-27 19:19:45 +02:00
Qubasa
8cc1c2c4bd Fixed cyclic dependencie AND swapped pytest-parallel for pytest-xdist to fix deadlock in tests 2023-10-27 19:18:45 +02:00
DavHau
7ddd624e8e clan-cli/shell.nix: rename repo_root -> source 2023-10-23 16:15:46 +01:00
DavHau
e6d22e6426 clan-cli devShell: add editable install 2023-10-04 11:39:31 +02:00
DavHau
017221febb clan-cli: stop propagating build inputs, remove wrapper 2023-10-04 10:36:39 +02:00
Jörg Thalheim
0f1b7cf916 clan-cli: symlink cli into an otherwise empty package
This avoids propagating unneeded python libraries
2023-09-28 12:19:16 +02:00
Jörg Thalheim
49c17cc6d0 drop wonky ipdb PYTHONBREAKPOINT 2023-09-26 15:50:02 +02:00
DavHau
9825c179a8 impure-tests: migrate bash to pytest and fix stuff 2023-09-22 18:32:28 +02:00
lassulus
17520e2553 fix impure tests 2023-09-21 18:29:18 +02:00
Jörg Thalheim
584b6e2775 fix updating assets in devshell 2023-09-20 15:39:55 +02:00
DavHau
9b6fafcb2d clan config: re-enable clan config 2023-09-19 15:12:29 +02:00
Jörg Thalheim
a8ba56de63 add ipdb to python breakpoint() 2023-09-15 13:45:01 +02:00
Luis-Hebendanz
58bb1b9914 Added example machine to machines list 2023-09-07 13:42:48 +02:00
Jörg Thalheim
3bdd3af248 cli: fix nixpkgs unfree import 2023-09-06 17:37:41 +02:00
DavHau
fcbc3ec899 clan-cli: use dependency flake instead of registry 2023-09-06 14:47:28 +02:00
Jörg Thalheim
4735586dac fix uneccessary clan-cli rebuilds by not relying on self 2023-08-27 10:21:02 +02:00
Jörg Thalheim
9ae14a4f7d integrate static assets into webui command 2023-08-26 12:24:57 +02:00
Jörg Thalheim
fb7c77690a replace environment variable with nixpkgs directory
In this directory we generate all the files that we need to load nixpkgs.
This seems more robust than all those environment variables that may or not may be set.
2023-08-26 11:45:09 +02:00
Jörg Thalheim
ce3ea68da3 drop unused / from PYTHONPATH 2023-08-26 09:29:28 +02:00
Jörg Thalheim
a3b408d8c8 use .direnv for generated project files 2023-08-26 09:26:31 +02:00
DavHau
fb76ad45e8 webui: implement /api/machines/{name}/schema 2023-08-25 21:26:30 +02:00
DavHau
780fd881c3 clan-config: fix tests 2023-08-22 21:17:47 +00:00
DavHau
9438a9eb5f clan-config: move jsonschema lib to clanLib 2023-08-09 16:05:33 +02:00
Jörg Thalheim
4296ef92a9 rename clan to clan-cli
It's already confusing enough to have so many things called clan-cli
2023-08-08 14:18:10 +02:00
Jörg Thalheim
25b5f58866 drop nix-unit from flake-inputs 2023-08-03 11:29:05 +02:00
DavHau
b88ac7a2bf clan-config: init
- nixos-modules to jsonschema converter
- nix unit testing via adisbladis/nix-unit
- clan config: configuration CLI for nixos-modules
2023-08-02 20:04:16 +02:00
Jörg Thalheim
81615939ea clan-cli: also add dev dependencies to PYTHONPATH 2023-07-28 13:04:02 +02:00
Jörg Thalheim
09cc79867d cli: get optional deps from our own flake
This ensures we actually test if all those binaries build
2023-07-26 09:31:49 +02:00
Jörg Thalheim
3d14039474 using flakes for devshell without reimporting nixpkgs multiple times 2023-07-26 06:53:33 +00:00
Jörg Thalheim
a6e8e08dec add module to generate zerotier configuration 2023-07-25 19:13:24 +02:00
DavHau
f370635518 python: fix dev shell command check 2023-07-21 13:51:56 +02:00