-
Notifications
You must be signed in to change notification settings - Fork 0
[Tooling] Integrate Tilt development environment #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
0ee23df
wip: k8s resources from scratch
bryanchriswhite f7b7a38
wip: indexer running
bryanchriswhite fd46102
wip: gql-engine
bryanchriswhite 30f962d
wip: fix gql-engine & depl deps
bryanchriswhite 6684ded
refactor: Tiltfile to support external use
bryanchriswhite 8a2cf9f
wip: splitting localnet &n testnet indexer values
bryanchriswhite 20795c2
chore: add readiness and liveness probes
bryanchriswhite b5e4e13
refactor: pocketdex Tiltfile for re-use in the poktroll repo
bryanchriswhite 71ee7e7
refactor: consolidate tilt assets & extract more template values
bryanchriswhite 31fe923
fixup! HEAD^
bryanchriswhite 999481f
chore: add pgadmin to tilt
bryanchriswhite b5290fa
chore: add hostNetwork to support separate external (to tilt) localnet
bryanchriswhite 2831f7e
revert: package.json changes
bryanchriswhite 6b76580
chore: restore postgres version build arg
bryanchriswhite 08b1dbf
chore: parameterize gql-engine port
bryanchriswhite f877f11
chore: restore pgadmin liveness probe
bryanchriswhite c5cd406
chore: add missing GENESIS_FILENAME build args
bryanchriswhite 5d5d62f
fix: typo
bryanchriswhite 33c1acb
docs: add tilt instructions to README
bryanchriswhite df04aab
docs: add SET SCHEMA to README regarding psql access
bryanchriswhite d8d7d47
docs: add tilt screenshot to README
bryanchriswhite 398412c
docs: italicize tilt NOTE
bryanchriswhite 01b647f
docs: update README ToC
bryanchriswhite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,7 @@ | ||
| load("./tiltfiles/pocketdex.tilt", "pocketdex") | ||
| pocketdex("./", | ||
| # TODO(@bryanchriswhite): load genesis file name from env var or config file. | ||
| genesis_file_name="testnet.json", | ||
| postgres_values_path="./tiltfiles/k8s/postgres/values.yaml", | ||
| indexer_values_path="./tiltfiles/k8s/indexer/dev-testnet-indexer-values.yaml", | ||
| gql_engine_values_path="./tiltfiles/k8s/gql-engine/dev-gql-engine-values.yaml") |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,23 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *.orig | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj | ||
| .vscode/ |
This file contains hidden or 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,24 @@ | ||
| apiVersion: v2 | ||
| name: gql-engine | ||
| description: GraphQL API Server for Pocketdex | ||
|
|
||
| # A chart can be either an 'application' or a 'library' chart. | ||
| # | ||
| # Application charts are a collection of templates that can be packaged into versioned archives | ||
| # to be deployed. | ||
| # | ||
| # Library charts provide useful utilities or functions for the chart developer. They're included as | ||
| # a dependency of application charts to inject those utilities and functions into the rendering | ||
| # pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
| type: application | ||
|
|
||
| # This is the chart version. This version number should be incremented each time you make changes | ||
| # to the chart and its templates, including the app version. | ||
| # Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
| version: 0.1.0 | ||
|
|
||
| # This is the version number of the application being deployed. This version number should be | ||
| # incremented each time you make changes to the application. Versions are not expected to | ||
| # follow Semantic Versioning. They should reflect the version the application is using. | ||
| # It is recommended to use it with quotes. | ||
| appVersion: "1.16.0" |
This file contains hidden or 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,24 @@ | ||
| enable_graphiql_playground: true | ||
| indexer_endpoint: "http://indexer-service:3000" | ||
| port: 3000 | ||
| env: | ||
| NODE_ENV: development | ||
| # Testnet | ||
| ENDPOINT: "https://testnet-validated-validator-rpc.poktroll.com" | ||
| CHAIN_ID: "poktroll" | ||
| # db schema name | ||
| DB_SCHEMA: "testnet" | ||
|
|
||
| START_BLOCK: 1 | ||
| # Check docs to see what else you can set here: | ||
| # Ref: https://academy.subquery.network/indexer/run_publish/references.html#subql-cli | ||
| SUBQUERY_NODE_EXTRA_PARAMS: "--unfinalized-blocks=true" | ||
| # Check docs to see what else you can set here: | ||
| # Ref: https://academy.subquery.network/indexer/run_publish/references.html#subql-query | ||
| SUBQUERY_GRAPHQL_EXTRA_PARAMS: "" | ||
|
|
||
| DB_HOST: postgres-service | ||
| DB_PORT: 5432 | ||
| DB_USER: postgres | ||
| DB_PASS: postgres | ||
| DB_DATABASE: postgres |
This file contains hidden or 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,50 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: gql-engine-deployment | ||
| labels: | ||
| app.kubernetes.io/name: gql-engine | ||
| app.kubernetes.io/part-of: pocketdex | ||
| app.kubernetes.io/managed-by: helm | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: gql-engine | ||
| app.kubernetes.io/part-of: pocketdex | ||
| app.kubernetes.io/managed-by: helm | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app.kubernetes.io/name: gql-engine | ||
| app.kubernetes.io/part-of: pocketdex | ||
| app.kubernetes.io/managed-by: helm | ||
| spec: | ||
| initContainers: | ||
| - name: wait-for-indexer | ||
| image: busybox | ||
| command: [ 'sh', '-c', 'until nc -z indexer-service 3000; do echo waiting for indexer; sleep 2; done;' ] | ||
| containers: | ||
| - name: gql-engine | ||
| image: subquerynetwork/subql-query:latest | ||
| command: | ||
| - /sbin/tini | ||
| - -- | ||
| - /bin/run | ||
| - -f | ||
| - /app | ||
| - --name={{ .Values.env.DB_SCHEMA }} | ||
| - --indexer={{ .Values.indexer_endpoint }} | ||
| - --port={{ .Values.port }} | ||
| {{- if .Values.enable_graphiql_playground }} | ||
| - --playground | ||
| {{- end }} | ||
| ports: | ||
| - containerPort: {{ .Values.port }} | ||
| env: | ||
| {{- if .Values.env }} | ||
| {{- range $key, $value := .Values.env }} | ||
| - name: {{ $key | quote }} | ||
| value: {{ $value | quote }} | ||
| {{- end }} | ||
| {{- end }} |
This file contains hidden or 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,15 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: gql-engine-service | ||
| spec: | ||
| selector: | ||
| app.kubernetes.io/name: gql-engine | ||
| app.kubernetes.io/part-of: pocketdex | ||
| app.kubernetes.io/managed-by: helm | ||
| ports: | ||
| - name: http | ||
| protocol: TCP | ||
| port: 3000 | ||
| targetPort: 3000 | ||
| type: ClusterIP | ||
This file contains hidden or 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,23 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *.orig | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj | ||
| .vscode/ |
This file contains hidden or 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,24 @@ | ||
| apiVersion: v2 | ||
| name: indexer | ||
| description: SubQuery Indexer Node for Pocketdex | ||
|
|
||
| # A chart can be either an 'application' or a 'library' chart. | ||
| # | ||
| # Application charts are a collection of templates that can be packaged into versioned archives | ||
| # to be deployed. | ||
| # | ||
| # Library charts provide useful utilities or functions for the chart developer. They're included as | ||
| # a dependency of application charts to inject those utilities and functions into the rendering | ||
| # pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
| type: application | ||
|
|
||
| # This is the chart version. This version number should be incremented each time you make changes | ||
| # to the chart and its templates, including the app version. | ||
| # Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
| version: 0.1.0 | ||
|
|
||
| # This is the version number of the application being deployed. This version number should be | ||
| # incremented each time you make changes to the application. Versions are not expected to | ||
| # follow Semantic Versioning. They should reflect the version the application is using. | ||
| # It is recommended to use it with quotes. | ||
| appVersion: "1.16.0" |
This file contains hidden or 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,23 @@ | ||
| env: | ||
| NODE_ENV: development | ||
| # LocalNet | ||
| ENDPOINT: "http://validator-poktroll-validator.default.svc.cluster.local:26657" | ||
| CHAIN_ID: "poktroll" | ||
| # db schema name | ||
| DB_SCHEMA: "localnet" | ||
| # indexer endpoint | ||
| indexer_endpoint: "http://pocketdex-indexer.default.svc.cluster.local:3000" | ||
|
|
||
| START_BLOCK: 1 | ||
| # Check docs to see what else you can set here: | ||
| # Ref: https://academy.subquery.network/indexer/run_publish/references.html#subql-cli | ||
| SUBQUERY_NODE_EXTRA_PARAMS: "--unfinalized-blocks=true" | ||
| # Check docs to see what else you can set here: | ||
| # Ref: https://academy.subquery.network/indexer/run_publish/references.html#subql-query | ||
| SUBQUERY_GRAPHQL_EXTRA_PARAMS: "" | ||
|
|
||
| DB_HOST: postgres-service | ||
| DB_PORT: 5432 | ||
| DB_USER: postgres | ||
| DB_PASS: postgres | ||
| DB_DATABASE: postgres |
This file contains hidden or 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,22 @@ | ||
| port: 3000 | ||
| env: | ||
| NODE_ENV: development | ||
| # Testnet | ||
| ENDPOINT: "https://testnet-validated-validator-rpc.poktroll.com" | ||
| CHAIN_ID: "poktroll" | ||
| # db schema name | ||
| DB_SCHEMA: "testnet" | ||
|
|
||
| START_BLOCK: 1 | ||
| # Check docs to see what else you can set here: | ||
| # Ref: https://academy.subquery.network/indexer/run_publish/references.html#subql-cli | ||
| SUBQUERY_NODE_EXTRA_PARAMS: "--unfinalized-blocks=true" | ||
| # Check docs to see what else you can set here: | ||
| # Ref: https://academy.subquery.network/indexer/run_publish/references.html#subql-query | ||
| SUBQUERY_GRAPHQL_EXTRA_PARAMS: "" | ||
|
|
||
| DB_HOST: postgres-service | ||
| DB_PORT: 5432 | ||
| DB_USER: postgres | ||
| DB_PASS: postgres | ||
| DB_DATABASE: postgres |
This file contains hidden or 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,42 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: indexer-deployment | ||
| labels: | ||
| app.kubernetes.io/name: indexer | ||
| app.kubernetes.io/part-of: pocketdex | ||
| app.kubernetes.io/managed-by: helm | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: indexer | ||
| app.kubernetes.io/part-of: pocketdex | ||
| app.kubernetes.io/managed-by: helm | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app.kubernetes.io/name: indexer | ||
| app.kubernetes.io/part-of: pocketdex | ||
| app.kubernetes.io/managed-by: helm | ||
| spec: | ||
| containers: | ||
| - name: indexer | ||
| image: indexer | ||
| readinessProbe: | ||
| initialDelaySeconds: 30 | ||
| httpGet: | ||
| port: {{ .Values.port }} | ||
| path: "/ready" | ||
| livenessProbe: | ||
| initialDelaySeconds: 60 | ||
| httpGet: | ||
| port: {{ .Values.port }} | ||
| path: "/health" | ||
| env: | ||
| {{- if .Values.env }} | ||
| {{- range $key, $value := .Values.env }} | ||
| - name: {{ $key | quote }} | ||
| value: {{ $value | quote }} | ||
| {{- end }} | ||
| {{- end }} |
This file contains hidden or 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,15 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: indexer-service | ||
| spec: | ||
| selector: | ||
| app.kubernetes.io/name: indexer | ||
| app.kubernetes.io/part-of: pocketdex | ||
| app.kubernetes.io/managed-by: helm | ||
| ports: | ||
| - name: http | ||
| protocol: TCP | ||
| port: {{ .Values.port }} | ||
| targetPort: {{ .Values.port }} | ||
| type: ClusterIP |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.