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

Improve cluster ergonomics #560

Merged
merged 6 commits into from
Jan 19, 2024
Merged

Conversation

paulgb
Copy link
Member

@paulgb paulgb commented Jan 19, 2024

This fixes a few things I don't like about clusters right now:

  • Since keys are (by default) shared across all clusters managed by a container, there is a weird thing where you can request a connection to a certain cluster's endpoint and get back a result from another cluster. Logically, it makes sense to consider the cluster as part of the (optional) spawn configuration. In fact, a connect request that only wants to connect to an existing backend should not need to specify a cluster at all.

  • I expect the majority of self-hosting users will want only a single cluster, but they are forced to specify a cluster in every CLI command and connect request. This PR allows a default_cluster to be set in the controller, which is then applied if no cluster is provided in a connect request.

  • Internally, even though the backend_id is unique across all clusters managed by the same controller, we effectively use the entire (cluster, backend) pair as a key for backends. This creates some unnecessary complexity that we can eliminate by using backend alone as the ID.

This also bumps the version to 0.4.1.

@paulgb paulgb requested a review from rolyatmax January 19, 2024 16:14
Copy link

vercel bot commented Jan 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plane ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 19, 2024 6:42pm

@paulgb paulgb force-pushed the paul/dis-1570-improve-cluster-ergonomics branch from e4cb98d to 93bbfa8 Compare January 19, 2024 17:28
@paulgb paulgb marked this pull request as ready for review January 19, 2024 17:30
@@ -285,6 +285,9 @@ impl ExecutorConfig {

#[derive(Clone, Serialize, Deserialize, Debug)]
pub struct SpawnConfig {
/// Cluster to spawn to. Uses the controller default if not provided.
pub cluster: Option<ClusterName>,
Copy link
Member Author

Choose a reason for hiding this comment

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

Spawn config now takes an optional cluster name. If it is not provided, we fall back on the default cluster name set on the controller.

Ok(Json(status))
}

pub async fn handle_backend_status_stream(
Path((_cluster, backend_id)): Path<(ClusterName, BackendName)>, // TODO: check cluster id
Path(backend_id): Path<BackendName>, // TODO: check cluster id
Copy link
Member

Choose a reason for hiding this comment

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

Is this comment out of date now?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch.

Copy link
Member

@rolyatmax rolyatmax left a comment

Choose a reason for hiding this comment

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

LGTM! I like stripping out the cluster for endpoints where it's not really required

@paulgb paulgb merged commit 90eefde into main Jan 19, 2024
7 checks passed
@paulgb paulgb deleted the paul/dis-1570-improve-cluster-ergonomics branch January 19, 2024 18:44
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