Skip to content

Commit

Permalink
feat: add debug info intellij and docs for local garm-server bootstrap (
Browse files Browse the repository at this point in the history
#57)

Just some basic dev docs improvment for IntelliJ users and bootstrapping
garm-server in local operator cluster for testing
  • Loading branch information
rafalgalaw authored Jan 9, 2024
1 parent 7ba809d commit 2eee088
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [Prerequisites](#prerequisites)
- [Getting Started](#getting-started)
- [🐛 Debugging](#-debugging)
- [⚙️ Bootstrap garm-server with garm-provider-k8s for local development](#-bootstrap-garm-server-with-garm-provider-k8s-for-local-development)
<!-- /toc -->

## Prerequisites
Expand Down Expand Up @@ -65,4 +66,33 @@ The following steps are required to start debugging the `garm-operator`:
]
}
```
1. IntelliJ
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:
```xml
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="garm-operator debug" type="GoRemoteDebugConfigurationType" factoryName="Go Remote">
<option name="disconnectOption" value="ASK" />
<method v="2" />
</configuration>
</component>
```
You can now choose your config in IntelliJs `Run Configurations` and hit `Debug`

![img_2.png](docs/assets/intellij-debugging.png)

1. Happy debugging 🐛


### ⚙️ Bootstrap garm-server with garm-provider-k8s for local development

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:

Clone the `garm-provider-k8s` repo:
```bash
$ git clone https://github.com/mercedes-benz/garm-provider-k8s && cd ./garm-provider-k8s
```
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:
```bash
$ 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/
```
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.
Binary file added docs/assets/intellij-debugging.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2eee088

Please sign in to comment.