forked from hyperledger/bevel
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hyperledger#23 from wou43/mvp_v1.0
updated external deployment logic
- Loading branch information
Showing
35 changed files
with
813 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,4 @@ | |
**/node_modules | ||
# custom config templates | ||
*_custom.tpl | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
platforms/hyperledger-fabric/configuration/deploy-external-chaincode.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This playbook executes required tasks to commit chaincode | ||
# on existing Kubernetes clusters. The Kubernetes clusters should already be created and the infomation | ||
# to connect to the clusters be updated in the network.yaml file that is used as an input to this playbook | ||
########################################################################################### | ||
# To Run this playbook from this directory, use the following command (network.yaml also in this directory) | ||
# ansible-playbook platforms/hyperledger-fabric/configuration/commit-chaincode.yaml -e "@./network.yaml" | ||
############################################################################################ | ||
# Please ensure that the ../../shared/configuration playbooks have been run using the same network.yaml | ||
--- | ||
# This will apply to ansible_provisioners. /etc/ansible/hosts should be configured with this group | ||
- hosts: ansible_provisioners | ||
gather_facts: no | ||
tasks: | ||
|
||
############################################################################################ | ||
# This task deploys the external chaincode server for desired org | ||
- name: Deploy external chaincode server | ||
include_role: | ||
name: "create/external_chaincode" | ||
vars: | ||
docker_url: "{{ network.docker.url }}" | ||
name: "{{ item.name | lower}}" | ||
namespace: "{{ item.name | lower}}-net" | ||
component_type: "{{ item.type | lower}}" | ||
component_peers: "{{ item.services.peers }}" | ||
org_name: "{{ item.name | lower }}" | ||
org_ns: "{{ item.name | lower }}-net" | ||
kubernetes: "{{ item.k8s }}" | ||
vault: "{{ item.vault }}" | ||
peers: "{{ item.services.peers }}" | ||
git_url: "{{ item.gitops.git_url }}" | ||
git_branch: "{{ item.gitops.branch }}" | ||
charts_dir: "{{ item.gitops.chart_source }}" | ||
values_dir: "{{playbook_dir}}/../../../{{item.gitops.release_dir}}/{{ item.name | lower }}" | ||
loop: "{{ network['organizations'] }}" | ||
when: item.type == 'peer' and item.org_status == 'new' | ||
|
||
vars: #These variables can be overriden from the command line | ||
privilege_escalate: false #Default to NOT escalate to root privledges | ||
install_os: "linux" #Default to linux OS | ||
install_arch: "amd64" #Default to amd64 architecture | ||
bin_install_dir: "~/bin" #Default to /bin install directory for binaries | ||
add_new_org: 'false' # Default to false as this is for main network creation | ||
external_chaincode: false # Default to false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
platforms/hyperledger-fabric/configuration/install-external-chaincode-only.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# This playbook executes required tasks to instal, approve, commit and deploy an external chaincode | ||
# on existing Kubernetes clusters. The Kubernetes clusters should already be created and the infomation | ||
# to connect to the clusters be updated in the network.yaml file that is used as an input to this playbook | ||
########################################################################################### | ||
# To Run this playbook from this directory, use the following command (network.yaml also in this directory) | ||
# ansible-playbook platforms/hyperledger-fabric/configuration/external-chaincode.yaml -e "@./network.yaml" | ||
############################################################################################ | ||
# Please ensure that the ../../shared/configuration playbooks have been run using the same network.yaml | ||
--- | ||
# This will apply to ansible_provisioners. /etc/ansible/hosts should be configured with this group | ||
- hosts: ansible_provisioners | ||
gather_facts: no | ||
tasks: | ||
|
||
############################################################################################ | ||
# This task installs the external chaincode on the desired peers | ||
- name: Install external chaincode | ||
include_role: | ||
name: "create/chaincode/install-external" | ||
vars: | ||
envspace: "{{ network.env.type }}" | ||
name: "{{ item.name | lower}}" | ||
namespace: "{{ item.name | lower}}-net" | ||
component_type: "{{ item.type | lower}}" | ||
component_peers: "{{ item.services.peers }}" | ||
org_name: "{{ item.name | lower }}" | ||
org_ns: "{{ item.name | lower }}-net" | ||
kubernetes: "{{ item.k8s }}" | ||
vault: "{{ item.vault }}" | ||
peers: "{{ item.services.peers }}" | ||
git_url: "{{ item.gitops.git_url }}" | ||
git_branch: "{{ item.gitops.branch }}" | ||
docker_url: "{{ network.docker.url }}" | ||
charts_dir: "{{ item.gitops.chart_source }}" | ||
values_dir: "{{playbook_dir}}/../../../{{item.gitops.release_dir}}/{{ item.name | lower }}" | ||
loop: "{{ network['organizations'] }}" | ||
when: item.type == 'peer' and item.org_status == 'new' | ||
|
||
############################################################################################ | ||
# This task approves desired installed chaincode on the peers | ||
- name: "Approve chaincode" | ||
include_role: | ||
name: "create/chaincode/approve" | ||
vars: | ||
participants: "{{ item.participants }}" | ||
docker_url: "{{ network.docker.url }}" | ||
loop: "{{ network['channels'] }}" | ||
when: participants is defined and '2.' in network.version | ||
|
||
############################################################################################ | ||
# This task commits the desired approved chaincode | ||
- name: Commit chaincode | ||
include_role: | ||
name: "create/chaincode/commit" | ||
vars: | ||
participants: "{{ item.participants }}" | ||
docker_url: "{{ network.docker.url }}" | ||
approvers: "{{ item.endorsers }}" | ||
loop: "{{ network['channels'] }}" | ||
loop_control: | ||
extended: true | ||
when: add_new_org == 'false' and '2.' in network.version | ||
|
||
############################################################################################ | ||
# This task deploys the external chaincode server for desired org | ||
- name: Deploy external chaincode server | ||
include_role: | ||
name: "create/external_chaincode" | ||
vars: | ||
docker_url: "{{ network.docker.url }}" | ||
name: "{{ item.name | lower}}" | ||
namespace: "{{ item.name | lower}}-net" | ||
component_type: "{{ item.type | lower}}" | ||
component_peers: "{{ item.services.peers }}" | ||
org_name: "{{ item.name | lower }}" | ||
org_ns: "{{ item.name | lower }}-net" | ||
kubernetes: "{{ item.k8s }}" | ||
vault: "{{ item.vault }}" | ||
peers: "{{ item.services.peers }}" | ||
git_url: "{{ item.gitops.git_url }}" | ||
git_branch: "{{ item.gitops.branch }}" | ||
charts_dir: "{{ item.gitops.chart_source }}" | ||
values_dir: "{{playbook_dir}}/../../../{{item.gitops.release_dir}}/{{ item.name | lower }}" | ||
loop: "{{ network['organizations'] }}" | ||
when: item.type == 'peer' and item.org_status == 'new' | ||
|
||
vars: #These variables can be overriden from the command line | ||
privilege_escalate: false #Default to NOT escalate to root privledges | ||
install_os: "linux" #Default to linux OS | ||
install_arch: "amd64" #Default to amd64 architecture | ||
bin_install_dir: "~/bin" #Default to /bin install directory for binaries | ||
add_new_org: 'false' # Default to false as this is for main network creation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.