I have deployed a Hyperledger Fabric network v2.5.9 with K8S.
The core.yaml in the peer v2.5.9 image already includes the externalBuilder section:
# List of directories to treat as external builders and launchers for
# chaincode. The external builder detection processing will iterate over the
# builders in the order specified below.
# If you don't need to fallback to the default Docker builder, also unconfigure vm.endpoint above.
# To override this property via env variable use CORE_CHAINCODE_EXTERNALBUILDERS: [{name: x, path: dir1}, {name: y, path: dir2}]
# The path must be an absolute path.
externalBuilders:
- name: ccaas_builder
path: /opt/hyperledger/ccaas_builder/ccaas/bin
propagateEnvironment:
- CHAINCODE_AS_A_SERVICE_BUILDER_CONFIG
So after I deployed the network and create the application channel i am trying to install the chaincode to the peers and get the PACKAGE_ID in order i can deploy manually the CCAAS_K8S_POD to which the peer will connect to handle the chaincode lifecycle.
But i understand from the documentation that the detect ccaas binary only should be trigger on the commit chaincode step of the lifecycle.
Here is where i am a little confused, because i would expect that if I connect to the peer client and try to install the following asset-transfer-basic-external.tgz file:
tar cfz code.tar.gz connection.json
tar cfz asset-transfer-basic-external.tgz metadata.json code.tar.gz
By executing on the peer:
peer lifecycle chaincode install asset-transfer-basic-external.tgz;
It would try to install the chaincode that does not contain the source code, following the new logic for CCAAS.
But instead I get this error, where it looks like is trying to deploy a docker container for the chaincode as for older versions:
Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image inspection failed: Get "http://unix.sock/images/basic-0e9393b17bb6e3f64ec9d7914c3c935e95aa9a0b3da49b5c75967cdd83e31878-a72aa90629f3437f96bf68400e4bc835d979697e52787dd5acf19a272dc7934d/json": dial unix /var/run/docker.sock: connect: no such file or directory
So why is this happening?
Also could anyone please confirm, that by just adding the externalBuilder section in the peer core.yaml and using a peer version bigger than v2.4 the peer should detect we are trying to deploy the chaincode as an external service?
Many thanks