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

feat: new model_reuse_type to enable sync by peers and creation by leader #170

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

samika98
Copy link
Contributor

@samika98 samika98 commented May 6, 2024

Added a Model Reuse Type to help us configure Goose Scenario. This Reuse type lets the global leader (worker with id 0) create models and all the users including the leader (ceramic nodes) subscribe to that model.

@samika98 samika98 marked this pull request as draft May 6, 2024 21:37
@samika98 samika98 changed the title feat/new model_reuse_type to enable sync by peers and creation by leader feat: new model_reuse_type to enable sync by peers and creation by leader May 6, 2024
&small_model_id,
&large_model_id,
config.params.number_of_documents,
global_leader,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be true so that each worker creates MIDs instead of just the global leader.

Suggested change
global_leader,
true,

Copy link
Collaborator

Choose a reason for hiding this comment

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

Basically, we need the ReuseType::Shared code when creating models, but ReuseType::PerUser code when creating MIDs.

Self::ensure_model_exists(user, &config.user_cli, &small).await?;
Self::ensure_model_exists(user, &config.user_cli, &large).await?;
(small, large)
}
};

if lead_user {
Copy link
Collaborator

@smrz2001 smrz2001 May 6, 2024

Choose a reason for hiding this comment

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

Because of this if-block, one user per worker will call the model subscription API, which means each node will already be subscribed to the models. This means that we shouldn't need to pass the should_subscribe flag as you're doing below.

@@ -293,6 +330,7 @@ impl CeramicModelInstanceTestUser {
redis_cli: &redis::Client,
should_create: bool,
redis_postfix: Option<String>,
should_subscribe: bool,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This might not be necessary - see my comment above. One user on each worker is already making sure that the corresponding node is subscribed to the models.

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