Skip to content

Commit 2eee088

Browse files
authored
feat: add debug info intellij and docs for local garm-server bootstrap (#57)
Just some basic dev docs improvment for IntelliJ users and bootstrapping garm-server in local operator cluster for testing
1 parent 7ba809d commit 2eee088

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

DEVELOPMENT.md

+30
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- [Prerequisites](#prerequisites)
77
- [Getting Started](#getting-started)
88
- [🐛 Debugging](#-debugging)
9+
- [⚙️ Bootstrap garm-server with garm-provider-k8s for local development](#-bootstrap-garm-server-with-garm-provider-k8s-for-local-development)
910
<!-- /toc -->
1011

1112
## Prerequisites
@@ -65,4 +66,33 @@ The following steps are required to start debugging the `garm-operator`:
6566
]
6667
}
6768
```
69+
1. IntelliJ
70+
1. Create a `.run` folder in the root of your project if not present. Create a`garm-operator debug.run.xml` file with the following content:
71+
```xml
72+
<component name="ProjectRunConfigurationManager">
73+
<configuration default="false" name="garm-operator debug" type="GoRemoteDebugConfigurationType" factoryName="Go Remote">
74+
<option name="disconnectOption" value="ASK" />
75+
<method v="2" />
76+
</configuration>
77+
</component>
78+
```
79+
You can now choose your config in IntelliJs `Run Configurations` and hit `Debug`
80+
81+
![img_2.png](docs/assets/intellij-debugging.png)
82+
6883
1. Happy debugging 🐛
84+
85+
86+
### ⚙️ Bootstrap garm-server with garm-provider-k8s for local development
87+
88+
If you need a `garm-server` with a configured [garm-provider-k8s](https://github.com/mercedes-benz/garm-provider-k8s) in your local cluster to spin up some `k8s based runners` for testing, you can do the following:
89+
90+
Clone the `garm-provider-k8s` repo:
91+
```bash
92+
$ git clone https://github.com/mercedes-benz/garm-provider-k8s && cd ./garm-provider-k8s
93+
```
94+
And follow this [guide](https://github.com/mercedes-benz/garm-provider-k8s/blob/main/DEVELOPMENT.md). But `instead` of the `make tilt-up` in the `garm-provider-k8s` repo, execute the folling command. Make sure you are in your `kind-garm-operator` kubernetes context:
95+
```bash
96+
$ RUNNER_IMAGE="localhost:5000/runner:linux-ubuntu-22.04-x86_64" make build copy docker-build docker-build-summerwind-runner && kubectl apply -k hack/local-development/kubernetes/
97+
```
98+
Essentially this does the same as the `make tilt-up` target in `garm-provider-k8s`, but in your local garm-operator cluster. Otherwise, a separate cluster will be spawned with the latest garm-operator release.

docs/assets/intellij-debugging.png

3.05 KB
Loading

0 commit comments

Comments
 (0)