| Hendrik Hofstadt | 0d7c91e | 2019-10-23 21:44:47 +0200 | [diff] [blame] | 1 | # Nexantic monorepo |
| Leopold Schabel | 67f9d09 | 2019-10-22 15:41:42 +0200 | [diff] [blame] | 2 | |
| Hendrik Hofstadt | 0d7c91e | 2019-10-23 21:44:47 +0200 | [diff] [blame] | 3 | This is the monorepo storing all of nexantic's internal projects and libraries. |
| Leopold Schabel | 67f9d09 | 2019-10-22 15:41:42 +0200 | [diff] [blame] | 4 | |
| Hendrik Hofstadt | 0d7c91e | 2019-10-23 21:44:47 +0200 | [diff] [blame] | 5 | ## Environment |
| Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 6 | |
| Leopold Schabel | db6283e | 2020-01-06 17:05:54 +0100 | [diff] [blame] | 7 | We assume a Fedora host system provisioned using rW, and IntelliJ as the IDE. |
| Leopold Schabel | 67f9d09 | 2019-10-22 15:41:42 +0200 | [diff] [blame] | 8 | |
| Leopold Schabel | 8b9c055 | 2019-11-15 14:07:45 +0100 | [diff] [blame] | 9 | For better reproducibility, all builds are executed in containers. |
| Leopold Schabel | 67f9d09 | 2019-10-22 15:41:42 +0200 | [diff] [blame] | 10 | |
| Hendrik Hofstadt | 0d7c91e | 2019-10-23 21:44:47 +0200 | [diff] [blame] | 11 | #### Usage |
| Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 12 | |
| Hendrik Hofstadt | 0d7c91e | 2019-10-23 21:44:47 +0200 | [diff] [blame] | 13 | Spinning up: `scripts/create_container.sh` |
| Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 14 | |
| Hendrik Hofstadt | 0d7c91e | 2019-10-23 21:44:47 +0200 | [diff] [blame] | 15 | Spinning down: `scripts/destroy_container.sh` |
| 16 | |
| Leopold Schabel | 8b9c055 | 2019-11-15 14:07:45 +0100 | [diff] [blame] | 17 | Running commands: `scripts/run_in_container.sh <...>` |
| Hendrik Hofstadt | 0d7c91e | 2019-10-23 21:44:47 +0200 | [diff] [blame] | 18 | |
| Leopold Schabel | 8b9c055 | 2019-11-15 14:07:45 +0100 | [diff] [blame] | 19 | Using bazel using a wrapper script: `scripts/bin/bazel <...>` (add to your local $PATH for convenience) |
| Leopold Schabel | ac9947f | 2020-07-09 18:58:26 +0200 | [diff] [blame] | 20 | |
| 21 | #### Run a single node cluster |
| 22 | |
| 23 | Launch the node: |
| 24 | |
| 25 | bazel run //:launch |
| 26 | |
| 27 | Run a kubectl command: |
| 28 | |
| 29 | bazel run //core/cmd/dbg -- kubectl describe |
| Hendrik Hofstadt | 0d7c91e | 2019-10-23 21:44:47 +0200 | [diff] [blame] | 30 | |
| Leopold Schabel | 8b9c055 | 2019-11-15 14:07:45 +0100 | [diff] [blame] | 31 | #### IntelliJ |
| 32 | |
| 33 | This repository is compatible with the IntelliJ Bazel plugin. All commands run inside the container, and |
| 34 | necessary paths are mapped into the container. |
| 35 | |
| Leopold Schabel | 8b9c055 | 2019-11-15 14:07:45 +0100 | [diff] [blame] | 36 | The following steps are necessary: |
| 37 | |
| Leopold Schabel | a4edfa9 | 2020-12-13 18:55:21 +0100 | [diff] [blame^] | 38 | - Install Google's [Bazel plugin](https://plugins.jetbrains.com/plugin/8609-bazel) in IntelliJ. |
| Leopold Schabel | 8b9c055 | 2019-11-15 14:07:45 +0100 | [diff] [blame] | 39 | |
| Leopold Schabel | a4edfa9 | 2020-12-13 18:55:21 +0100 | [diff] [blame^] | 40 | - Add the absolute path to your `~/.cache/bazel-nxt` folder to your `idea64.vmoptions` (Help → Edit Custom VM Options) |
| Leopold Schabel | 8b9c055 | 2019-11-15 14:07:45 +0100 | [diff] [blame] | 41 | and restart IntelliJ: |
| 42 | |
| 43 | `-Dbazel.bep.path=/home/leopold/.cache/bazel-nxt` |
| 44 | |
| Leopold Schabel | a4edfa9 | 2020-12-13 18:55:21 +0100 | [diff] [blame^] | 45 | - Set "*Bazel Binary Location*" in Other Settings → Bazel Settings to the absolute path of `scripts/bin/bazel`. |
| Leopold Schabel | 8b9c055 | 2019-11-15 14:07:45 +0100 | [diff] [blame] | 46 | This is a wrapper that will execute Bazel inside the container. |
| Leopold Schabel | 8b9c055 | 2019-11-15 14:07:45 +0100 | [diff] [blame] | 47 | |
| Leopold Schabel | a4edfa9 | 2020-12-13 18:55:21 +0100 | [diff] [blame^] | 48 | - Use _File → Import Bazel project_... to create a new project from `.bazelproject`. |
| Leopold Schabel | 8b9c055 | 2019-11-15 14:07:45 +0100 | [diff] [blame] | 49 | |
| Leopold Schabel | a4edfa9 | 2020-12-13 18:55:21 +0100 | [diff] [blame^] | 50 | After running the first sync, everything should now resolve in the IDE, including generated code. |