hyperledger / bevel

An automation framework for rapidly and consistently deploying production-ready DLT platforms
https://hyperledger-bevel.readthedocs.io/en/latest/
Apache License 2.0
340 stars 713 forks source link

Separate the network deployment and the chaincode installation in Hyperledger Fabric #1259

Closed arsulegai closed 3 years ago

arsulegai commented 3 years ago

Description

As an administrator of a Hyperledger Fabric network I want to deploy the network, but not install the chaincode right away so that custom chaincode can be installed/instantiated as a separate step by the other business process.

The site.yaml can provide an option to not install chaincode by default. The network configuration file thus providing flexibility of not knowing the chaincode at the time of network configuration. Also, introduce a playbook file for installing chaincode and instantiating it in a given channel if not already present (preferably as separate operations). This isolation helps in separating the network infrastructure deployment from the business operations.

Acceptance Criteria

  1. An option to disable default chaincode installation through the configured network.yaml file.
  2. A documented playbook file for installing and instantiating the chaincode.
jagpreetsinghsasan commented 3 years ago

Regarding this issue, @arsulegai I think having a tag in the root playbook (site.yaml) to make chaincode operations as optional, isn't a good idea, as features like install chaincode and stuff like that happens per peer, and site.yaml loops over the platforms.. which in-turn call the underlying platform specific playbooks. Having a top tier flag to enable/disable such feature will go opposite to our current goal of making Fabric more operator oriented. What's your opinion on the same?

Current Solution: If you remove the chaincode section from a peer of an organization mentioned in the network.yaml, for that peer, the chaincode doesn't get installed.

arsulegai commented 3 years ago

Thanks @jagpreetsinghsasan, I agree with you. Introducing a new flag might not be a good approach. If there is a documented way of installing chaincode, after the initial network installation then it should be sufficient. This would allow additional chaincode installation capability as well.

jagpreetsinghsasan commented 3 years ago

Yes, we already have an operational guide for it as mentioned here, but with the introduction of Fabric 2.x, we need to refactor the docs a bit. Thanks for pointing this out @arsulegai , the issue progress can be tracked here #1282

arsulegai commented 3 years ago

@jagpreetsinghsasan Please also note, the initial network bring up should not by default install the chaincode. Network bring up is separate from chaincode installation. Those 2 playbooks should be different.

sownak commented 3 years ago

@arsulegai the playbooks are different. platforms/hyperledger-fabric/configuration has all the separate playbooks.

arsulegai commented 3 years ago

Thanks @sownak @jagpreetsinghsasan :)