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

Docker compose setup for async workflows with kafka queue #5663

Conversation

taylanisikdemir
Copy link
Member

@taylanisikdemir taylanisikdemir commented Feb 15, 2024

What changed?

  • Added new docker compose file which runs all typical Cadence dependencies plus Kafka/Zookeeper.
  • Updated config_template.yaml with a new conditional asyncWorkflowQueues section. Only enabled by the new docker compose file via an env var.
  • Updated Dockerfile to generate a new image that includes kafka binaries. Only need kafka-topics.sh to check during startup for now. The new image is tagged as ubercadence/server:master-auto-setup-with-kafka.

Why?
This setup will be handy to try async workflows locally and also to setup CI integration test.

How did you test it?
Ran docker-compose -f docker/docker-compose-async-wf-kafka.yml up and validated all containers up and running. Verified the topic is created.
A follow up PR will validate async workflows working e2e.

@taylanisikdemir taylanisikdemir changed the title Docker compose setup for async workflow kafka queue Docker compose setup for async workflows with kafka queue Feb 15, 2024
@coveralls
Copy link

coveralls commented Feb 15, 2024

Pull Request Test Coverage Report for Build 018daecf-4877-4be3-b0f0-e7bb2b04844e

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 98 unchanged lines in 15 files lost coverage.
  • Overall coverage decreased (-0.03%) to 62.723%

Files with Coverage Reduction New Missed Lines %
client/history/client.go 2 38.1%
common/persistence/sql/sqlplugin/postgres/db.go 2 85.0%
common/persistence/sql/sqlplugin/postgres/task.go 2 73.4%
common/task/weighted_round_robin_task_scheduler.go 2 89.05%
service/history/handler.go 2 49.97%
service/matching/matcher.go 2 90.72%
service/matching/taskReader.go 2 84.88%
service/history/queue/timer_gate.go 3 95.83%
service/frontend/api/handler.go 4 62.11%
service/history/task/fetcher.go 4 85.05%
Totals Coverage Status
Change from base Build 018dae9f-1cbd-4682-94eb-c8ea3a325702: -0.03%
Covered Lines: 92593
Relevant Lines: 147622

💛 - Coveralls

@taylanisikdemir taylanisikdemir force-pushed the taylan/async_wf_kafka_docker_compose branch from 080a46d to 91d655b Compare February 15, 2024 19:09
@taylanisikdemir taylanisikdemir force-pushed the taylan/async_wf_kafka_docker_compose branch from 91d655b to 391f07d Compare February 15, 2024 22:07
Copy link
Contributor

@shijiesheng shijiesheng left a comment

Choose a reason for hiding this comment

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

tested

root@74af085dad6c:/# $KAFKA_HOME/bin/kafka-topics.sh --describe --topic async-wf-topic1 --zookeeper zookeeper:2181
Topic:async-wf-topic1   PartitionCount:10       ReplicationFactor:1     Configs:
        Topic: async-wf-topic1  Partition: 0    Leader: 1001    Replicas: 1001  Isr: 1001
        Topic: async-wf-topic1  Partition: 1    Leader: 1001    Replicas: 1001  Isr: 1001
        Topic: async-wf-topic1  Partition: 2    Leader: 1001    Replicas: 1001  Isr: 1001
        Topic: async-wf-topic1  Partition: 3    Leader: 1001    Replicas: 1001  Isr: 1001
        Topic: async-wf-topic1  Partition: 4    Leader: 1001    Replicas: 1001  Isr: 1001
        Topic: async-wf-topic1  Partition: 5    Leader: 1001    Replicas: 1001  Isr: 1001
        Topic: async-wf-topic1  Partition: 6    Leader: 1001    Replicas: 1001  Isr: 1001
        Topic: async-wf-topic1  Partition: 7    Leader: 1001    Replicas: 1001  Isr: 1001
        Topic: async-wf-topic1  Partition: 8    Leader: 1001    Replicas: 1001  Isr: 1001
        Topic: async-wf-topic1  Partition: 9    Leader: 1001    Replicas: 1001  Isr: 1001

Also another possible optimization is to add another kafka setup image like this stack suggests to avoid a bigger additional cadence server image.
https://stackoverflow.com/questions/47615751/docker-compose-run-a-script-after-container-has-started

@taylanisikdemir taylanisikdemir merged commit 37bea26 into cadence-workflow:master Feb 15, 2024
16 checks passed
@taylanisikdemir taylanisikdemir deleted the taylan/async_wf_kafka_docker_compose branch February 15, 2024 23:42
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.

4 participants