{"id":34139772,"url":"https://github.com/codepr/narwhal","last_synced_at":"2026-03-09T16:13:20.921Z","repository":{"id":78234526,"uuid":"249014797","full_name":"codepr/narwhal","owner":"codepr","description":"PoC of a simple continous integration system","archived":false,"fork":false,"pushed_at":"2025-01-09T21:52:44.000Z","size":183,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-17T15:05:13.721Z","etag":null,"topics":["ci","continuous-integration","go","rest-api","server"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codepr.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-21T16:23:43.000Z","updated_at":"2025-01-09T21:52:41.000Z","dependencies_parsed_at":"2024-06-21T16:37:42.206Z","dependency_job_id":"6d89b70d-1ea3-4872-8d62-08cb477f80f3","html_url":"https://github.com/codepr/narwhal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codepr/narwhal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepr%2Fnarwhal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepr%2Fnarwhal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepr%2Fnarwhal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepr%2Fnarwhal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codepr","download_url":"https://codeload.github.com/codepr/narwhal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepr%2Fnarwhal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30301828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T14:33:48.460Z","status":"ssl_error","status_checked_at":"2026-03-09T14:33:48.027Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ci","continuous-integration","go","rest-api","server"],"created_at":"2025-12-15T02:28:30.230Z","updated_at":"2026-03-09T16:13:20.906Z","avatar_url":"https://github.com/codepr.png","language":"Go","readme":"Narwhal\n=======\n\n![CI](https://github.com/codepr/narwhal/workflows/CI/badge.svg)\n\nPoC of a very simple CI system consists of 3 microservices:\n\n- **Agent:** It's the watcher process, ideally it should subscribe to remote\n  repositories (e.g. webhooks on github) waiting for new events to be\n  dispatched to the workers asynchronously through a middleware, for example a\n  RabbitMQ task-queue.\n\n- **Dispatcher:** a simple RESTful server, responsible for load-balancing CI\n  jobs to a pool of workers (runner) through RPC (currently using built-in\n  `net/rpc` package, `gRPC` would probably be a better solution for production)\n  and collecting some useful stats by monitoring their state. Exposes some APIs\n  to get the job's related infos or to force some re-submit.\n\n- **Runner:** Orchestrate received jobs safely inside an isolated environment\n  by creating containers on-the-go.\n\n### Rationale\n\nSimple project in Go, actually made to learn the language as it offers a lot of\nspace for improvements and incremental addition of features.\n\nIdeally a bunch of runners should be spread on a peer’s subnet with similar hw\nand each one registers itself to the dispatcher. Beside registering itself,\nanother way could very well be to use a load-balancer or a proxy, registering\nit’s URL to the dispatcher and demanding the job distributions to it.\n\n### Draft architecture\n\n`Agent` microservice is responsible for subscribing to VC's event notification\nsystem (for now supporting just GitHub), forwarding every new commit not\nalready in processing to a `RabbitMQ` commit queue.\n\n`Dispatcher` microservices is responsible for receiving the commit jobs from\nthe queue and forward it to the best `Runner` according to different heuristics\n(could be also handled by a load-balancer and let him do the balancing). This\nmicroservice is also responsible for continous monitoring of the runners\nthrough RPC and communicating metrics to another `RabbitMQ` toward a backend\ndedicated webserver (hypotethically the main entry point for a front-end\napplication, with also websockets and so on).\n\n`Runner` is the process responsible for cloning of the repository and running\nthe process listed in the narwhal.yml file, ideally in docker containers.\n\n\u003ccenter\u003e\u003cimg src=\"draft-architecture.png\" width=550px alt=\"Draft architecture\"\u003e\u003c/center\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodepr%2Fnarwhal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodepr%2Fnarwhal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodepr%2Fnarwhal/lists"}