Migrations from entrypoints#190
Conversation
|
Coverage Report for ./apps/cli
File CoverageNo changed files found. |
|
For the reasons explained at https://www.docker.com/blog/docker-best-practices-choosing-between-run-cmd-and-entrypoint/ I highly prefer to use exec form only, and not use ENTRYPOINT to run database migrations through shell. Another strategy I see around is the software itself takes care of database initialization, which has the advantage of guaranteeing the correct migration is executed. But rollups-node and rollups-graphql are not doing that. |
I agree with the reasons mentioned in the post, but mostly it's ok for single purpose containers, that's not our case. We have an SDK container that has a lot of auxiliary tools and services inside, the container itself is used to bundle everything and ensure compatibility with every tool for the cartesi environment. What I'm trying to achieve with removing those one-shot containers that are used for migrations (and even If you agree, I think we could enhance the cartesi/sdk container image with en entrypoint that could be used from
For that, I suggest talking to those project's teams and issue a feature request if we think it's I'm closing this and will get back to it if we decide to have an entrypoint defined at cartesi/sdk and reuse if from the cli. |
Noise of the pull or the start itself? |
Yes.
That's fine.
For example: ✗ cartesi-dev rollups start --services graphql,espresso
WARNING: default block is set to 'latest', production configuration will likely use 'finalized'
[+] Pulling 12/12
✔ espresso_reader_migration Skipped - Image is already being pulled by anvil 0.0s
✔ graphql_database_migration Skipped - Image is already being pulled by anvil 0.0s
✔ espresso Skipped - Image is already being pulled by anvil 0.0s
✔ rollups-node Skipped - Image is already being pulled by anvil 0.0s
✔ espresso_database_creator Skipped - Image is already being pulled by graphql_database_creator 0.0s
✔ graphql Skipped - Image is already being pulled by anvil 0.0s
✔ database Skipped - Image is already being pulled by graphql_database_creator 0.0s
✔ rollups-node-migration Skipped - Image is already being pulled by anvil 0.0s
✔ espresso_reader Skipped - Image is already being pulled by anvil 0.0s
✔ proxy Pulled
.... |
This pull request includes several updates to the Docker Compose configurations for various services. The main changes involve updating the PostgreSQL image and simplifying the service definitions by merging migration steps into the main service entrypoints.
Updates to PostgreSQL image:
apps/cli/src/compose/rollups/docker-compose-database.yaml: Updated the PostgreSQL image frompostgres:16-alpinetopostgres:16.apps/cli/src/compose/rollups/docker-compose-espresso.yaml: Updated the PostgreSQL image frompostgres:16-alpinetopostgres:16.apps/cli/src/compose/rollups/docker-compose-explorer.yaml: Updated the PostgreSQL image frompostgres:16-alpinetopostgres:16.apps/cli/src/compose/rollups/docker-compose-graphql.yaml: Updated the PostgreSQL image frompostgres:16-alpinetopostgres:16.Simplification of service definitions:
apps/cli/src/compose/rollups/docker-compose-graphql.yaml: Removed thegraphql_database_migrationservice and integrated the migration commands into thegraphqlservice entrypoint. Updated dependencies accordingly. [1] [2]apps/cli/src/compose/rollups/docker-compose-node.yaml: Removed therollups-node-migrationservice and integrated the migration commands into therollups-nodeservice entrypoint. Updated dependencies accordingly. [1] [2]apps/cli/src/compose/rollups/docker-compose-paymaster.yaml: Renamedmock-verifying-paymasterservice topaymasterfor consistency.