-
Notifications
You must be signed in to change notification settings - Fork 42
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
e4cb98d
to
93bbfa8
Compare
@@ -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>, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch.
There was a problem hiding this 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
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.