Skip to content

Commit

Permalink
fix: bring prod infra up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
carlomazzaferro committed Oct 31, 2023
1 parent 87e89a3 commit 0ab5de8
Show file tree
Hide file tree
Showing 43 changed files with 1,562 additions and 419 deletions.
61 changes: 42 additions & 19 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
run: yarn workspace @connext/smart-contracts forge:install

- name: Yarn build
run: yarn build
run: yarn build:all

- name: Install DBMate
run: sudo curl -fsSL -o /usr/local/bin/dbmate https://github.com/amacneil/dbmate/releases/latest/download/dbmate-linux-amd64 && sudo chmod +x /usr/local/bin/dbmate
Expand Down Expand Up @@ -535,7 +535,7 @@ jobs:
runs-on: ubuntu-latest
env:
REGISTRY: 679752396206.dkr.ecr.us-east-1.amazonaws.com
IMAGE_TAG: ${{ github.sha }}
IMAGE_TAG: ${{ github.ref_name }}-${{ github.sha }}
REPOSITORY: nxtp-cartographer

steps:
Expand Down Expand Up @@ -579,7 +579,7 @@ jobs:
runs-on: ubuntu-latest
env:
REGISTRY: 679752396206.dkr.ecr.us-east-1.amazonaws.com
IMAGE_TAG: ${{ github.sha }}
IMAGE_TAG: ${{ github.ref_name }}-${{ github.sha }}
REPOSITORY: nxtp-lighthouse

steps:
Expand Down Expand Up @@ -833,21 +833,45 @@ jobs:
SEQUENCER_SERVER_IMAGE: ${{ fromJSON(needs.build-and-push-sequencer-server-image.outputs.json).tags[0] }}
SEQUENCER_PUBLISHER_IMAGE: ${{ fromJSON(needs.build-and-push-sequencer-publisher-image.outputs.json).tags[0] }}
SEQUENCER_SUBSCRIBER_IMAGE: ${{ fromJSON(needs.build-and-push-sequencer-subscriber-image.outputs.json).tags[0] }}
CARTOGRAPHER_IMAGE: ghcr.io/connext/cartographer:${{ github.sha }}
LIGHTHOUSE_IMAGE: ghcr.io/connext/lighthouse:${{ github.sha }}
CARTOGRAPHER_IMAGE: ghcr.io/connext/cartographer:${{ github.ref_name }}-${{ github.sha }}
LIGHTHOUSE_IMAGE: ghcr.io/connext/lighthouse:${{ github.ref_name }}-${{ github.sha }}
LIGHTHOUSE_PROVER_SUBSCRIBER_IMAGE: ${{ fromJSON(needs.build-and-push-lighthouse-prover-subscriber-image.outputs.json).tags[0] }}
RELAYER_IMAGE: ${{ fromJSON(needs.build-and-push-relayer-image.outputs.json).tags[0] }}
WATCHER_IMAGE: ${{ fromJSON(needs.build-and-push-watcher-image.outputs.json).tags[0] }}
SDK_SERVER_IMAGE: ${{ fromJSON(needs.build-and-push-sdk-server-image.outputs.json).tags[0] }}
WEB3_SIGNER_PRIVATE_KEY_ROUTER: "0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3"
WEB3_SIGNER_PRIVATE_KEY_ROUTER: "0xc88b703fb08cbea894b6aeff5a544fb92e78a18e19814cd85da83b71f772aa6c"
WEB3_SIGNER_PRIVATE_KEY_SEQUENCER: "0xae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f"
WEB3_SIGNER_PRIVATE_KEY_RELAYER: "0x09ac2359ab897a5ffc47d7c67df32abbf9c006e00fa2ba36580e0cecc58834fe"
WEB3_SIGNER_PRIVATE_KEY_WATCHER: "0x09ac2359ab897a5ffc47d7c67df32abbf9c006e00fa2ba36580e0cecc58834fe"
WEB3_SIGNER_PRIVATE_KEY_RELAYER: "0x0dbbe8e4ae425a6d2687f1a7e3ba17bc98c673636790f1b8ad91193c05875ef1"
WEB3_SIGNER_PRIVATE_KEY_WATCHER: "0x0dbbe8e4ae425a6d2687f1a7e3ba17bc98c673636790f1b8ad91193c05875ef1"
MNEMONIC: "candy maple cake sugar pudding cream honey rich smooth crumble sweet treat"
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Checkout repository
uses: actions/checkout@v3

- name: config setup
run: |
config_dir_paths=("docker/cartographer" "docker/lighthouse" "docker/router" "docker/sequencer" "docker/relayer" "docker/watcher")
for dir_path in "${config_dir_paths[@]}"; do
file_path="$dir_path/config.local.json"
file_target_path="$dir_path/config.json"
cp "$file_path" "$file_target_path"
done
- name: run smoke tests
run: |
docker-compose -f docker-compose.services.yaml -f docker-compose.chains.yaml up -d
Expand Down Expand Up @@ -895,15 +919,14 @@ jobs:
SEQUENCER_SERVER_IMAGE: ${{ fromJSON(needs.build-and-push-sequencer-server-image.outputs.json).tags[0] }}
SEQUENCER_PUBLISHER_IMAGE: ${{ fromJSON(needs.build-and-push-sequencer-publisher-image.outputs.json).tags[0] }}
SEQUENCER_SUBSCRIBER_IMAGE: ${{ fromJSON(needs.build-and-push-sequencer-subscriber-image.outputs.json).tags[0] }}
LIGHTHOUSE_IMAGE: ghcr.io/connext/lighthouse:${{ github.sha }}
LIGHTHOUSE_IMAGE: ghcr.io/connext/lighthouse:${{ github.ref_name }}-${{ github.sha }}
LIGHTHOUSE_PROVER_SUBSCRIBER_IMAGE: ${{ fromJSON(needs.build-and-push-lighthouse-prover-subscriber-image.outputs.json).tags[0] }}
RELAYER_IMAGE: ${{ fromJSON(needs.build-and-push-relayer-image.outputs.json).tags[0] }}
WATCHER_IMAGE: ${{ fromJSON(needs.build-and-push-watcher-image.outputs.json).tags[0] }}
WEB3_SIGNER_PRIVATE_KEY_ROUTER: "0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3"
WEB3_SIGNER_PRIVATE_KEY_ROUTER: "0xc88b703fb08cbea894b6aeff5a544fb92e78a18e19814cd85da83b71f772aa6c"
WEB3_SIGNER_PRIVATE_KEY_SEQUENCER: "0xae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f"
WEB3_SIGNER_PRIVATE_KEY_RELAYER: "0x0dbbe8e4ae425a6d2687f1a7e3ba17bc98c673636790f1b8ad91193c05875ef1"
MNEMONIC: "candy maple cake sugar pudding cream honey rich smooth crumble sweet treat"
GRAPH_1337_ENDPOINT: "http://localhost:8010/subgraphs/name/connext/nxtp"
GRAPH_1338_ENDPOINT: "http://localhost:9010/subgraphs/name/connext/nxtp"

steps:
- name: Checkout repository
Expand All @@ -918,7 +941,7 @@ jobs:
run: yarn install

- name: Yarn build
run: yarn build
run: yarn build:all

# TODO ADD THIS BACK IN
# - name: Integration Tests
Expand Down Expand Up @@ -978,7 +1001,7 @@ jobs:
needs: [smoke-tests, terraform-infra]
env:
AWS_PROFILE: aws-deployer-connext
TF_VAR_cartographer_image_tag: ${{ github.sha }}
TF_VAR_cartographer_image_tag: ${{ github.ref_name }}-${{ github.sha }}
TF_VAR_full_image_name_sdk_server: ${{ fromJSON(needs.smoke-tests.outputs.sdk-server-tags).tags[0] }}

runs-on: ubuntu-latest
Expand Down Expand Up @@ -1043,7 +1066,7 @@ jobs:
TF_VAR_full_image_name_watcher: ${{ fromJSON(needs.smoke-tests.outputs.watcher-tags).tags[0] }}
TF_VAR_full_image_name_relayer: ${{ fromJSON(needs.smoke-tests.outputs.relayer-tags).tags[0] }}
TF_VAR_full_image_name_lighthouse_prover_subscriber: ${{ fromJSON(needs.smoke-tests.outputs.lighthouse-prover-subscriber-tags).tags[0] }}
TF_VAR_lighthouse_image_tag: ${{ github.sha }}
TF_VAR_lighthouse_image_tag: ${{ github.ref_name }}-${{ github.sha }}

runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -1118,7 +1141,7 @@ jobs:
TF_VAR_full_image_name_relayer: ${{ fromJSON(needs.e2e-tests.outputs.relayer-tags).tags[0] }}
TF_VAR_full_image_name_watcher: ${{ fromJSON(needs.e2e-tests.outputs.watcher-tags).tags[0] }}
TF_VAR_full_image_name_lighthouse_prover_subscriber: ${{ fromJSON(needs.e2e-tests.outputs.lighthouse-prover-subscriber-tags).tags[0] }}
TF_VAR_lighthouse_image_tag: ${{ github.sha }}
TF_VAR_lighthouse_image_tag: ${{ github.ref_name }}-${{ github.sha }}

runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -1184,7 +1207,7 @@ jobs:
needs: [e2e-tests]
env:
AWS_PROFILE: aws-deployer-connext
TF_VAR_cartographer_image_tag: ${{ github.sha }}
TF_VAR_cartographer_image_tag: ${{ github.ref_name }}-${{ github.sha }}
TF_VAR_full_image_name_sdk_server: ${{ fromJSON(needs.e2e-tests.outputs.sdk-server-tags).tags[0] }}

runs-on: ubuntu-latest
Expand Down Expand Up @@ -1252,7 +1275,7 @@ jobs:
needs: [terraform-services-core-prod-testnet, terraform-services-backend-prod-testnet]
env:
AWS_PROFILE: aws-deployer-connext
TF_VAR_cartographer_image_tag: ${{ github.sha }}
TF_VAR_cartographer_image_tag: ${{ github.ref_name }}-${{ github.sha }}
TF_VAR_full_image_name_sdk_server: ${{ fromJSON(needs.terraform-services-backend-prod-testnet.outputs.sdk-server-tags).tags[0] }}

runs-on: ubuntu-latest
Expand Down Expand Up @@ -1317,7 +1340,7 @@ jobs:
TF_VAR_full_image_name_relayer: ${{ fromJSON(needs.terraform-services-backend-prod-testnet.outputs.relayer-tags).tags[0] }}
TF_VAR_full_image_name_watcher: ${{ fromJSON(needs.terraform-services-backend-prod-testnet.outputs.watcher-tags).tags[0] }}
TF_VAR_full_image_name_lighthouse_prover_subscriber: ${{ fromJSON(needs.terraform-services-backend-prod-testnet.outputs.lighthouse-prover-subscriber-tags).tags[0] }}
TF_VAR_lighthouse_image_tag: ${{ github.sha }}
TF_VAR_lighthouse_image_tag: ${{ github.ref_name }}-${{ github.sha }}

runs-on: ubuntu-latest
permissions:
Expand Down
11 changes: 8 additions & 3 deletions build-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ yarn
yarn build:all
echo "Build done."

#For M* macs set the default platform to linux/amd64
# export DOCKER_DEFAULT_PLATFORM=linux/amd64

echo "Docker: building sequencer-server, sequencer-publisher and sequencer-subscriber images..."
docker build --tag sequencer-server:latest --file ./docker/sequencer/server/Dockerfile .
docker build --tag sequencer-publisher:latest --file ./docker/sequencer/publisher/Dockerfile .
Expand All @@ -18,11 +21,13 @@ echo "Docker: building relayer image..."
docker build --tag relayer:latest --file ./docker/relayer/Dockerfile .

echo "Docker: building lighthouse image..."
docker build --tag lighthouse:latest --file ./docker/lighthouse/Dockerfile .
docker build --tag lighthouse:latest --file docker/lighthouse/subscriber/Dockerfile .

echo "Docker: building cartographer-transfers and cartographer-routers images..."
docker build --tag cartographer-transfers:latest --file ./docker/cartographer/transfers/Dockerfile .
docker build --tag cartographer-routers:latest --file ./docker/cartographer/routers/Dockerfile .
docker build --tag cartographer:latest --file ./docker/cartographer/poller/Dockerfile .

echo "Docker: building db image..."
docker build --tag db:latest --file ./docker/db/Dockerfile .

echo "Docker: building anvil chain image..."
docker build --tag anvil:latest --file ./docker/anvil/Dockerfile .
93 changes: 68 additions & 25 deletions docker-compose.chains.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
version: "3.3"

services:
chain-1337:
local-mainnet:
environment:
- MNEMONIC=$MNEMONIC
- CHAIN_ID=1337
container_name: chain-1337-test
image: ghcr.io/connext/chain:latest
- CHAIN_ID=31337
- PORT=8545
container_name: anvil-31337
image: ghcr.io/connext/anvil:latest
ports:
- "8547:8545"
chain-1338:

local-optimism:
environment:
- MNEMONIC=$MNEMONIC
- CHAIN_ID=31338
- PORT=8545
container_name: anvil-31338
image: ghcr.io/connext/anvil:latest
ports:
- "8548:8545"

local-arbitrum:
environment:
- MNEMONIC=$MNEMONIC
- CHAIN_ID=1338
container_name: chain-1338-test
image: ghcr.io/connext/chain:latest
- CHAIN_ID=31339
- PORT=8545
container_name: anvil-31339
image: ghcr.io/connext/anvil:latest
ports:
- "8546:8545"
- "8549:8545"

graph-node-1337:
container_name: graph-node-1337-test
graph-node-local-hub-mainnet:
container_name: graph-node-local-hub-mainnet
image: graphprotocol/graph-node:992121b
ports:
- "8010:8000"
Expand All @@ -29,19 +42,18 @@ services:
- "8040:8040"
depends_on:
- ipfs
- postgres-1337
- chain-1337
- postgres-local-hub-mainnet
environment:
postgres_host: postgres-1337
postgres_host: postgres-local-hub-mainnet
postgres_user: graph-node
postgres_pass: let-me-in
postgres_db: graph-node
ipfs: "ipfs:5001"
ethereum: "mainnet:http://chain-1337:8545"
ethereum: "mainnet:http://local-mainnet:8545"
GRAPH_LOG: info

postgres-1337:
container_name: postgres-1337-test
postgres-local-hub-mainnet:
container_name: postgres-local-hub-mainnet
image: postgres
ports:
- "5432:5432"
Expand All @@ -51,8 +63,8 @@ services:
POSTGRES_PASSWORD: let-me-in
POSTGRES_DB: graph-node

graph-node-1338:
container_name: graph-node-1338-test
graph-node-local-spoke-optimism:
container_name: graph-node-local-spoke-optimism
image: graphprotocol/graph-node:992121b
ports:
- "9010:8000"
Expand All @@ -62,19 +74,18 @@ services:
- "9040:8040"
depends_on:
- ipfs
- postgres-1338
- chain-1338
- postgres-local-spoke-optimism
environment:
postgres_host: postgres-1338
postgres_host: postgres-local-spoke-optimism
postgres_user: graph-node
postgres_pass: let-me-in
postgres_db: graph-node
ipfs: "ipfs:5001"
ethereum: "mainnet:http://chain-1338:8545"
ethereum: "optimism:http://local-optimism:8545"
GRAPH_LOG: info

postgres-1338:
container_name: postgres-1338-test
postgres-local-spoke-optimism:
container_name: postgres-local-spoke-optimism
image: postgres
ports:
- "5433:5432"
Expand All @@ -84,6 +95,38 @@ services:
POSTGRES_PASSWORD: let-me-in
POSTGRES_DB: graph-node

graph-node-local-spoke-arbitrum:
container_name: graph-node-local-spoke-arbitrum
image: graphprotocol/graph-node:992121b
ports:
- "7010:8000"
- "7001:8001"
- "7020:8020"
- "7030:8030"
- "7040:8040"
depends_on:
- ipfs
- postgres-local-spoke-arbitrum
environment:
postgres_host: postgres-local-spoke-arbitrum
postgres_user: graph-node
postgres_pass: let-me-in
postgres_db: graph-node
ipfs: "ipfs:5001"
ethereum: "arbitrum:http://local-arbitrum:8545"
GRAPH_LOG: info

postgres-local-spoke-arbitrum:
container_name: postgres-local-spoke-arbitrum
image: postgres
ports:
- "5434:5432"
command: ["postgres", "-cshared_preload_libraries=pg_stat_statements"]
environment:
POSTGRES_USER: graph-node
POSTGRES_PASSWORD: let-me-in
POSTGRES_DB: graph-node

ipfs:
container_name: ipfs-test
image: ipfs/go-ipfs:v0.4.23
Expand Down
Loading

0 comments on commit 0ab5de8

Please sign in to comment.