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

Cluster manager: use update to wait for cluster to start #153

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

dandavison
Copy link
Contributor

@dandavison dandavison commented Dec 8, 2024

This PR changes our cluster manager sample as follows:

  • Previously, the workflow was started, but the "cluster itself did not start" until a signal is sent in.
  • Now, the workflow automatically does the "start cluster" operations on workflow start. An update is available for the user to wait until the cluster is ready to be used.

The reason for this change is that it highlights two styles of update usage:

  1. The update accepts some input and does something with it (assign nodes to cluster, or execute an activity in general)
  2. The update is used to wait until a certain stage (cluster started, early return available, etc)

In case (2) the workflow should generally be written such that it will orchestrate its work whether or not the update is sent, and that's what this PR does.

Also:

  • switch to use @workflow.init
  • Use hash(node_id) % 5 instead of requiring node IDs to parse as ints

@dandavison dandavison merged commit 9ba977b into main Dec 10, 2024
9 checks passed
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.

2 participants