Skip to content

Commit

Permalink
Delete indexer code (#1488)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrel-b authored Apr 19, 2024
1 parent f2fc450 commit 7a0c838
Show file tree
Hide file tree
Showing 65 changed files with 158 additions and 5,121 deletions.
38 changes: 0 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ start-dev-sql-proxy : REQUIRED_SOPS_SECRETS := $(SOPS_DEV_SECRETS)
start-prod-sql-proxy : REQUIRED_SOPS_SECRETS := $(SOPS_PROD_SECRETS)
migrate-dev-coredb : REQUIRED_SOPS_SECRETS := $(SOPS_DEV_SECRETS)
migrate-prod-coredb : REQUIRED_SOPS_SECRETS := $(SOPS_PROD_SECRETS)
migrate-prod-indexerdb : REQUIRED_SOPS_SECRETS := $(SOPS_PROD_SECRETS)

# Environment-specific settings
$(DEPLOY)-$(DEV)-% : ENV := $(DEV)
Expand All @@ -71,7 +70,6 @@ $(PROMOTE)-$(PROD)-% : REQUIRED_SOPS_SECRETS := $(SOPS_PROD_SECRET

# Service files, add a line for each service and environment you want to deploy.
$(DEPLOY)-$(DEV)-backend : SERVICE_FILE := backend-env.yaml
$(DEPLOY)-$(DEV)-indexer-server : SERVICE_FILE := indexer-server-env.yaml
$(DEPLOY)-$(DEV)-admin : SERVICE_FILE := app-dev-admin.yaml
$(DEPLOY)-$(DEV)-feed : SERVICE_FILE := feed-env.yaml
$(DEPLOY)-$(DEV)-tokenprocessing : SERVICE_FILE := tokenprocessing-env.yaml
Expand All @@ -87,8 +85,6 @@ $(DEPLOY)-$(DEV)-graphql-gateway : SERVICE_FILE := graphql-gateway.yml
$(DEPLOY)-$(DEV)-userpref-upload : SERVICE_FILE := userpref-upload.yaml
$(DEPLOY)-$(SANDBOX)-backend : SERVICE_FILE := backend-sandbox-env.yaml
$(DEPLOY)-$(PROD)-backend : SERVICE_FILE := backend-env.yaml
$(DEPLOY)-$(PROD)-indexer : SERVICE_FILE := indexer-env.yaml
$(DEPLOY)-$(PROD)-indexer-server : SERVICE_FILE := indexer-server-env.yaml
$(DEPLOY)-$(PROD)-admin : SERVICE_FILE := app-prod-admin.yaml
$(DEPLOY)-$(PROD)-feed : SERVICE_FILE := feed-env.yaml
$(DEPLOY)-$(PROD)-feedbot : SERVICE_FILE := feedbot-env.yaml
Expand All @@ -107,8 +103,6 @@ $(DEPLOY)-$(PROD)-rasterizer : SERVICE_FILE := rasterizer.yaml

# Service to Sentry project mapping
$(DEPLOY)-%-backend : SENTRY_PROJECT := gallery-backend
$(DEPLOY)-%-indexer : SENTRY_PROJECT := indexer
$(DEPLOY)-%-indexer-server : SENTRY_PROJECT := indexer-api
$(DEPLOY)-%-tokenprocessing : SENTRY_PROJECT := tokenprocessing
$(DEPLOY)-%-pushnotifications : SENTRY_PROJECT := pushnotifications
$(DEPLOY)-%-dummymetadata : SENTRY_PROJECT := dummymetadata
Expand Down Expand Up @@ -176,24 +170,6 @@ $(DEPLOY)-%-dummymetadata : CPU := $(DUMMYMETADATA_CPU)
$(DEPLOY)-%-dummymetadata : MEMORY := $(DUMMYMETADATA_MEMORY)
$(DEPLOY)-%-dummymetadata : CONCURRENCY := $(DUMMYMETADATA_CONCURRENCY)
$(DEPLOY)-%-dummymetadata : SERVICE := dummymetadata
$(DEPLOY)-%-indexer-server : REPO := indexer-api
$(DEPLOY)-%-indexer-server : DOCKER_FILE := $(DOCKER_DIR)/indexer_api/Dockerfile
$(DEPLOY)-%-indexer-server : PORT := 6000
$(DEPLOY)-%-indexer-server : TIMEOUT := $(INDEXER_SERVER_TIMEOUT)
$(DEPLOY)-%-indexer-server : CPU := $(INDEXER_SERVER_CPU)
$(DEPLOY)-%-indexer-server : MEMORY := $(INDEXER_SERVER_MEMORY)
$(DEPLOY)-%-indexer-server : CONCURRENCY := $(INDEXER_SERVER_CONCURRENCY)
$(DEPLOY)-$(DEV)-indexer-server : SERVICE := indexer-api-dev
$(DEPLOY)-$(PROD)-indexer-server : SERVICE := indexer-api
$(DEPLOY)-%-indexer : REPO := indexer
$(DEPLOY)-%-indexer : DOCKER_FILE := $(DOCKER_DIR)/indexer/Dockerfile
$(DEPLOY)-%-indexer : PORT := 4000
$(DEPLOY)-%-indexer : TIMEOUT := $(INDEXER_TIMEOUT)
$(DEPLOY)-%-indexer : CPU := $(INDEXER_CPU)
$(DEPLOY)-%-indexer : MEMORY := $(INDEXER_MEMORY)
$(DEPLOY)-%-indexer : CONCURRENCY := $(INDEXER_CONCURRENCY)
$(DEPLOY)-%-indexer : DEPLOY_FLAGS = $(BASE_DEPLOY_FLAGS) --no-cpu-throttling
$(DEPLOY)-$(PROD)-indexer : SERVICE := indexer
$(DEPLOY)-%-emails : REPO := emails
$(DEPLOY)-%-emails : DOCKER_FILE := $(DOCKER_DIR)/emails/Dockerfile
$(DEPLOY)-%-emails : PORT := 5500
Expand Down Expand Up @@ -328,8 +304,6 @@ $(DEPLOY)-%-userpref-upload : DOCKER_FILE := $(DOCKER_DIR)/userpre

# Service name mappings
$(PROMOTE)-%-backend : SERVICE := default
$(PROMOTE)-%-indexer : SERVICE := indexer
$(PROMOTE)-%-indexer-server : SERVICE := indexer-api
$(PROMOTE)-%-emails : SERVICE := emails-v2
$(PROMOTE)-%-tokenprocessing : SERVICE := tokenprocessing
$(PROMOTE)-%-tokenprocessing : SERVICE := tokenprocessing-v3
Expand Down Expand Up @@ -459,7 +433,6 @@ _$(RELEASE)-%:

# DEV deployments
$(DEPLOY)-$(DEV)-backend : _set-project-$(ENV) _$(DOCKER)-$(DEPLOY)-backend _$(RELEASE)-backend
$(DEPLOY)-$(DEV)-indexer-server : _set-project-$(ENV) _$(DOCKER)-$(DEPLOY)-indexer-server _$(RELEASE)-indexer-server
$(DEPLOY)-$(DEV)-tokenprocessing : _set-project-$(ENV) _$(DOCKER)-$(DEPLOY)-tokenprocessing _$(RELEASE)-tokenprocessing
$(DEPLOY)-$(DEV)-autosocial : _set-project-$(ENV) _$(DOCKER)-$(DEPLOY)-autosocial _$(RELEASE)-autosocial
$(DEPLOY)-$(DEV)-autosocial-orch : _set-project-$(ENV) _$(DOCKER)-$(DEPLOY)-autosocial-orch _$(RELEASE)-autosocial-orc
Expand All @@ -485,8 +458,6 @@ $(DEPLOY)-$(SANDBOX)-backend : _set-project-$(ENV) _$(DOCKER)-$(DEPLOY)-bac

# PROD deployments
$(DEPLOY)-$(PROD)-backend : _set-project-$(ENV) _$(DOCKER)-$(DEPLOY)-backend _$(RELEASE)-backend
$(DEPLOY)-$(PROD)-indexer : _set-project-$(ENV) _$(DOCKER)-$(DEPLOY)-indexer _$(RELEASE)-indexer
$(DEPLOY)-$(PROD)-indexer-server : _set-project-$(ENV) _$(DOCKER)-$(DEPLOY)-indexer-server _$(RELEASE)-indexer-server
$(DEPLOY)-$(PROD)-tokenprocessing : _set-project-$(ENV) _$(DOCKER)-$(DEPLOY)-tokenprocessing _$(RELEASE)-tokenprocessing
$(DEPLOY)-$(PROD)-autosocial : _set-project-$(ENV) _$(DOCKER)-$(DEPLOY)-autosocial _$(RELEASE)-autosocial
$(DEPLOY)-$(PROD)-autosocial-orch : _set-project-$(ENV) _$(DOCKER)-$(DEPLOY)-autosocial-orch _$(RELEASE)-autosocial-orch
Expand Down Expand Up @@ -516,8 +487,6 @@ $(DEPLOY)-$(PROD)-rasterizer : _set-project-$(ENV) _$(DOCKER)-$(DE
# $ make promote-prod-backend version=myVersion
#
$(PROMOTE)-$(PROD)-backend : _set-project-$(ENV) _$(DOCKER)-$(PROMOTE)-backend
$(PROMOTE)-$(PROD)-indexer : _set-project-$(ENV) _$(DOCKER)-$(PROMOTE)-indexer
$(PROMOTE)-$(PROD)-indexer-server : _set-project-$(ENV) _$(DOCKER)-$(PROMOTE)-indexer-server
$(PROMOTE)-$(PROD)-tokenprocessing : _set-project-$(ENV) _$(DOCKER)-$(PROMOTE)-tokenprocessing
$(PROMOTE)-$(PROD)-autosocial : _set-project-$(ENV) _$(DOCKER)-$(PROMOTE)-autosocial
$(PROMOTE)-$(PROD)-autosocial-orch : _set-project-$(ENV) _$(DOCKER)-$(PROMOTE)-autosocial-orch
Expand Down Expand Up @@ -618,10 +587,6 @@ start-prod-sql-proxy:
stop-sql-proxy:
docker-compose -f docker/cloud_sql_proxy/docker-compose.yml down

# Migrations
migrate-local-indexerdb:
migrate -path ./db/migrations/indexer -database "postgresql://postgres@localhost:5433/postgres?sslmode=disable" up

migrate-local-coredb:
go run cmd/migrate/main.go

Expand All @@ -645,9 +610,6 @@ migrate-prod-coredb: start-prod-sql-proxy confirm-prod-migrate
POSTGRES_PORT=6543 \
go run cmd/migrate/main.go

migrate-prod-indexerdb: start-prod-sql-proxy confirm-prod-migrate
migrate -path ./db/migrations/indexer -database "postgresql://postgres:$(POSTGRES_INDEXER_PASSWORD)@localhost:6545/postgres?sslmode=disable" up

fix-sops-macs:
@cd secrets; ../scripts/fix-sops-macs.sh

Expand Down
24 changes: 0 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,13 @@ Create a new migration:
```bash
# New migration for the backend db
migrate create -ext sql -dir db/migrations/core -seq <name of migration>

# New migration for the indexer db
migrate create -ext sql -dir db/migrations/indexer -seq <name of migration>
```

Run a migration locally:

```bash
# Run all migrations for the local backend db
make migrate-coredb

# Run all migrations for the local indexer db
make migrate-indexerdb
```

Run a migration on dev backend db:
Expand All @@ -101,16 +95,6 @@ migrate -path db/migrations/core -database "postgresql://postgres:<dev db passwo
migrate -path db/migrations/core -database "postgresql://postgres:<dev db password here>@34.102.59.201:5432/postgres" down 1
```

Run a migration on the indexer db:

```bash
# Apply an up migration to the indexer db
migrate -path db/migrations/indexer -database "postgresql://postgres:<indexer db password here>@<indexer db ip>:5432/postgres" up

# Undo the last migration to the indexer db
migrate -path db/migrations/indexer -database "postgresql://postgres:<indexer db password here>@<indexer db ip>:5432/postgres" down 1
```

### Healthcheck

Verify that the server is running:
Expand Down Expand Up @@ -165,14 +149,6 @@ For example, to run the server locally with live data from the `dev` environment
go run cmd/server/main.go dev
```

To run the indexer server connected to production, run the following command:

```bash
go run cmd/indexer/server/main.go prod
```

When testing the indexer locally, you may want to sync log data from the prod to dev bucket. You can do this by running the sync command below. This command can take a few minutes depending on when the buckets were last synced.

```bash
# Do not switch the order of the buckets! Doing so may overwrite prod data.
gsutil -m rsync -r gs://prod-eth-token-logs gs://dev-eth-token-logs
Expand Down
209 changes: 0 additions & 209 deletions cmd/contract_owners/main.go

This file was deleted.

Loading

0 comments on commit 7a0c838

Please sign in to comment.