-
Notifications
You must be signed in to change notification settings - Fork 159
Managed connectors #6134
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
Managed connectors #6134
Conversation
admin/deployments.go
Outdated
|
|
||
| func (s *Service) findProvisionedRuntimeResource(ctx context.Context, deploymentID string) (*database.ProvisionerResource, bool, error) { | ||
| prs, err := s.DB.FindProvisionerResourcesForDeployment(ctx, deploymentID) | ||
| pr, err := s.DB.FindProvisionerResourceByName(ctx, deploymentID, string(provisioner.ResourceTypeRuntime), "") |
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.
Its a little odd as method is FindProvisionerResourceByName but the name is empty ?
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.
Okay, I changed the query name to ...ByTypeAndName.
The runtime resource is not currently named because there is only supposed to be one resource of that type for each deployment. (I see how this might be a little confusing.) This is different than for ClickHouse, where it matches to the connector name and you could in theory have multiple ClickHouses for one deployment (e.g. if you define clickhouse-a.yaml and clickhouse-b.yaml).
| return nil, fmt.Errorf("provisioner: the requested provisioner %q does not support resource type %q", provisionerName, opts.Type) | ||
| } | ||
| } else { | ||
| for n, candidate := range s.ProvisionerSet { |
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 iterating over a map deterministic in order ? is that a concern here ?
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.
I don't think iterating is deterministic, and yes it's a concern (but not urgently at the moment). We have a separate issue to move to "provisioner chains", which will have deterministic ordering. So it will be improved in a follow up.
| Annotations map[string]string | ||
| } | ||
|
|
||
| func (s *Service) Provision(ctx context.Context, opts *ProvisionOptions) (*database.ProvisionerResource, error) { |
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.
In general if provisioning fails then deployment should be deleted ?
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.
Not anymore – if provisioning fails, the deployment will still be in Postgres with an error status. Provisioning can then be retried by doing a reset (the reset will delete the old deployment record in Postgres, so no leaks).
This enables moving provisioning to a retryable background job, where the UI/CLI can poll the deployment until its status becomes "ok". Kasper is planning to do this move when he gets some time.
| } | ||
|
|
||
| if olap.Dialect() == drivers.DialectClickHouse { | ||
| // Returning early with empty results because this query tends to hang on ClickHouse. |
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.
just confirming - this is intentional ?
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.
Yeah, should probably have been a separate PR, but we want to keep that.
* Protos and parser for managed connectors * Admin APIs for provisioning * Fix test * Fix lint * Fix tests * Minor improvements * Nit * Fix test connector acquire * Change to `FindProvisionerResourceByTypeAndName`
Closes https://github.com/rilldata/rill-private-issues/issues/853