blob: 988d10d96e767b167d52ab281e7d8f3cc1dbecb4 [file] [log] [blame] [view]
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +02001# Nexantic monorepo
Leopold Schabel67f9d092019-10-22 15:41:42 +02002
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +02003This is the monorepo storing all of nexantic's internal projects and libraries.
Leopold Schabel67f9d092019-10-22 15:41:42 +02004
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +02005## Environment
Leopold Schabel5c80aca2019-10-22 15:48:58 +02006
Leopold Schabeldb6283e2020-01-06 17:05:54 +01007We assume a Fedora host system provisioned using rW, and IntelliJ as the IDE.
Leopold Schabel67f9d092019-10-22 15:41:42 +02008
Leopold Schabel8b9c0552019-11-15 14:07:45 +01009For better reproducibility, all builds are executed in containers.
Leopold Schabel67f9d092019-10-22 15:41:42 +020010
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020011#### Usage
Leopold Schabel5c80aca2019-10-22 15:48:58 +020012
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020013Spinning up: `scripts/create_container.sh`
Leopold Schabel5c80aca2019-10-22 15:48:58 +020014
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020015Spinning down: `scripts/destroy_container.sh`
16
Leopold Schabel8b9c0552019-11-15 14:07:45 +010017Running commands: `scripts/run_in_container.sh <...>`
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020018
Leopold Schabel8b9c0552019-11-15 14:07:45 +010019Using bazel using a wrapper script: `scripts/bin/bazel <...>` (add to your local $PATH for convenience)
Leopold Schabelac9947f2020-07-09 18:58:26 +020020
21#### Run a single node cluster
22
23Launch the node:
24
25 bazel run //:launch
26
27Run a kubectl command:
28
Serge Bazanski77cb6c52020-12-19 00:09:22 +010029 bazel run //metropolis/cli/dbg -- kubectl describe
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020030
Leopold Schabel8b9c0552019-11-15 14:07:45 +010031#### IntelliJ
32
33This repository is compatible with the IntelliJ Bazel plugin. All commands run inside the container, and
34necessary paths are mapped into the container.
35
Leopold Schabel8b9c0552019-11-15 14:07:45 +010036The following steps are necessary:
37
Leopold Schabela4edfa92020-12-13 18:55:21 +010038- Install Google's [Bazel plugin](https://plugins.jetbrains.com/plugin/8609-bazel) in IntelliJ.
Leopold Schabel8b9c0552019-11-15 14:07:45 +010039
Leopold Schabela4edfa92020-12-13 18:55:21 +010040- Add the absolute path to your `~/.cache/bazel-nxt` folder to your `idea64.vmoptions` (Help Edit Custom VM Options)
Leopold Schabel8b9c0552019-11-15 14:07:45 +010041 and restart IntelliJ:
42
43 `-Dbazel.bep.path=/home/leopold/.cache/bazel-nxt`
44
Leopold Schabela4edfa92020-12-13 18:55:21 +010045- Set "*Bazel Binary Location*" in Other Settings Bazel Settings to the absolute path of `scripts/bin/bazel`.
Leopold Schabel8b9c0552019-11-15 14:07:45 +010046 This is a wrapper that will execute Bazel inside the container.
Leopold Schabel8b9c0552019-11-15 14:07:45 +010047
Leopold Schabela4edfa92020-12-13 18:55:21 +010048- Use _File Import Bazel project_... to create a new project from `.bazelproject`.
Leopold Schabel8b9c0552019-11-15 14:07:45 +010049
Leopold Schabela4edfa92020-12-13 18:55:21 +010050After running the first sync, everything should now resolve in the IDE, including generated code.
Leopold Schabel18b4d652020-12-14 18:27:07 +010051
52It's strongly recommend to use our project presets for file watchers and other IDE features. Run this command and
53re-open the project in order to install them:
54
55 bazel run intellij/localconfig $(pwd)