{"id":18640551,"url":"https://github.com/rexagod/alfred","last_synced_at":"2025-04-11T10:33:10.671Z","repository":{"id":50662230,"uuid":"517916906","full_name":"rexagod/alfred","owner":"rexagod","description":"A debugging utility for containers with golang-based entrypoints.","archived":false,"fork":false,"pushed_at":"2022-08-08T07:41:17.000Z","size":58958,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-15T22:58:45.070Z","etag":null,"topics":["cloud","debugger","golang"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rexagod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-26T04:50:44.000Z","updated_at":"2024-04-15T22:58:45.071Z","dependencies_parsed_at":"2022-08-12T22:00:47.664Z","dependency_job_id":null,"html_url":"https://github.com/rexagod/alfred","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rexagod%2Falfred","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rexagod%2Falfred/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rexagod%2Falfred/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rexagod%2Falfred/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rexagod","download_url":"https://codeload.github.com/rexagod/alfred/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223466443,"owners_count":17149770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","debugger","golang"],"created_at":"2024-11-07T05:54:52.941Z","updated_at":"2024-11-07T05:54:53.592Z","avatar_url":"https://github.com/rexagod.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Alfred\n\nAlfred is a debugging utility created on top of the de-facto golang debugger, Delve. It allows the user to, seamlessly:\n * **inject** Delve into the target container that's running the target binary (that needs to be debugged),\n * **attach** in-cluster Delve to the target process,\n * **relay** debugging information to the user's local Delve instance (IDE or terminal),\n * **debug** the target process,\n * **rebuild** on any changes to the Dockerfile's parent directory, and\n * **clean up** all generated artefacts and orphan processes on interruption or exit.\n\n### Prerequisites\n\n* [`delve`](https://command-not-found.com/dlv)\n* [`kubectl`](https://command-not-found.com/kubectl)\n\nAll above prerequisites will be installed if they are not already present. In addition to these, the following are assumed to be installed on the user's machine,\n\n* [`awk`](https://command-not-found.com/awk)\n* [`curl`](https://command-not-found.com/curl)\n* [`jq`](https://command-not-found.com/jq)\n* [`md5sum`](https://command-not-found.com/md5sum)\n* [`stty`](https://command-not-found.com/stty)\n\n### Usage\n\nAlfred can be used in the following ways:\n* IDE: Create a remote golang debugger configuration in your respective IDE, that points to the forwarded port (`--port`).\n  * NOTE: Most IDEs assume same `--target-port` and `--port` values.\n\n\u003cdetails\u003e\n\u003csummary\u003eScreenshot\u003c/summary\u003e\n\n![./assets/ide-configuration.png](./assets/ide-configuration.png)\n\n\u003c/details\u003e\n\n* Terminal: Connect to the forwarded debugging port in the in-cluster environment using the command below.\n  * `dlv connect \"127.0.0.1:${PORT}\" --accept-multiclient --api-version 2 --check-go-version --headless --only-same-user false`\n\n### Demonstration\n\nThe repository used to test out the debugger, and to record the demonstration below is\n[`red-hat-storage/mcg-osd-deployer`](https://github.com/red-hat-storage/mcg-osd-deployer).\n\n\u003cdetails\u003e\n\u003csummary\u003eScreencast\u003c/summary\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003einitial-build (v0.0.1)\u003c/summary\u003e\n\nhttps://user-images.githubusercontent.com/33557095/182026204-50179f87-4ef5-4781-a0ba-114060427bfd.mp4\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003elazarus (v0.1.0)\u003c/summary\u003e\n\nhttps://user-images.githubusercontent.com/33557095/183291207-7303d282-656e-4311-96a4-ceab39ab3a71.mp4\n\n\u003c/details\u003e\n\n\u003c/details\u003e\n\n### Installation\n\n```bash\n# point a global binary to the alfred script, for inter-project convenience.\nln -s ${PWD}/alfred.sh /usr/local/bin/alfred\n```\n\n### Feature status\n\n* [**Todo**] Profile the script to detect potential performance bottlenecks.\n* [**Todo**] Allow `.alfredrc` configuration files so the user does not need to pass in the same arguments everytime, which they\n  can define in the project root (or `~/.config/`).\n* [**Done**] Watch the parent directory for changes, automate the creation of a corresponding debug image and it's injection into\n  the CSV, so that the entire workflow can be truly automated.\n\n### Trivia\n\n\u003e What led to the incubation of this project?\n\nThis project started out as a question (a thread) on [`r/kubernetes`](https://www.reddit.com/r/kubernetes/comments/w6tsmf/q_debugger_injection_possibilities/?utm_source=share\u0026utm_medium=web2x\u0026context=3) and the idea was pivoted twice (binary `ConfigMap`s to `emptyDir`, and `emptyDir` to finally, `kubectl *`) since then. I plan on continuing to make this more efficient in terms of usability and performance, as I get more feedback over time.\n\n\u003e Why bash?\n\nInitially, this started out as a Golang project, [lazarus](https://github.com/rexagod/lazarus), but soon pivoted to a bash utility since there's a plethora of production-grade utilities already available in `kubectl` that are directly relevant to this project and which it can utilize in a flexible manner. If binary `ConfigMap`s or `emptyDir`s were at the core of this, the preference would have easily been Go.\n\n### LICENSE\n\n[GNU AFFERO GENERAL PUBLIC LICENSE, Version 3, 19 November 2007](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frexagod%2Falfred","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frexagod%2Falfred","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frexagod%2Falfred/lists"}