From 2ee074d0f5359b249f5f3d4a1531e6f898e65cb8 Mon Sep 17 00:00:00 2001 From: Dmitry Chepurovskiy Date: Sun, 5 Sep 2021 00:15:02 +0300 Subject: [PATCH] Merge network and standalone helmfiles to one helmfile with conditions --- .pre-commit-config.yaml | 2 +- helmfile/README.md | 8 +-- helmfile/helmfile-standalone.yaml | 49 ------------------- .../{helmfile-network.yaml => helmfile.yaml} | 29 +++++++++++ 4 files changed, 34 insertions(+), 54 deletions(-) delete mode 100644 helmfile/helmfile-standalone.yaml rename helmfile/{helmfile-network.yaml => helmfile.yaml} (60%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c4521d0..473c08c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: end-of-file-fixer - id: check-added-large-files - id: check-yaml - exclude: ^(charts/.*/templates/|helmfile/helmfile-.*\.yaml) + exclude: ^(charts/.*/templates/|helmfile/helmfile.*\.yaml) - repo: git://github.com/antonbabenko/pre-commit-terraform rev: v1.50.0 hooks: diff --git a/helmfile/README.md b/helmfile/README.md index c325e8b..8d24093 100644 --- a/helmfile/README.md +++ b/helmfile/README.md @@ -17,7 +17,7 @@ More information about indexing could be found [here](https://thegraph.com/docs/ ### Installation Prepare values in `values` directory first. `` can be any string of your choice. ``` -helmfile -f helmfile-network.yaml -n apply +helmfile -f helmfile.yaml -e network -n apply ``` ### Install graph-cli and indexer-cli @@ -52,7 +52,7 @@ Prepare values in `values` directory first. `` can be any string of y In the example bellow external ethereum mainnet endpoint is used, cause the indexing contract for the example subgraph is located in ethereum mainnet. ``` -helmfile -f helmfile-standalone.yaml -n apply +helmfile -f helmfile.yaml -e standalone -n apply ``` ## Potential Installation Bugs and Troubleshooting @@ -173,11 +173,11 @@ service: This would expose ports used by the graph protocol node to the web. Do note you'll need to run the below commands for changes to be reflected. ``` -helmfile -f helmfile-standalone.yaml -n apply +helmfile -f helmfile.yaml -e standalone -n apply or -helmfile -f helmfile-network.yaml -n apply +helmfile -f helmfile.yaml -e network -n apply ``` Once the changed have been applied get the external ip for the the query service. diff --git a/helmfile/helmfile-standalone.yaml b/helmfile/helmfile-standalone.yaml deleted file mode 100644 index aeb8a88..0000000 --- a/helmfile/helmfile-standalone.yaml +++ /dev/null @@ -1,49 +0,0 @@ -helmDefaults: - wait: true - -releases: -- name: postgres - chart: ../charts/postgres - labels: - component: postgres - values: - - values/postgres.yaml - -- name: ipfs - chart: ../charts/ipfs - labels: - component: ipfs - values: - - args: - - --migrate=true - # Prevent IPFS from connecting to IPFS network - # It would prevent your files from sharing with network and would prevent your applications from using external files - - --offline - -- name: graphprotocol-node-index - chart: ../charts/graphprotocol-node - labels: - component: node-index - values: - - values/graphprotocol-node-index.yaml - - values/graphprotocol-node.secret.yaml - # Overrides ipfs endpoint to local - - config: - ipfs: http://ipfs-ipfs:5001/ - needs: - - postgres - - ipfs - -- name: graphprotocol-node-query - chart: ../charts/graphprotocol-node - labels: - component: node-query - values: - - values/graphprotocol-node-query.yaml - - values/graphprotocol-node.secret.yaml - # Overrides ipfs endpoint to local - - config: - ipfs: http://ipfs-ipfs:5001/ - needs: - - postgres - - ipfs diff --git a/helmfile/helmfile-network.yaml b/helmfile/helmfile.yaml similarity index 60% rename from helmfile/helmfile-network.yaml rename to helmfile/helmfile.yaml index 6e59e64..3037cff 100644 --- a/helmfile/helmfile-network.yaml +++ b/helmfile/helmfile.yaml @@ -1,6 +1,17 @@ helmDefaults: wait: true +environments: + standalone: + values: + - installIpfs: true + - installIndexer: false + - ipfsEndpoint: "http://ipfs-ipfs:5001/" + network: + values: + - installIpfs: false + - installIndexer: true + - ipfsEndpoint: "https://ipfs.network.thegraph.com" releases: - name: postgres chart: ../charts/postgres @@ -16,6 +27,8 @@ releases: values: - values/graphprotocol-node-index.yaml - values/graphprotocol-node.secret.yaml + - config: + ipfs: {{ .Values.ipfsEndpoint }} needs: - postgres @@ -26,6 +39,8 @@ releases: values: - values/graphprotocol-node-query.yaml - values/graphprotocol-node.secret.yaml + - config: + ipfs: {{ .Values.ipfsEndpoint }} needs: - postgres @@ -40,6 +55,7 @@ releases: - postgres - graphprotocol-node-index - graphprotocol-node-query + installed: {{ .Values.installIndexer }} - name: graphprotocol-indexer-service chart: ../charts/graphprotocol-indexer-service @@ -52,3 +68,16 @@ releases: - postgres - graphprotocol-node-index - graphprotocol-node-query + installed: {{ .Values.installIndexer }} + +- name: ipfs + chart: ../charts/ipfs + labels: + component: ipfs + values: + - args: + - --migrate=true + # Prevent IPFS from connecting to IPFS network + # It would prevent your files from sharing with network and would prevent your applications from using external files + - --offline + installed: {{ .Values.installIpfs }}