Skip to content

Commit

Permalink
Merge pull request #140 from Synthetixio/feat/disable-services
Browse files Browse the repository at this point in the history
V2 - Disable Services
  • Loading branch information
Tburm authored Nov 14, 2024
2 parents 6e2bf2a + 8b62d56 commit 6c0b1d2
Show file tree
Hide file tree
Showing 133 changed files with 11 additions and 286,710 deletions.
21 changes: 2 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@ export

.PHONY: build wrap dbt

DB_NAME ?= base_sepolia
CONTAINER_NAME ?= data-db-1

# Target to recreate the database
recreate-db:
docker exec -it $(CONTAINER_NAME) /bin/bash -c "PGPASSWORD=${PG_PASSWORD} psql -U postgres -c 'DROP DATABASE IF EXISTS $(DB_NAME);'"
docker exec -it $(CONTAINER_NAME) /bin/bash -c "PGPASSWORD=${PG_PASSWORD} psql -U postgres -c 'CREATE DATABASE $(DB_NAME);'"

reset-pw:
docker exec -it $(CONTAINER_NAME) /bin/bash -c "PGPASSWORD=$(PG_PASSWORD) psql -U postgres -c 'ALTER USER analytics WITH PASSWORD '\''$(READONLY_PASSWORD)'\'';'"

build:
docker compose build transformer

Expand All @@ -25,18 +14,12 @@ extract:
docker compose run extractors python main.py configs/arbitrum_sepolia.yaml

index:
docker compose run indexers-v2 --network_name base_mainnet --config_name synthetix-v3
docker compose run indexers-v2 --network_name arbitrum_mainnet --config_name synthetix-v3
docker compose run indexer --network_name base_mainnet --config_name synthetix-v3
docker compose run indexer --network_name arbitrum_mainnet --config_name synthetix-v3

synths:
docker compose run transformer python scripts/get_synths.py

wrap:
docker compose run transformer python scripts/wrap_tables.py

import:
docker compose run transformer python scripts/import_parquet.py

dbt: build
docker compose run transformer dbt run --target prod --profiles-dir profiles --profile synthetix

Expand Down
160 changes: 5 additions & 155 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
services:
db:
image: ghcr.io/synthetixio/data/postgres:${VERSION}
build:
context: ./postgres
dockerfile: Dockerfile
restart: always
networks:
- data
Expand All @@ -15,23 +12,18 @@ services:
POSTGRES_MAINTENANCE_WORK_MEM: "1GB"
POSTGRES_EFFECTIVE_CACHE_SIZE: "8GB"
volumes:
- ./postgres/initdb:/docker-entrypoint-initdb.d
- ./postgres-data:/var/lib/postgresql/data
- ./parquet-data:/parquet-data
ports:
- "${DB_PORT}:5432"
deploy:
resources:
limits:
cpus: "4.0"
memory: 8192M
shm_size: 4gb
tmpfs:
- /dev/shm:size=4g

indexer-v2:

indexer:
build:
context: ./indexers-v2
context: ./indexers
dockerfile: Dockerfile
networks:
- data
Expand All @@ -44,154 +36,12 @@ services:
volumes:
- ./parquet-data:/parquet-data

eth-mainnet-processor:
image: ghcr.io/synthetixio/data/indexer:${VERSION}-mainnet
build:
context: ./indexers/eth-mainnet
networks:
- data
depends_on:
- db
restart: always
environment:
DB_HOST: db
DB_PORT: 5432
DB_NAME: eth_mainnet
DB_PASS: $PG_PASSWORD
GQL_PORT: 4350
RPC_ENDPOINT: https://ethereum-rpc.publicnode.com

base-mainnet-processor:
image: ghcr.io/synthetixio/data/indexer:${VERSION}-base-mainnet
build:
context: ./indexers/base-mainnet
networks:
- data
depends_on:
- db
restart: always
environment:
DB_HOST: db
DB_PORT: 5432
DB_NAME: base_mainnet
DB_PASS: $PG_PASSWORD
GQL_PORT: 4350
RPC_ENDPOINT: https://mainnet.base.org

base-sepolia-processor:
image: ghcr.io/synthetixio/data/indexer:${VERSION}-base-sepolia
build:
context: ./indexers/base-sepolia
networks:
- data
depends_on:
- db
restart: always
environment:
DB_HOST: db
DB_PORT: 5432
DB_NAME: base_sepolia
DB_PASS: $PG_PASSWORD
GQL_PORT: 4350
RPC_ENDPOINT: https://sepolia.base.org

arbitrum-sepolia-processor:
image: ghcr.io/synthetixio/data/indexer:${VERSION}-arbitrum-sepolia
build:
context: ./indexers/arbitrum-sepolia
networks:
- data
depends_on:
- db
restart: always
environment:
DB_HOST: db
DB_PORT: 5432
DB_NAME: arbitrum_sepolia
DB_PASS: $PG_PASSWORD
GQL_PORT: 4350
RPC_ENDPOINT: https://sepolia-rollup.arbitrum.io/rpc

arbitrum-mainnet-processor:
image: ghcr.io/synthetixio/data/indexer:${VERSION}-arbitrum-mainnet
build:
context: ./indexers/arbitrum-mainnet
networks:
- data
depends_on:
- db
restart: always
environment:
DB_HOST: db
DB_PORT: 5432
DB_NAME: arbitrum_mainnet
DB_PASS: $PG_PASSWORD
GQL_PORT: 4350
RPC_ENDPOINT: wss://arbitrum-one-rpc.publicnode.com

optimism-mainnet-processor:
image: ghcr.io/synthetixio/data/indexer:${VERSION}-optimism-mainnet
build:
context: ./indexers/optimism-mainnet
networks:
- data
depends_on:
- db
restart: always
environment:
DB_HOST: db
DB_PORT: 5432
DB_NAME: optimism_mainnet
DB_PASS: $PG_PASSWORD
GQL_PORT: 4350
RPC_ENDPOINT: https://mainnet.optimism.io

snax-testnet-processor:
image: ghcr.io/synthetixio/data/indexer:${VERSION}-snax-testnet
build:
context: ./indexers/snax-testnet
networks:
- data
depends_on:
- db
restart: always
environment:
DB_HOST: db
DB_PORT: 5432
DB_NAME: snax_testnet
DB_PASS: $PG_PASSWORD
GQL_PORT: 4350
RPC_ENDPOINT: https://testnet.snaxchain.io/
API_KEY: $CONDUIT_API_KEY

snax-mainnet-processor:
image: ghcr.io/synthetixio/data/indexer:${VERSION}-snax-mainnet
build:
context: ./indexers/snax-mainnet
networks:
- data
depends_on:
- db
restart: always
environment:
DB_HOST: db
DB_PORT: 5432
DB_NAME: snax_mainnet
DB_PASS: $PG_PASSWORD
GQL_PORT: 4350
RPC_ENDPOINT: https://mainnet.snaxchain.io/
API_KEY: $CONDUIT_API_KEY

transformer:
image: ghcr.io/synthetixio/data/transformer:${VERSION}
build:
context: ./transformers
depends_on:
- db
env_file:
- .env
environment:
PG_PASSWORD: $PG_PASSWORD
volumes:
- ./parquet-data:/parquet-data
- ./transformers/synthetix:/app/synthetix
Expand All @@ -215,10 +65,10 @@ services:
restart: always
networks:
- data
depends_on:
- db
env_file:
- .env
depends_on:
- db
environment:
AIRFLOW__CORE__EXECUTOR: LocalExecutor
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://postgres:$PG_PASSWORD@db:5432/postgres
Expand Down
File renamed without changes.
25 changes: 0 additions & 25 deletions indexers/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions indexers/arbitrum-mainnet/.dockerignore

This file was deleted.

15 changes: 0 additions & 15 deletions indexers/arbitrum-mainnet/Dockerfile

This file was deleted.

Loading

0 comments on commit 6c0b1d2

Please sign in to comment.