2022-05-18 13:08:31 -04:00
# debug daemon (debugd)
2022-09-06 08:49:13 -04:00
Debugd is a tool we built to allow for shorter iteration cycles during development.
2022-10-21 04:16:44 -04:00
The debugd gets embedded into OS images at the place where the bootstrapper normally sits.
2022-09-06 08:49:13 -04:00
Therefore, when a debug image is started, the debugd starts executing instead of the bootstrapper.
The debugd will then wait for a request from the `cdbg` tool to upload a bootstrapper binary.
Once the upload is finished debugd will start the bootstrapper.
2023-10-27 02:30:59 -04:00
Subsequently you can initialize your cluster with `constellation apply` as usual.
2022-09-06 08:49:13 -04:00
2022-05-23 06:13:23 -04:00
## Build cdbg
2022-05-18 13:08:31 -04:00
2023-11-17 13:16:52 -05:00
The `cdbg` tool is part of the `//:devbuild` target, if you follow the generic build instructions at [build-develop-deploy ](../dev-docs/workflows/build-develop-deploy.md ).
2022-06-10 09:05:09 -04:00
2023-11-17 13:16:52 -05:00
If you need to build `cdbg` standalone for your current platform, you can run
2022-06-10 09:05:09 -04:00
2023-11-17 13:16:52 -05:00
```sh
bazel build //debugd/cmd/cdbg:cdbg_host
```
2022-05-18 13:08:31 -04:00
2023-11-17 13:16:52 -05:00
## debugd & cdbg usage
2022-08-31 06:25:27 -04:00
2023-11-17 13:16:52 -05:00
Follow the [debug-cluster workflow ](../dev-docs/workflows/debug-cluster.md ) to deploy a bootstrapper with `cdbg` and `debugd` .
2022-05-18 13:08:31 -04:00
2022-11-30 04:43:09 -05:00
### Logcollection to Opensearch
You can enable the logcollection of debugd to send logs to Opensearch.
On Azure, ensure your user assigned identity has the `Key Vault Secrets User` role assigned on the key vault `opensearch-creds` .
2022-12-13 05:03:41 -05:00
On AWS, attach the `SecretManagerE2E` policy to your control-plane and worker node role.
2022-11-30 04:43:09 -05:00
When deploying with cdbg, enable by setting the `logcollect=true` and your name `logcollect.admin=yourname` .
```shell-session
./cdbg deploy --info logcollect=true,logcollect.admin=yourname
# OR
./cdbg deploy --info logcollect=true --info logcollect.admin=yourname
```
Other available fields can be found in [the filed list ](/debugd/internal/debugd/logcollector/fields.go )
For QEMU, the credentials for Opensearch must be parsed via the info flag as well:
```shell-session
./cdbg deploy \
--info logcollect=true \
--info logcollect.admin=yourname \
--info qemu.opensearch-pw='xxxxxxx'
```
Remember to use single quotes for the password.
2022-08-31 06:25:27 -04:00
2022-12-01 01:59:28 -05:00
You will also need to increase the memory size of QEMU to 4GB.