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

[#1464] Enable future genesis in DBSync config #1609

Merged

Conversation

placek
Copy link
Contributor

@placek placek commented Jul 24, 2024

The purpose of these changes is to enhance the Cardano DB Sync integration and ensure better synchronization and configuration management within the Cardano ecosystem. These updates introduce a customized entrypoint script, set up an ECR registry, and enable future genesis compatibility, among other improvements. These efforts collectively aim to adapt the DBSync process for future updates, facilitate deployment activities by enabling custom logic during container startup, and ensure that all necessary configurations are included seamlessly. Additionally, the changes to the .gitignore file make it more robust in handling Haskell build artifacts.

As a result of these changes, the DBSync process is more robust and forward-compatible, ensuring that it can handle upcoming updates in the Cardano blockchain with ease. The ECR registry setup ensures better version control and deployment reliability for the custom Cardano DB Sync images. The updates to the workflow and Docker Compose templates guarantee that all necessary configurations, including environment variables and genesis settings, are correctly applied. The modification to the .gitignore file enhances flexibility, making sure that Haskell build artifacts are appropriately excluded regardless of their location within the repository. These comprehensive changes result in a more adaptable and reliable synchronization process with the Cardano blockchain.

Updated the .gitignore file to make the exclusion of Haskell build
artifacts more generic. Instead of specifying paths based on project
structure (e.g., `govtool/backend/dist-newstyle/` and
`govtool/backend/.stack-work/`), the patterns now use `dist-newstyle/`
and `.stack-work/` to exclude these directories regardless of their
location within the repository. This change enhances the flexibility of
the `.gitignore` file and ensures that Haskell build artifacts are
consistently ignored across different projects and directories within
the repository.
Updated the dbsync configuration to include the "EnableFutureGenesis"
option. Modified the `scripts/govtool/config.mk` file to add
`db-sync-config.json` under the `cardano_configs` list. Also included a
new command to download the `db-sync-config.json` file and append the
"EnableFutureGenesis" configuration to it. This change allows the
synchronization process to support future genesis blocks, making the
system more adaptable to upcoming updates in the Cardano blockchain.
Updated the Docker Compose template `docker-compose.yml.tpl` for the
DBSync container to include the new configuration. Added a command to
specify the path to the `db-sync-config.json` file and also included a
volume mount to provide the configuration file to the container. This
change ensures the DBSync process uses the correct settings, allowing it
to adapt to future updates and ensuring better synchronization with the
Cardano blockchain.
Updated the DBSync configuration to support future genesis blocks by
adding the `DB_SYNC_ENABLE_FUTURE_GENESIS` environment variable to
`docker-compose.yml.tpl`. This ensures the DBSync process is
forward-compatible with future updates to the Cardano blockchain,
enhancing its adaptability and long-term functionality.

This change ensures the DBSync process uses the correct settings,
allowing it to adapt to future updates and ensuring better
synchronization with the Cardano blockchain.
Updated the GitHub Actions workflow to include the `PDF_API_URL`
environment variable. This ensures that the resync process has access to
the necessary endpoint for generating PDFs, improving the overall
functionality and integration of the resync process within the Cardano
node and DBSync synchronization workflow. This change addresses the
missing configuration and enhances the reliability of the workflows.

Additionally, this commit introduces the recent adjustments made to the
workflow that deploys dev environment.
Added a new ECR module for storing the custom Cardano DB Sync Docker
image. This change involved updating the `infra/terraform/main.tf` file
to include the new `govtool-ecr-custom-cardano-db-sync` module. Adjusted
the IAM policy to grant access to this new repository. Additionally,
included output configurations for retrieving the repository URL. This
update supports the transition towards storing and deploying custom
Cardano DB Sync images, ensuring better version control and deployment
reliability.
Updated `scripts/govtool/Makefile` to include the new custom Cardano DB
Sync module by adding `custom-cardano-db-sync.mk`. Created new files:
- `scripts/govtool/custom-cardano-db-sync.Dockerfile` to define the
  Docker image with a custom entrypoint.
- `scripts/govtool/custom-cardano-db-sync.entrypoint.sh` to provide the
  custom entrypoint script.
- `scripts/govtool/custom-cardano-db-sync.mk` to manage the build and
  push processes of the custom Cardano DB Sync Docker image.

These changes ensure that we can build and deploy a custom Cardano DB
Sync image with a specific entrypoint, allowing for custom logic
execution during container startup.
Updated the custom entrypoint script for the Cardano DB Sync container
to include advanced configuration capabilities. Changes were made to
`scripts/govtool/custom-cardano-db-sync.entrypoint.sh` to set up
necessary environment variables, handle PostgreSQL authentication via a
`pgpass` file, and include the path to `db-sync-config.json`. The
`scripts/govtool/Makefile` and
`scripts/govtool/config/templates/docker-compose.yml.tpl` files were
adjusted to support these changes by implementing new build and
deployment targets for the custom Cardano DB Sync image and updating the
Docker Compose template.

These changes ensure the DBSync process uses the correct settings,
allowing it to adapt to future updates and ensuring better
synchronization with the Cardano blockchain.
@placek placek self-assigned this Jul 24, 2024
@placek placek added 🐛 Bug Something isn't working 🏗 Infrastructure labels Jul 24, 2024
@placek placek changed the title [#1464] feat(#1234): add reddis support for storing metadata validation results [#1464] Enable future genesis in DBSync config Jul 24, 2024
Copy link
Contributor

@MSzalowski MSzalowski left a comment

Choose a reason for hiding this comment

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

Really awesome job! 🎉

But instead of providing custom images, we still need to be in contact with db-sync team to find the best solution of not customizing the images, but use the images they provide without having the config hardcoded.

Let's merge it and deploy it 🚀

@placek placek merged commit 10aff0c into develop Jul 24, 2024
2 checks passed
@placek placek deleted the fix/1464-add-enable-future-genesis-to-dbsync-configuration branch July 24, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working 🏗 Infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants