A combination of ansible, nodejs and shell scripts is used for automation of various tasks.
From a birdseye view we can separate the code into 4 different modules:
- Ansible scripts
- External modules
- Shell scripts
- Documentation
Directory structure is as follows:
caliper/
: An external module added as a git submodule. It represents the code from Hyperledger Caliper project. It is used for collecting metrics for Hyperledger Fabric.docs/
: It contains all the documentation for this project. The files in this directory have been linked in README.md, which provides an overview of the documentation.hyperleger
: It contains ansible scripts for setting up a Hyperledger Fabric network on Kubernetes cluster. It also configures a fabric channel and provides configuration for metrics collection via Caliper.hyperleger/roles/channel_setup
: Ansible role to set up a fabric channel and joins all peer into it.hyperleger/roles/metrics_config
: Ansible role to provide configuration for Caliper, e.g provide fabric network definition.hyperleger/roles/network_config
: Ansible role to create configuration for fabric e.g crypto-config, channel-artifacts, kubernetes templates etc.hyperleger/roles/network_setup
: Ansible role to deploy/undeploy fabric network on k8s cluster.hyperleger/roles/prepare_cli_node
: Ansible role to prepare the cli node for performing different operation e.g. modify DNS server, mount to NFS server.
inventory/
: It contains hosts and configuration for various ansible scripts.inventory/infra
: ansible configuration for openstack playbooksinventory/cluster
: ansible configuration for k8s cluster playbooksinventory/blockchain
: ansible configuration for hyperledger playbooks
kubespray/
: An external module added a a git submodule. It represents the code from kubespray, a tool to deploy k8s cluster.openstack_infra/
; It contains ansible scripts for setting up resources in openstackc cluster. It also configures a DNS server and NFS server, which are used for k8s cluster and fabric network.openstack_infra/roles/dns_bind9
: Ansible role to create a bind DNS server.openstack_infra/roles/lb_haproxy
: Ansible role to setup an haproxy tcp load-balancer.openstack_infra/roles/nfs_server
: Ansible role to create a NFs server, which will be used to share information between fabric peers.openstack_infra/roles/os_instance
: Ansible role to create all Openstack instances for kubernetes cluster and DNS/NFS server.openstack_infra/roles/prepare_instances
: Ansible role to perform some tasks on all created openstack instances e.g. install python, install NFS client etc.
playbooks/
: It contains ansible sub-playbooks used by playbooks in project directory.scripts/
: It contains shell scripts. These shell scripts automate the whole process of setting up a python or node environment and then calling respective ansible playbook or node scripts.