Skip to content

Commit 1c2eff8

Browse files
committed
ci: simplify prod-sim package scripts
1 parent a0d2b2c commit 1c2eff8

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
--health-retries 5
1919
ports:
2020
- 5432:5432
21-
2221
steps:
2322
- name: Check out repository code
2423
uses: actions/checkout@v3
@@ -28,7 +27,7 @@ jobs:
2827
uses: actions/setup-node@v3
2928
with:
3029
node-version: '18'
31-
- run: yarn install --immutable --immutable-cache --check-cache
30+
- run: yarn install --immutable --immutable-cache
3231
- run: yarn test
3332
- run: yarn cov:lcov
3433
- name: Upload test coverage
@@ -41,3 +40,16 @@ jobs:
4140
with:
4241
name: e2e-test-log
4342
path: data/chaingraph/log-e2e.ndjson
43+
44+
check-yarn-cache:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Check out repository code
48+
uses: actions/checkout@v3
49+
with:
50+
submodules: 'true'
51+
- name: Install Node.js
52+
uses: actions/setup-node@v3
53+
with:
54+
node-version: '18'
55+
- run: yarn install --immutable --immutable-cache --check-cache

charts/chaingraph/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ agent:
88
# Manage the Chaingraph agent from this chart.
99
enable: true
1010
# The precise Chaingraph Agent Docker image to use.
11-
image: chaingraph/agent@sha256:6df5c4f93511e6734aa502260ca236a113fe366b220eb433ccfaec79ee3c6ab2 # e9c37a6
11+
image: chaingraph/agent@sha256:529ed271617ae9089736555e337dfa07a813bf25d1437ee3dc9d9242fa2ea65e # a0d2b2c
1212
# A list of trusted external nodes to which this Chaingraph instance should connect. If specified, this list will be appended to the list of trusted nodes which are managed by this Chaingraph chart.
1313
# This must be specified using the same format as `CHAINGRAPH_TRUSTED_NODES`, e.g. `bchn:127.0.0.1:8333:mainnet,bchd:127.0.0.1:8334:testnet,another:127.0.0.1:8335:e3e1f3e8`
1414
externalNodes: ''
@@ -38,7 +38,7 @@ bitcoinCashNode:
3838
# Enable a local Bitcoin Cash Node.
3939
enable: false
4040
# The precise Bitcoin Cash Node Docker image to use.
41-
image: chaingraph/bitcoin-cash-node@sha256:128b0219ea9f6b26a9688adabd792a859c628ff8571cc2740e7fb6295c442b99 # v25.0.0
41+
image: chaingraph/bitcoin-cash-node@sha256:133f1ac65126e2637ee544e1190a293c880f035f18042c25e2f1369be30f57b8 # v26.0.0
4242
# The size of the volume to provision for Bitcoin Cash Node.
4343
volumeSize: 210Gi
4444

@@ -95,7 +95,7 @@ hasura:
9595
# Enable a local Hasura deployment. Disable this to either manage Hasura manually or use Hasura Cloud.
9696
enable: true
9797
# The precise Hasura Docker image to use.
98-
image: chaingraph/hasura@sha256:eadb66a65677b872aad06266e4eddd307a89069cba455c3e0ed6bcb176eccf64 # 8757ea1
98+
image: chaingraph/hasura@sha256:12380cc4e8845e5e48f69141e379d971e4282682894d4f579b21a3b0eb5d4687 # 3ebddce
9999
# A secret key used to secure admin access in Hasura. If not provided, a random secret will be generated and stored in the cluster.
100100
adminSecretKey: ''
101101
# Enable the console served by Hasura. (Not recommended; use Hasura CLI's `hasura console` instead.)

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"dev-cluster:init:base": "yarn dev-cluster:create && yarn image:build:hasura && yarn dev-cluster:images:load:hasura",
1414
"dev-cluster:init:local": "yarn dev-cluster:init:base && yarn dev-cluster:upgrade:local",
1515
"dev-cluster:init:local-node": "yarn dev-cluster:init:base && yarn dev-cluster:upgrade:local-node",
16-
"dev-cluster:init:prod-sim": "yarn dev-cluster:init:base && yarn image:build:agent && yarn dev-cluster:images:load:agent && yarn image:build:bchn && yarn dev-cluster:images:load:bchn && yarn dev-cluster:upgrade:prod-sim",
16+
"dev-cluster:init:prod-sim": "yarn dev-cluster:init:base && echo '\n\nNote: skipping local build of BCHN; if you need to test building your own, try:\nyarn image:build:bchn && yarn dev-cluster:images:load:bchn \n\n' && yarn image:build:agent && yarn dev-cluster:images:load:agent && yarn dev-cluster:upgrade:prod-sim",
17+
"dev-cluster:init:prod-sim:random-password": "yarn dev-cluster:init:prod-sim --set postgres.password='' && echo 'Created a prod-sim cluster with a random postgres password.\n\nNote, the prod-sim reset/destroy package scripts will also cause the cluster's chaingraph-secrets to be deleted, so restoring this postgres database will require that you save the password reported by: \n$ yarn dev-cluster:secret:postgres-password'",
1718
"dev-cluster:start": "k3d cluster start chaingraph-development-cluster",
1819
"dev-cluster:stop": "k3d cluster stop chaingraph-development-cluster",
1920
"dev-cluster:secrets": "kubectl get secret chaingraph-secrets -o go-template='{{range $k,$v := .data}}{{\"### \"}}{{$k}}{{\"\\n\"}}{{$v|base64decode}}{{\"\\n\\n\"}}{{end}}'",
@@ -23,7 +24,7 @@
2324
"dev-cluster:reset": "yarn dev-cluster:destroy && yarn dev-cluster:init",
2425
"dev-cluster:reset:local": "yarn dev-cluster:destroy:local && yarn dev-cluster:init:local",
2526
"dev-cluster:reset:local-node": "yarn dev-cluster:destroy:local-node && yarn dev-cluster:init:local-node",
26-
"dev-cluster:reset:prod-sim": "echo '\n## Note ##\n in prod-sim mode, the dev-cluster can not be fully reset because chaingraph-secrets contains the password configured for Postgres. Instead this script simply shuts down the cluster and attempts to upgrade. To truly sync from scratch, try:\n$ yarn dev-cluster:reset:prod-sim:mv-postgres\n\n' && yarn dev-cluster:destroy:prod-sim && yarn dev-cluster:init:prod-sim",
27+
"dev-cluster:reset:prod-sim": "echo '\n## Note ##\n This command does not reset the database. To truly sync Chaingraph from scratch, try:\n$ yarn dev-cluster:reset:prod-sim:mv-postgres\n\n' && yarn dev-cluster:destroy:prod-sim && yarn dev-cluster:init:prod-sim",
2728
"dev-cluster:reset:prod-sim:mv-postgres": "yarn dev-cluster:destroy:prod-sim && mv data/postgres data/postgres-$(date +%Y%m%d_%H%MZ) && mv data/agent data/agent-$(date +%Y%m%d_%H%MZ) && yarn dev-cluster:init:prod-sim",
2829
"dev-cluster:create": "k3d cluster create chaingraph-development-cluster --servers 1 --agents 2 --port '31933:31933@loadbalancer' --volume $PWD/data:/data --volume $PWD/images/hasura/hasura-data:/hasura",
2930
"dev-cluster:destroy": "yarn dev-cluster:spin-down:bchn:chipnet && yarn dev-cluster:spin-down:bchn:testnet && yarn dev-cluster:spin-down:postgres && echo 'pausing to allow pods to shutdown' && kubectl rollout status statefulset/bitcoin-cash-node-chipnet && kubectl rollout status statefulset/bitcoin-cash-node-testnet && kubectl rollout status statefulset/postgres && k3d cluster delete chaingraph-development-cluster",
@@ -36,9 +37,9 @@
3637
"dev-cluster:images:load:hasura": "k3d image import chaingraph/hasura:dev-build -c chaingraph-development-cluster",
3738
"dev-cluster:images:load:postgres-pldebugger": "k3d image import chaingraph/postgres-pldebugger:latest -c chaingraph-development-cluster",
3839
"dev-cluster:debug-chart": "helm template charts/chaingraph --debug",
39-
"dev-cluster:upgrade:prod-sim": "helm upgrade --install chaingraph-development charts/chaingraph --set useDevelopmentVolumes=true --set bitcoinCashNode.enable=true --set postgres.volumeSize=625Gi --set hasura.image=chaingraph/hasura:dev-build --set agent.image=chaingraph/agent:dev-build --set bitcoinCashNode.image=chaingraph/bitcoin-cash-node:dev-build",
4040
"dev-cluster:upgrade": "helm upgrade --install chaingraph-development charts/chaingraph --set useDevelopmentVolumes=true --set postgres.password=very_insecure_postgres_password --set hasura.image=chaingraph/hasura:dev-build --set agent.enable=false --set hasura.webhookHandlerBaseUrl='http://host.k3d.internal:3200' --set pgAdmin.enable=true --set pgHero.enable=true",
4141
"dev-cluster:upgrade:dry-run": "yarn dev-cluster:upgrade --dry-run",
42+
"dev-cluster:upgrade:prod-sim": "helm upgrade --install chaingraph-development charts/chaingraph --set useDevelopmentVolumes=true --set postgres.password=very_insecure_postgres_password --set pgAdmin.enable=true --set pgHero.enable=true --set bitcoinCashNode.enable=true --set postgres.volumeSize=700Gi --set agent.enable=true --set agent.image=chaingraph/agent:dev-build --set hasura.image=chaingraph/hasura:dev-build",
4243
"dev-cluster:upgrade:enable-pldbgapi": "yarn image:build:postgres-pldebugger && yarn dev-cluster:images:load:postgres-pldebugger && yarn dev-cluster:upgrade --set postgres.image=chaingraph/postgres-pldebugger",
4344
"dev-cluster:upgrade:local-postgres": "yarn dev-cluster:upgrade --set postgres.externalDbUrl=postgres://chaingraph:very_insecure_postgres_password@host.k3d.internal:5432/postgres --set agent.enable=false",
4445
"dev-cluster:upgrade:local-node": "yarn dev-cluster:upgrade --set bitcoinCashNodeTestnet.enable=false --set bitcoinCashNodeChipnet.enable=false --set agent.enable=false",

0 commit comments

Comments
 (0)