Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add debug info intellij and docs for local garm-server bootstrap #57

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.