{"id":18301784,"url":"https://github.com/kfsoftware/externalbuilder","last_synced_at":"2025-04-12T14:14:17.821Z","repository":{"id":45257206,"uuid":"314192122","full_name":"kfsoftware/externalbuilder","owner":"kfsoftware","description":"External Chaincode builder for Hyperledger Fabric on Kubernetes","archived":false,"fork":false,"pushed_at":"2025-01-24T16:33:47.000Z","size":46,"stargazers_count":13,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T08:51:33.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kfsoftware.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":"2020-11-19T09:04:18.000Z","updated_at":"2023-12-06T19:58:45.000Z","dependencies_parsed_at":"2022-08-27T06:41:15.399Z","dependency_job_id":null,"html_url":"https://github.com/kfsoftware/externalbuilder","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfsoftware%2Fexternalbuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfsoftware%2Fexternalbuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfsoftware%2Fexternalbuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfsoftware%2Fexternalbuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kfsoftware","download_url":"https://codeload.github.com/kfsoftware/externalbuilder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578824,"owners_count":21127713,"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":[],"created_at":"2024-11-05T15:16:58.788Z","updated_at":"2025-04-12T14:14:17.798Z","avatar_url":"https://github.com/kfsoftware.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# External builder for Fabric on Kubernetes\n\n** **Work based on [hlfabric-k8scc](https://github.com/postfinance/hlfabric-k8scc)**\n\n## Introduction\nRunning Hyperledger Fabric on Kubernetes doesn't allow observability on the chaincodes, which includes, building and executing them. To solve this, we can use external builders and launchers to adapt the way HLF launches the chaincodes.\n\nTo read more about this topic [please visit the official documentation](https://hyperledger-fabric.readthedocs.io/en/release-2.2/cc_launcher.html). \n\n## What is different from *hlfabric-k8scc*\nThis external builder doesn't relay on a `ReadWriteMany` persistent volume claim, rather, it depends on a shared file server where the code and the build output will be stored.\n\n`ReadWriteMany` is not supported on many cloud providers, and of course not supported by test environments such as [KIND](https://github.com/kubernetes-sigs/kind/issues/1487)\n\nIn order to use it, you can either use one of the public images on [quay.io](https://quay.io/repository/kfsoftware/fabric-peer?tab=tags) or build the image by yourself.\n\n## Features\n- [x] Build chaincode for Golang\n- [x] Build chaincode for NodeJS\n- [x] Build chaincode for Java\n- [x] Proxy support\n\n## Roadmap\n- [ ] Cache builds between peers in the same cluster\n- [ ] Integration testing\n\n## Components\nExternal chaincode builder on Kubernetes needs a http server to store the chaincode inputs to compile them in a Pod, and to store the artifacts of the chaincode built. \n\nThe contents of this server can be found [here](./cmd/fileserver/fileserver.go)\n\n## Build\n\n### For HLF 2.2.0\n```bash\ndocker build -t quay.io/kfsoftware/fabric-peer:amd64-2.2.0 -f ./images/fabric-peer/2.2.0/Dockerfile ./\ndocker push quay.io/kfsoftware/fabric-peer:amd64-2.2.0\n```\n\n### For HLF 2.3.0\n```bash\ndocker build -t quay.io/kfsoftware/fabric-peer:amd64-2.3.0 -f ./images/fabric-peer/2.3.0/Dockerfile ./\ndocker push quay.io/kfsoftware/fabric-peer:amd64-2.3.0\n```\n\n### File Server\n```bash\ndocker build -t quay.io/kfsoftware/fabric-fs:amd64-2.2.0 -f ./Dockerfile ./\ndocker push quay.io/kfsoftware/fabric-fs:amd64-2.2.0\n```\n\n## Configure\n\nInside the **core.yaml** of the peer, under chaincode, there's a property called ``externalBuilders```.\n\nIf using the the image provided by this project, the contents of ```externalBuilders``` are the following:\n```yaml\n- name: k8s-builder\n  path: /builders/golang\n  propagateEnvironment:\n    - CHAINCODE_SHARED_DIR\n    - FILE_SERVER_BASE_IP\n    - KUBERNETES_SERVICE_HOST\n    - KUBERNETES_SERVICE_PORT\n    - K8SCC_CFGFILE\n    - TMPDIR\n    - LD_LIBRARY_PATH\n    - LIBPATH\n    - PATH\n    - EXTERNAL_BUILDER_HTTP_PROXY\n    - EXTERNAL_BUILDER_HTTPS_PROXY\n    - EXTERNAL_BUILDER_NO_PROXY\n    - EXTERNAL_BUILDER_PEER_URL\n\n```\n\n### Behind a proxy\n\nYou have to build your own image with your own **k8scc.yaml**\n```yaml\n\n---\nimages:\n  golang: \"hyperledger/fabric-ccenv:2.2.0\"\n  java: \"hyperledger/fabric-javaenv:2.2.0\"\n  node: \"hyperledger/fabric-nodeenv:2.2.0\"\n\nbuilder:\n  resources:\n    memory_limit: \"0.5G\"\n    cpu_limit: \"0.2\"\n\n  env:\n    - HTTP_PROXY=http://my-enterprise-proxy:1234\n    - HTTPS_PROXY=http://my-enterprise-proxy:1234\n    - NO_PROXY=home.com,example.com\n\nlauncher:\n  resources:\n    memory_limit: \"0.5G\"\n    cpu_limit: \"0.2\"\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfsoftware%2Fexternalbuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkfsoftware%2Fexternalbuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfsoftware%2Fexternalbuilder/lists"}