Skip to content
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

chore: update indexer in local environment #2268

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ services:
container_name: indexer_container
environment:
DATABASE_URL: postgres://postgres:password@localhost:5432/indexer
ROOT_DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
REGEN_API: http://127.0.0.1:1317
REGEN_RPC: http://127.0.0.1:26657
entrypoint: ["/bin/sh", "-c", "./scripts/indexer_start.sh"]
Expand Down
14 changes: 4 additions & 10 deletions docker/indexer.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM python:3.9-slim
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can revert back to python:3.9. In a previous PR I made a change to use python:3.9-slim: #2125

Today I ran into the same issue I initially reported. But doing another docker pull python:3.9 seems to have pulled a newer image that has fixed this issue. I believe this issue explains more why this was happening for me: docker-library/python#837

FROM python:3.9

# Install dependencies
RUN apt-get update
RUN apt-get install git libpq-dev gcc postgresql-client -y
RUN apt-get install libpq-dev postgresql-client nodejs python3-poetry yarnpkg -y

# Set version and chain
ENV GIT_CHECKOUT='8d3635aa33d4d49db903f947bb357c938d168f8d'
ENV GIT_CHECKOUT='07ba5fa054e34d2a0587daa944c8e517ff82ce18'

# Clone regen ledger
RUN git clone https://github.com/regen-network/indexer/ /home/indexer
Expand All @@ -16,15 +16,9 @@ WORKDIR /home/indexer
# Use provided version
RUN git checkout $GIT_CHECKOUT

# Install python dependencies
RUN pip install poetry
RUN pip install load_dotenv
RUN pip install psycopg2
RUN pip install sentry_sdk
RUN pip install tenacity

# Install indexer
RUN poetry install
RUN yarnpkg install

# Copy indexer init script
COPY docker/scripts/indexer_init.sh /home/indexer/scripts/
Expand Down
2 changes: 1 addition & 1 deletion docker/scripts/indexer_init.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# run migrations
(cd sql && ./run_all_migrations.sh)
yarnpkg run db-init

# workaround for indexer starting with new chain
psql "$DATABASE_URL" -c "INSERT INTO chain (
Expand Down
2 changes: 1 addition & 1 deletion docker/scripts/indexer_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ if [ ! -e $INDEXER_INITIALIZED ]; then
fi

# start indexer
python main.py
poetry run python main.py