| 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 | |
| 36 | We check the entire .ijwb project directory into the repository, which requires everyone to use the latest |
| 37 | version of both IntelliJ and the Bazel plugin, but eliminates manual setup steps. |
| 38 | |
| 39 | The following steps are necessary: |
| 40 | |
| 41 | - Install Google's official Bazel plugin in IntelliJ. |
| 42 | |
| 43 | - Add the absolute path to your ~/.cache/bazel-nxt folder to your idea64.vmoptions (Help → Edit Custom VM Options) |
| 44 | and restart IntelliJ: |
| 45 | |
| 46 | `-Dbazel.bep.path=/home/leopold/.cache/bazel-nxt` |
| 47 | |
| 48 | - Set "*Bazel Binary Location*" in Other Settings → Bazel Settings to the absolute path of scripts/bin/bazel. |
| 49 | This is a wrapper that will execute Bazel inside the container. |
| 50 | |
| 51 | - Open the `.ijwb` folder as IntelliJ project. |
| 52 | |
| 53 | - Disable Vgo support for the project. |
| 54 | |
| 55 | - Run a non-incremental sync in IntelliJ |
| 56 | |
| 57 | The plugin will automatically resolve paths for generated files. |
| 58 | |
| 59 | If you do not use IntelliJ, you need to use the scripts/bazel_copy_generated_for_ide.sh script to copy files locally. |