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

Upgrade Fabric v2.2 code to Helm version 3 #1098

Closed abevers closed 3 years ago

abevers commented 3 years ago

Description

As a developer, I want to update the BAF Hyperledger Fabric v2.2 code, so that the network + application deployment work with Helm 3 and Helm-Operator v3 upgrade.

Steps

NOTE: Use the latest code from the feature/fabric220 branch as baseline, also create the PR to this branch!

This story consists of a couple of components:

Main network deployment

  1. Update charts to have the latest annotations & consistency between those annotations
    • Change Chart.yaml: version to 0.2.0 & appVersion to 2.0
    • Check metadata.labels to be complete
    • Make sure selector.matchLabels is consistent with template.metadata.labels
  2. Update all the *.tpl files to have apiVersion: helm.fluxcd.io/v1 and fluxcd.io/automated: false
  3. Run the deployment and check if every Helm release is deployed successfully, if not fix any errors
  4. Once deployed, make sure that the reset-network.yaml playbook completely cleans up the network

Add new organization deployment

  1. Use the same charts used in the main network deployment
  2. First deploy 3 out of 4 peer organizations
  3. Once this deployment has completed & peers have anchored, joined channel, installed & instantiated, run the addneworg.yaml playbook to add additional organization
  4. Validate that the organization has been added by checking the installed and instantiated chaincodes.

Add new channel deployment

  1. Deploy a full network using the same charts used in the main network deployment
  2. Once this deployment has completed, create a new channel by using the create-new-channel.yaml playbook.
  3. Validate that the channel has been correctly deployed, by calling the peer channel list command on the peer CLI of each peer on the channel

Upgrade chaincode deployment

  1. Deploy a full network using the same charts used in the main network deployment
  2. Once this deployment has completed, upgrade the supplychain chaincode to version 2 by using the chaincode-upgrade.yaml playbook.
  3. Validate that the chaincode has been upgraded by using the peer-cli.

Acceptance Criteria / DoD

  1. The Hyperledger Fabric network is succesfully deployed with both consensus mechanisms + orderer counts:
    • Raft consensus + odd amount of orderers
    • Kafka consensus + even amount of orderers
  2. The network is completely cleaned up when using the reset-network.yaml playbook
  3. Test using existing molecule test cases and fix them if required
  4. Update and test the application code
abevers commented 3 years ago

Reference application deployment

  1. Update charts to have the latest annotations & consistency between those annotations
    • Change Chart.yaml: version to 0.2.0 & appVersion to 2.0
    • Check metadata.labels to be complete
    • Make sure selector.matchLabels is consistent with template.metadata.labels
  2. Update all the *.tpl files to have apiVersion: helm.fluxcd.io/v1 and fluxcd.io/automated: false
  3. Deploy the application:
    • Restserver & Express API for each organization
    • Frontend for each organization
  4. Run the Postman runner to validate complete working of network & chaincodes

Implementation & testing of the reference application will be moved to another story as it has not been tested with Fabric 2.2, so it is deemed out of scope for this story