| Leopold Schabel | 55f01c3 | 2021-03-30 22:12:24 +0200 | [diff] [blame] | 1 | # Monogon Monorepo |
| Leopold Schabel | 67f9d09 | 2019-10-22 15:41:42 +0200 | [diff] [blame] | 2 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 3 | This is the main repository containing the source code for the [Monogon Platform](https://monogon.tech). |
| Leopold Schabel | 55f01c3 | 2021-03-30 22:12:24 +0200 | [diff] [blame] | 4 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 5 | *This is pre-release software - take a look, and check back later!* |
| Leopold Schabel | 67f9d09 | 2019-10-22 15:41:42 +0200 | [diff] [blame] | 6 | |
| Hendrik Hofstadt | 0d7c91e | 2019-10-23 21:44:47 +0200 | [diff] [blame] | 7 | ## Environment |
| Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 8 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 9 | Our build environment is self-contained and requires only minimal host dependencies: |
| Leopold Schabel | 67f9d09 | 2019-10-22 15:41:42 +0200 | [diff] [blame] | 10 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 11 | - A Linux machine or VM. |
| 12 | - [Bazelisk](https://github.com/bazelbuild/bazelisk) >= v1.15.0 |
| 13 | - A reasonably recent kernel with user namespaces enabled. |
| 14 | - Working KVM with access to `/dev/kvm` (if you want to run tests). |
| Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 15 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 16 | Our docs assume that Bazelisk is available as `bazel` on your PATH. |
| Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 17 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 18 | ### IntelliJ support |
| Hendrik Hofstadt | 0d7c91e | 2019-10-23 21:44:47 +0200 | [diff] [blame] | 19 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 20 | This repository is compatible with the IntelliJ Bazel plugin out of the box, which enables |
| 21 | full autocompletion for external dependencies and generated code. |
| Leopold Schabel | 8b9c055 | 2019-11-15 14:07:45 +0100 | [diff] [blame] | 22 | |
| Leopold Schabel | 8b9c055 | 2019-11-15 14:07:45 +0100 | [diff] [blame] | 23 | The following steps are necessary: |
| 24 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 25 | - Install Google's [Bazel plugin](https://plugins.jetbrains.com/plugin/8609-bazel) in IntelliJ. |
| 26 | |
| 27 | - Make sure that Bazel "*Bazel Binary Location*" in Other Settings → Bazel Settings points to Bazelisk. |
| Leopold Schabel | 8b9c055 | 2019-11-15 14:07:45 +0100 | [diff] [blame] | 28 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 29 | - Use _File → Import Bazel project_... and select your monorepo checkout. |
| Leopold Schabel | 8b9c055 | 2019-11-15 14:07:45 +0100 | [diff] [blame] | 30 | |
| Leopold Schabel | a4edfa9 | 2020-12-13 18:55:21 +0100 | [diff] [blame] | 31 | After running the first sync, everything should now resolve in the IDE, including generated code. |
| Leopold Schabel | 18b4d65 | 2020-12-14 18:27:07 +0100 | [diff] [blame] | 32 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 33 | ## Monogon OS |
| Serge Bazanski | 31370b0 | 2021-01-07 16:31:14 +0100 | [diff] [blame] | 34 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 35 | ### Run a single node demo cluster |
| Serge Bazanski | 31370b0 | 2021-01-07 16:31:14 +0100 | [diff] [blame] | 36 | |
| 37 | Launch the node: |
| 38 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 39 | bazel run //:launch -c dbg |
| Serge Bazanski | 31370b0 | 2021-01-07 16:31:14 +0100 | [diff] [blame] | 40 | |
| 41 | Run a kubectl command: |
| 42 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 43 | bazel run //metropolis/cli/dbg -c dbg -- kubectl describe node |
| Serge Bazanski | 31370b0 | 2021-01-07 16:31:14 +0100 | [diff] [blame] | 44 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 45 | ### Test suite |
| Leopold Schabel | 55f01c3 | 2021-03-30 22:12:24 +0200 | [diff] [blame] | 46 | |
| Leopold | 7fbf104 | 2023-01-06 19:57:37 +0100 | [diff] [blame^] | 47 | Run full test suite: |
| 48 | |
| 49 | bazel test -c dbg //... |