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

Remove Deno and transition to Just for task execution #98

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

joaosreis
Copy link
Member

Eliminate Deno-related configurations and scripts, replacing them with Bash scripts and a Justfile for task management. Update documentation to reflect these changes.

@joaosreis joaosreis self-assigned this Feb 6, 2025

# Apply optimizations to PostgreSQL
pg-apply-optimizations:
sqlx migrate run --source sql/migrations
Copy link
Collaborator

Choose a reason for hiding this comment

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

That's a good idea, but I suppose the migrations require certain file-names and structure? I get this:

$ just pg-apply-optimizations 
sqlx migrate run --source sql/migrations
error: while resolving migrations: error parsing migration filename "apply_search_tx_optimizations.sql"; expected integer version prefix (e.g. `01_foo.sql`)
error: Recipe `pg-apply-optimizations` failed on line 21 with exit code 1

Just to note that the sql scripts are also used by the mina-mesh search-tx-optimizations command (so that also would need to be adjusted):

search-tx-optimizations  Command to apply or drop search transaction optimizations in the archive database.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, this requires something that is implemented on a different PR that I should've opened and merged first. Please wait for it.


# Initialize PostgreSQL database
pg-init:
docker run -d --name {{DB_CONTAINER_NAME}} -p 5432:5432 -v $(pwd)/sql_scripts:/docker-entrypoint-initdb.d -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD -e POSTGRES_USER=$POSTGRES_USER postgres postgres -c log_statement=all -c log_min_duration_statement=0
Copy link
Collaborator

Choose a reason for hiding this comment

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

When doing pg-init I got:

sh: 1: POSTGRES_PASSWORD: parameter not set
error: Recipe `pg-init` failed on line 12 with exit code 2

Perhaps we can add in justfile:

POSTGRES_USER := "mina"
POSTGRES_PASSWORD := "whatever"

or define it in the .env.example?


# Initialize PostgreSQL database
pg-init:
docker run -d --name {{DB_CONTAINER_NAME}} -p 5432:5432 -v $(pwd)/sql_scripts:/docker-entrypoint-initdb.d -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD -e POSTGRES_USER=$POSTGRES_USER postgres postgres -c log_statement=all -c log_min_duration_statement=0
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm thinking also, that we might actually define $PG_PORT in .env.example too (and re-use it here as -p $PG_PORT:5432).
I locally have a postgres running on 5432 and if I try to init pg docker environment I get a port conflict... so I need to manually change all the ports in my .env and here in order to make it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants