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

IWF-473: Upgrade Cadence dependencies #548

Merged
merged 2 commits into from
Feb 24, 2025
Merged

Conversation

samuel27m
Copy link
Member

@samuel27m samuel27m commented Feb 21, 2025

Description

Checklist

  • Code compiles correctly
  • Tests for the changes have been added
  • All tests passing
  • This PR change is backwards-compatible
  • This PR CONTAINS a (planned) breaking change (it is not backwards compatible)

Related Issue

Closes #432

Copy link

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.06%. Comparing base (6249778) to head (5b84b13).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #548   +/-   ##
=======================================
  Coverage   66.06%   66.06%           
=======================================
  Files          62       62           
  Lines        6927     6927           
=======================================
  Hits         4576     4576           
  Misses       2072     2072           
  Partials      279      279           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@samuel27m samuel27m marked this pull request as ready for review February 24, 2025 10:11
@@ -55,12 +50,6 @@ func (h *handler) ApiV1WorkflowStateStart(c *gin.Context, t *testing.T) {
}

if req.GetWorkflowStateId() == State1 {
nowInt, err := strconv.Atoi(req.StateInput.GetData())
Copy link
Member Author

Choose a reason for hiding this comment

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

This was not being used in the test assertions and it was causing this test to be flaky for some weird reason, so I removed it

Copy link
Contributor

Choose a reason for hiding this comment

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

i think that's for the best, if the value isn't being used but is causing issues it should be removed 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have a link to a failed pipeline where this test was flaky? What was the error exactly?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, you can look at the actions in the previous commit in this PR: 8194a71

I believe this was flaky because while the Cadence tests failed(https://github.com/indeedeng/iwf/actions/runs/13464338908/job/37627766325), the All Tests job passed (https://github.com/indeedeng/iwf/actions/runs/13464338906/job/37626732846) and the latter runs the same Cadence tests.

The error was this: https://github.com/indeedeng/iwf/actions/runs/13464338908/job/37627766325#step:4:5143

errors.go:6: TestIgnoreAlreadyStartedWorkflowCadence - Test failed with error: strconv.Atoi: parsing "": invalid syntax

Copy link
Member Author

Choose a reason for hiding this comment

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

When I looked closer, it seemed that the value wasn't being passed to the test router. And it the property it wrote to in the router wasn't used in the test for any assertion, so I removed this bit. The tests assertions haven't changed i.e. it's doing the same checks as before

networks:
- testing-network
zookeeper:
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like zookeeper is no longer a dependency with the latest version of Cadence, is that right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this is the cadence MR that removed Zookeeper for reference: cadence-workflow/cadence@4cb4443

And this is the file I used to look at how Cadence has their Docker setup: https://github.com/cadence-workflow/cadence/blob/master/docker/docker-compose-es-v7.yml

Copy link
Contributor

@mixydubs mixydubs left a comment

Choose a reason for hiding this comment

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

Looks ok from my perspective. The tests all pass and you've improved the code in few areas while your at it, nice one!

KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
# KRaft settings
Copy link
Contributor

Choose a reason for hiding this comment

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

Kafka? 👀

Copy link
Member Author

Choose a reason for hiding this comment

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

Answered below: #548 (comment)

KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
# KRaft settings
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here. Not sure what KRaft is

Copy link
Member Author

Choose a reason for hiding this comment

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

https://developer.confluent.io/learn/kraft/

Apache Kafka Raft (KRaft) is the consensus protocol that was introduced in KIP-500 to remove Apache Kafka’s dependency on ZooKeeper for metadata management. This greatly simplifies Kafka’s architecture by consolidating responsibility for metadata into Kafka itself, rather than splitting it between two different systems: ZooKeeper and Kafka. KRaft mode makes use of a new quorum controller service in Kafka which replaces the previous controller and makes use of an event-based variant of the Raft consensus protocol.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, thx!

Copy link
Member Author

Choose a reason for hiding this comment

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

Basically seems to be the way forward so that we no longer need Zookeeper. But mainly, I copied most of the configs from the Cadence repo, so we're doing the same configs as they recommend right now

@samuel27m samuel27m merged commit e103716 into main Feb 24, 2025
10 checks passed
@samuel27m samuel27m deleted the jira/scacador/IWF-473 branch February 24, 2025 17:10
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.

Upgrade cadence dependencies
3 participants