Browse Source

Add query node members support, update deploy infra

Anuj Bansal 3 years ago
parent
commit
363456ce2a

+ 1 - 1
.github/workflows/deploy-node-network.yml

@@ -86,7 +86,6 @@ jobs:
           else
             echo "Stack does not exist"
           fi
-          echo ${{ steps.myoutputs.outputs.proposalParameters }}
 
       - name: Deploy to AWS CloudFormation
         uses: aws-actions/aws-cloudformation-github-deploy@v1
@@ -126,6 +125,7 @@ jobs:
 
       - name: Run playbook to compile joystream-node on build server
         uses: dawidd6/action-ansible-playbook@v2
+        # Build binaries if AMI not specified or a custom proposals parameter is passed
         if: steps.myoutputs.outputs.ec2AMI == '' || steps.myoutputs.outputs.proposalParameters != ''
         with:
           playbook: build-code.yml

+ 2 - 0
devops/aws/deploy-infra.sample.cfg

@@ -35,5 +35,7 @@ INITIAL_BALANCES_PATH=""
 GIT_REPO="https://github.com/Joystream/joystream.git"
 BRANCH_NAME=master
 
+ALL_PROPOSALS_PARAMETERS_JSON=""
+
 # If true will build LOCAL_CODE_PATH otherwise will pull from GIT_REPO:BRANCH_NAME
 BUILD_LOCAL_CODE=false

+ 7 - 2
devops/aws/deploy-infra.sh

@@ -69,12 +69,17 @@ if [ $? -eq 0 ]; then
 
   echo -e "[build]\n$BUILD_SERVER\n\n[validators]\n$VALIDATORS\n[rpc]\n$RPC_NODES" > $INVENTORY_PATH
 
-  if [ -z "$EC2_AMI_ID" ]
+  # Build binaries if AMI not specified or a custom proposals parameter is passed
+  if [ -z "$EC2_AMI_ID" ] || [ -n "$ALL_PROPOSALS_PARAMETERS_JSON" ]
   then
     echo -e "\n\n=========== Compile joystream-node on build server ==========="
     ansible-playbook -i $INVENTORY_PATH --private-key $KEY_PATH build-code.yml \
-      --extra-vars "branch_name=$BRANCH_NAME git_repo=$GIT_REPO build_local_code=$BUILD_LOCAL_CODE data_path=$DATA_PATH"
+      --extra-vars "branch_name=$BRANCH_NAME git_repo=$GIT_REPO build_local_code=$BUILD_LOCAL_CODE
+                    data_path=$DATA_PATH proposal_parameters=$ALL_PROPOSALS_PARAMETERS_JSON"
+  fi
 
+  if [ -z "$EC2_AMI_ID" ]
+  then
     echo -e "\n\n=========== Install additional utils on build server ==========="
     ansible-playbook -i $INVENTORY_PATH --private-key $KEY_PATH setup-admin.yml
   fi

+ 4 - 2
devops/aws/roles/common/tasks/chain-spec-node-keys.yml

@@ -9,7 +9,7 @@
 - name: Copying initial members file to the server
   copy:
     src: '{{ initial_members_file }}'
-    dest: '{{ remote_code_path }}/initial-members.json'
+    dest: '{{ remote_code_path }}/query-node/mappings/src/bootstrap-data/data/members.json'
   when: initial_members_file is defined and initial_members_file|length > 0
   run_once: true
 
@@ -27,7 +27,9 @@
     --endowed 1 --keystore-path {{ remote_data_path }}
     {% if deployment_type is defined and deployment_type|length > 0 %}--deployment {{ deployment_type }}{% endif %}
     {% if initial_members_file is defined and initial_members_file|length > 0 %}--initial-balances-path {{ remote_code_path }}/initial-balances.json{% endif %}
-    {% if initial_balances_file is defined and initial_balances_file|length > 0 %}--initial-members-path {{ remote_code_path }}/initial-members.json{% endif %}
+    {% if initial_balances_file is defined and initial_balances_file|length > 0 %}
+    --initial-members-path {{ remote_code_path }}/query-node/mappings/src/bootstrap-data/data/members.json
+    {% endif %}
   register: chain_spec_output
   delegate_to: '{{ build_instance }}'
   run_once: true

+ 1 - 1
devops/aws/roles/rpc/tasks/main.yml

@@ -87,7 +87,7 @@
       graphql_server_websocket: wss://{{ nip_domain }}/query-node/server/graphql
       indexer: https://{{ nip_domain }}/query-node/indexer/graphql
       member_faucet: https://{{ nip_domain }}/member-faucet/register
-      config: https://{{ nip_domain }}//network/config.json
+      config: https://{{ nip_domain }}/network/config.json
   run_once: yes
 
 - name: Print endpoints