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

Clean up container tooling to split API & collector #1

Merged
merged 3 commits into from
Jan 9, 2023

Conversation

ZaradarBH
Copy link

@ZaradarBH ZaradarBH commented Jan 5, 2023

First of all this PR is not strictly necessary. The reasoning behind it is to split the API & collector processes into separate docker images which will allow us to scale them individually in a manner that will not break the old docker setup which means we maintain the legacy image to act as a baseline for the two new images.

In addition the new docker-compose tooling & scripts that have been added will allow us to launch the "fcd application stack" using docker-compose and a few commands like so:

./scripts/docker_compose_build.sh
docker-compose up database -d
sleep 60
docker-compose up indexer-api indexer-collector

Note: The sleep command is to wait for postgres to boot up as containers have no way of knowing if the internal process is ready to receive connects, all it knows is that it has started with an exit code at which point it doesnt care much about anything else. We could replace this by using wait-for-it @ https://github.com/vishnubob/wait-for-it allowing us to just do "docker-compose up" in one-line, with no sleep, but this will require some funky exec logic in the docker-compose tooling that I would rather avoid, because we cant use wait for it inside the image as this will end up blowing up k8s health probes.

Overall this approach lets you spin up the three containers processes (postgres, api, collector) that make up the physical
architecture of the FCD easily, without to much internal understanding of how it all works, while allowing us to map it into the terra-operator concept (terrad, oracle-feeder, fcd k8s operator), hence the change in env variable and dockerfile naming schemes.

Feel free to break my heart @faddat <3

…ntainer images so they are easier to orchestrate individually
@ZaradarBH ZaradarBH added enhancement New feature or request out of scope Issues that are not part of the work approved by the community, but still essential for the team labels Jan 5, 2023
@ZaradarBH ZaradarBH added this to the Proposal 11168 milestone Jan 5, 2023
@ZaradarBH ZaradarBH self-assigned this Jan 5, 2023
- Re-target to "@terra-money/terra.proto": "^0.1.7"
Copy link

@inon-man inon-man left a comment

Choose a reason for hiding this comment

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

There is just no need for ormconfig file to be copied.

@ZaradarBH ZaradarBH merged commit b82d751 into main Jan 9, 2023
@ZaradarBH ZaradarBH deleted the container-cleanup-and-optimization branch January 9, 2023 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request out of scope Issues that are not part of the work approved by the community, but still essential for the team
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants