-
Notifications
You must be signed in to change notification settings - Fork 755
Many issues when deploy a fabric 2.5.4 network using the playbooks in minikube #2659
Description
Describe the bug
When trying to deploy a Fabric 2.5.4 network I found a series of bugs and inconsistencies.
- The first bug happens at the fabric-genesis stage:
bevel/platforms/hyperledger-fabric/configuration/roles/create/genesis/tasks/valuefile.yaml
Lines 2 to 10 in 35d5589
- name: Create Value files for Genesis include_role: name: "{{ playbook_dir }}/../../shared/configuration/roles/create/job_component" vars: name: "{{ org.name | lower }}" component_ns: "{{ org.name | lower }}-net" component_name: "genesis" consensus: "{{ network.consensus }}" type: "fabric_genesis"
charts:
...
bevel/platforms/shared/configuration/roles/create/job_component/vars/main.yaml
Lines 30 to 31 in 35d5589
bevel_alpine_version: latest fabric_tools_image: bevel-fabric-tools
bevel/platforms/shared/configuration/roles/create/job_component/templates/fabric_genesis.tpl
Lines 21 to 22 in 35d5589
alpineUtils: {{ docker_url }}/bevel-alpine:{{ bevel_alpine_version }} fabricTools: {{ docker_url }}/{{ fabric_tools_image }}
This issue is fixed with:
image:
alpineUtils: {{ docker_url }}/bevel-alpine:{{ charts.bevel_alpine_version }}
fabricTools: {{ docker_url }}/{{ charts.fabric_tools_image }}- The fabric-genesis operation tries to update a helm repo. However, no repo is added by default:
update_repo_cache: true
So, I tried to add the bevel chart repo extensively mentioned in the documentation. It did not work
helm repo add bevel https://hyperledger.github.io/bevelError: looks like "https://hyperledger.github.io/bevel" is not a valid chart repository or cannot be reached: failed to fetch https://hyperl
edger.github.io/bevel/index.yaml : 404 Not Found
So I commented and it worked. I have finally executed the ./platforms/shared/configuration/site.yaml playbook.
# update_repo_cache: true- Now, I use the playbook
platforms/hyperledger-fabric/configuration/add-new-channel.yamlto add a new channel. The bevel_alpine_version and fabric_tools_image appeared again, so I applied the same prior fix:
bevel/platforms/shared/configuration/roles/create/job_component/templates/osn_create_channel_job.tpl
Lines 21 to 22 in 35d5589
fabricTools: {{ docker_url }}/{{ fabric_tools_image }} alpineUtils: {{ docker_url }}/bevel-alpine:{{ bevel_alpine_version }}
I could successfully create the channel.
- I also tried to create a channel using the
./platforms/hyperledger-fabric/configuration/create-join-channel.yaml. However, this playbook seems to be outdated, considering the changes introduced by [fabric] Ansible decoupling for create/crypto/orderer role #1712
name: "create/crypto/orderer"
name: "create/crypto/peer"
After commenting this nonexistent playbooks, there it was the problem related to the bevel_alpine_version and fabric_tools_image again:
bevel/platforms/shared/configuration/roles/create/job_component/templates/create_channel_job.tpl
Lines 21 to 22 in 35d5589
| fabricTools: {{ docker_url }}/{{ fabric_tools_image }} | |
| alpineUtils: {{ docker_url }}/bevel-alpine:{{ bevel_alpine_version }} |
bevel/platforms/shared/configuration/roles/create/job_component/templates/join_channel_job.tpl
Lines 21 to 22 in 35d5589
| fabricTools: {{ docker_url }}/{{ fabric_tools_image }} | |
| alpineUtils: {{ docker_url }}/bevel-alpine:{{ bevel_alpine_version }} |
To Reproduce
Steps to reproduce the behavior:
- Build the bevel container
- Create a fabric 2.5.4 network file with gitops, vault, no proxy. Containing 2 orgs.
- Run the bevel container and execute:
mkdir build
# cp ./platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml build/network.yaml
cp ~/.kube/config build/config
# setup vault
docker run --network=host -p 8200:8200 --name vault hashicorp/vault:1.13.1
export VAULT_ADDR='http://192.168.25.5:8200'
export VAULT_TOKEN="hvs.vkv1OoBqgXgVDAIMmo2TskCB"
vault secrets enable -version=2 -path=secretsv2 kv
docker build -t hyperledger/bevel:johann .
docker run -it --rm --network=host -v $(pwd):/home/bevel \
-w /home/bevel --name bevel hyperledger/bevel:johann /bin/bash
# EDIT the network.yaml file to set the correct values for your environment
# COMMANDS INSIDE THE CONTAINER
git config --global --add safe.directory /home/bevel
export PATH=/root/bin:$PATH
export KUBECONFIG=/home/bevel/build/config
export VAULT_ADDR='http://192.168.25.5:8200'
ajv validate -s ./platforms/network-schema.json -d ./build/network.yaml
# GENERATES ISSUES 1 and 2:
ansible-playbook -vv ./platforms/shared/configuration/site.yaml \
--inventory-file=./platforms/shared/inventory/ \
-e "@./build/network.yaml" \
-e 'ansible_python_interpreter=/usr/bin/python3'
# GENERATES ISSUE 3
ansible-playbook -vv ./platforms/hyperledger-fabric/configuration/add-new-channel.yaml \
--inventory-file=./platforms/shared/inventory/ \
-e "@./build/network.yaml" \
-e 'ansible_python_interpreter=/usr/bin/python3'
# GENERATES ISSUE 4
ansible-playbook -vv ./platforms/hyperledger-fabric/configuration/create-join-channel.yaml \
--inventory-file=./platforms/shared/inventory/ \
-e "@./build/network.yaml" \
-e 'ansible_python_interpreter=/usr/bin/python3'Expected behavior
Fabric 2.5.4 network is created, before channel is created and successfully joined.
Screenshots
Issues:
Environment (please complete the following information):
- arch linux
- 6.12.21-1-lts




