Skip to content

Remove Deno and transition to Just for task execution#98

Merged
joaosreis merged 20 commits intomainfrom
drop-deno
Feb 11, 2025
Merged

Remove Deno and transition to Just for task execution#98
joaosreis merged 20 commits intomainfrom
drop-deno

Conversation

@joaosreis
Copy link
Copy Markdown
Contributor

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
Comment thread justfile

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

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
Copy Markdown
Contributor 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.

Comment thread justfile Outdated

# 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
Copy Markdown
Contributor

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?

Comment thread justfile Outdated

# 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
Copy Markdown
Contributor

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.

@joaosreis joaosreis requested a review from piotr-iohk February 10, 2025 11:20
Copy link
Copy Markdown
Contributor

@piotr-iohk piotr-iohk left a comment

Choose a reason for hiding this comment

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

LGTM! 👏

@joaosreis joaosreis merged commit fa8c509 into main Feb 11, 2025
@joaosreis joaosreis deleted the drop-deno branch February 11, 2025 16:30
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