Przeglądaj źródła

playground: optionally run setup new chain script

Mokhtar Naamani 3 lat temu
rodzic
commit
733fc0ab68

+ 6 - 1
.github/workflows/deploy-playground.yml

@@ -23,6 +23,10 @@ on:
         description: 'Additional identifier to include in stack name'
         required: false
         default: 'playground'
+      skipChainSetup:
+        description: 'Optionally skip running newChainSetup script (true or false)'
+        required: true
+        default: 'false'
       # TODO: customDomain instead of ip_address.nip.io
       # customDomain:
       #   description: 'DNS hostname to use for deployment'
@@ -83,7 +87,8 @@ jobs:
             ${{ steps.deploy_stack.outputs.PublicIp }}
           options: |
             --extra-vars "git_repo=${{ github.event.inputs.gitRepo }} \
-                          branch_name=${{ github.event.inputs.branchName }}"
+                          branch_name=${{ github.event.inputs.branchName }} \
+                          skip_chain_setup=${{ github.event.inputs.skipChainSetup }}"
 
       - name: Save the endpoints file as an artifact
         uses: actions/upload-artifact@v2

+ 2 - 0
devops/aws/deploy-playground-playbook.yml

@@ -77,6 +77,7 @@
         PERSIST: 'true'
         COLOSSUS_1_URL: 'https://{{ inventory_hostname }}.nip.io/colossus-1/'
         DISTRIBUTOR_1_URL: 'https://{{ inventory_hostname }}.nip.io/distributor-1/'
+        SKIP_CHAIN_SETUP: '{{ skip_chain_setup }}'
       async: 1800
       poll: 0
       register: compose_result
@@ -114,6 +115,7 @@
           colossus: https://{{ nip_domain }}/colossus-1
           distributor: https://{{ nip_domain }}/distributor-1
           graphql_server: https://{{ nip_domain }}/query-node/server/graphql
+          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
           orion: https://{{ nip_domain }}/orion/graphql

+ 1 - 1
devops/aws/deploy-playground.sh

@@ -42,5 +42,5 @@ if [ $? -eq 0 ]; then
 
   echo -e "\n\n=========== Configuring node ==========="
   ansible-playbook -i $SERVER_IP, --private-key $KEY_PATH deploy-playground-playbook.yml \
-    --extra-vars "branch_name=$BRANCH_NAME git_repo=$GIT_REPO"
+    --extra-vars "branch_name=$BRANCH_NAME git_repo=$GIT_REPO skip_chain_setup=$SKIP_CHAIN_SETUP"
 fi

+ 1 - 0
devops/aws/deploy-single-node.sample.cfg

@@ -20,3 +20,4 @@ CHAIN_SPEC_FILE="https://github.com/Joystream/joystream/releases/download/v9.14.
 # For deploy playground playbook only
 GIT_REPO="https://github.com/Joystream/joystream.git"
 BRANCH_NAME="master"
+SKIP_CHAIN_SETUP="false"

+ 5 - 0
devops/aws/templates/Playground-Caddyfile.j2

@@ -28,6 +28,11 @@
     reverse_proxy localhost:8081
 }
 
+wss://{{ nip_domain }}/query-node/server* {
+    uri strip_prefix /query-node/server
+    reverse_proxy localhost:8081
+}
+
 {{ nip_domain }}/query-node/indexer* {
     uri strip_prefix /query-node/indexer
     reverse_proxy localhost:4000

+ 9 - 7
start.sh

@@ -26,13 +26,15 @@ fi
 docker-compose up -d joystream-node
 
 ## Init the chain with some state
-export SKIP_MOCK_CONTENT=true
-export SKIP_QUERY_NODE_CHECKS=true
-HOST_IP=$(tests/network-tests/get-host-ip.sh)
-export COLOSSUS_1_URL=${COLOSSUS_1_URL:="http://${HOST_IP}:3333"}
-export COLOSSUS_1_TRANSACTOR_KEY=$(docker run --rm --pull=always docker.io/parity/subkey:2.0.1 inspect ${COLOSSUS_1_TRANSACTOR_URI} --output-type json | jq .ss58Address -r)
-export DISTRIBUTOR_1_URL=${DISTRIBUTOR_1_URL:="http://${HOST_IP}:3334"}
-./tests/integration-tests/run-test-scenario.sh ${INIT_CHAIN_SCENARIO}
+if [[ $SKIP_CHAIN_SETUP != 'true' ]]; then
+  export SKIP_MOCK_CONTENT=true
+  export SKIP_QUERY_NODE_CHECKS=true
+  HOST_IP=$(tests/network-tests/get-host-ip.sh)
+  export COLOSSUS_1_URL=${COLOSSUS_1_URL:="http://${HOST_IP}:3333"}
+  export COLOSSUS_1_TRANSACTOR_KEY=$(docker run --rm --pull=always docker.io/parity/subkey:2.0.1 inspect ${COLOSSUS_1_TRANSACTOR_URI} --output-type json | jq .ss58Address -r)
+  export DISTRIBUTOR_1_URL=${DISTRIBUTOR_1_URL:="http://${HOST_IP}:3334"}
+  ./tests/integration-tests/run-test-scenario.sh ${INIT_CHAIN_SCENARIO}
+fi
 
 ## Member faucet
 docker-compose up -d faucet