{"id":41079089,"url":"https://github.com/yolo-sh/agent-container","last_synced_at":"2026-01-22T13:35:32.186Z","repository":{"id":59489921,"uuid":"536622474","full_name":"yolo-sh/agent-container","owner":"yolo-sh","description":"The agent that connects your environment container with the host","archived":false,"fork":false,"pushed_at":"2022-09-19T16:30:34.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-15T07:53:47.811Z","etag":null,"topics":["docker","go","grpc","yolo"],"latest_commit_sha":null,"homepage":"https://yo-lo.sh","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yolo-sh.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-09-14T14:39:17.000Z","updated_at":"2022-10-31T17:02:31.000Z","dependencies_parsed_at":"2022-09-18T00:01:12.145Z","dependency_job_id":null,"html_url":"https://github.com/yolo-sh/agent-container","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/yolo-sh/agent-container","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yolo-sh%2Fagent-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yolo-sh%2Fagent-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yolo-sh%2Fagent-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yolo-sh%2Fagent-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yolo-sh","download_url":"https://codeload.github.com/yolo-sh/agent-container/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yolo-sh%2Fagent-container/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28663794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["docker","go","grpc","yolo"],"created_at":"2026-01-22T13:35:31.480Z","updated_at":"2026-01-22T13:35:32.174Z","avatar_url":"https://github.com/yolo-sh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agent / Container\n\nThis repository contains the source code of the container agent. \n\nThe container agent is installed in the container running your environment via systemd (see the [workspace-base](https://github.com/yolo-sh/workspace-base) repository).\n\nThe main role of this agent is to enable communication between your environment container and the host.\n\nThe container agent is composed of two components: \n\n - A `network manager`.\n\n - A `gRPC server`.\n\n## Table of contents\n- [Requirements](#requirements)\n- [Usage](#usage)\n  - [Generating the gRPC server's code](#generating-the-grpc-servers-code)\n- [Container agent](#container-agent)\n  - [Network manager](#network-manager)\n  - [gRPC Server](#grpc-server)\n- [License](#license)\n\n## Requirements\n\nThe container agent only works on `linux` and requires:\n\n  - `go \u003e= 1.17`\n\n  - `protoc \u003e= 3.0` (see [Protocol Buffer Compiler Installation](https://grpc.io/docs/protoc-installation/))\n  \n  - `google.golang.org/protobuf/cmd/protoc-gen-go@latest` (install via `go install`)\n  \n  - `google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest` (install via `go install`)\n\n## Usage\n\nThe container agent could be run using the `go run main.go` command. \n\nThe `gRPC server` will listen on an Unix socket at `/yolo-config/agent-container-grpc.sock` and the `network manager` will poll `/proc/net/tcp` for open ports.\n\n### Generating the gRPC server's code\n\nThe `gRPC server`'s code could be generated by running the following command **in the `proto` directory**:\n\n```bash\nprotoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative agent_container.proto\n```\n\n## Container agent\n\nThe `network manager` lets you access the services that run in the environment container network. \n\nThe `gRPC server`, on the other hand, is used to enable communication with the [host agent](https://github.com/yolo-sh/agent) (via a shared unix socket `/yolo-config/agent-container-grpc.sock`).\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/1233275/187863602-775b14db-f88d-4bfd-9b0b-c543643d020e.png\" alt=\"infra\" /\u003e\n\u003c/p\u003e\n\n### Network manager\n\nThe `network manager` will poll `/proc/net/tcp` for open ports and redirect traffic from the `host` to the listening service.\n\n### gRPC server\n\nThe `gRPC server` will be accessed by the [host agent](https://github.com/yolo-sh/agent) via a shared unix socket `/yolo-config/agent-container-grpc.sock`.\n\nIt is principally used to initialize the environment container as you can see in the service definition:\n\n```proto\nservice Agent {\n  rpc Init (InitRequest) returns (stream InitReply) {}\n}\n\nmessage InitRequest {\n  string env_repo_owner = 1;\n  string env_repo_name = 2;\n  repeated string env_repo_languages_used = 3;\n  string github_user_email = 4;\n  string user_full_name = 5;\n}\n\nmessage InitReply {\n  string log_line_header = 1;\n  string log_line = 2;\n  optional string github_ssh_public_key_content = 3;\n  optional string github_gpg_public_key_content = 4;\n}\n```\n\nThe `Init` method will clone your repositories and run a [shell script](https://github.com/yolo-sh/agent-container/blob/main/internal/grpcserver/init.sh) that will, among other things, generate the `SSH` and `GPG` keys used in GitHub.\n\n**This method is idempotent**.\n\n## License\n\nYolo is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyolo-sh%2Fagent-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyolo-sh%2Fagent-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyolo-sh%2Fagent-container/lists"}