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

Add namespace level capabilities #341

Merged
merged 3 commits into from
Jan 30, 2024

Conversation

Quinn-With-Two-Ns
Copy link
Contributor

@Quinn-With-Two-Ns Quinn-With-Two-Ns commented Jan 9, 2024

Add a message to NamespaceInfo to include namespace level capabilities. Different then the capabilities returned by GetSystemInfoResponse because those are scoped to a cluster where these are scoped to a namespace. I included the field in NamespaceInfo since that is exposed for all users already and is already been used for similar feature flags in a less general way. This is scoped to server configs, not to include cloud account level configs.

Is this intended to work in OS and Cloud

Yes

Who is intended to use this

Applications like UI (Not the SDKs internally)

@Quinn-With-Two-Ns Quinn-With-Two-Ns requested review from a team as code owners January 9, 2024 17:42
temporal/api/namespace/v1/message.proto Outdated Show resolved Hide resolved
@@ -45,6 +45,14 @@ message NamespaceInfo {
// A key-value map for any customized purpose.
map<string, string> data = 5;
string id = 6;
// All capabilities the namespace supports.
Capabilities capabilities = 7;
Copy link
Member

Choose a reason for hiding this comment

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

Can you confirm whether cloud supports DescribeNamespace and therefore can also add capabilities here? If not, is this intentionally OSS only?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cloud supports DescribeNamespace . This feature should work in OSS and Cloud.

Copy link
Member

Choose a reason for hiding this comment

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

Can you confirm with cloud team before merging that this is acceptable to them?

Copy link
Member

Choose a reason for hiding this comment

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

cloud does not censor the namespaceInfo object. Don't see a reason to censor capabilities at this point in time, so LGTM

@@ -45,6 +45,14 @@ message NamespaceInfo {
// A key-value map for any customized purpose.
map<string, string> data = 5;
string id = 6;
// All capabilities the namespace supports.
Capabilities capabilities = 7;
Copy link
Member

Choose a reason for hiding this comment

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

Do all SDKs make a describe namespace call so they can get this kind of information? What if there are client capabilities? Even in the Go SDK doesn't call this until workers are created correct? I wonder if there are better ways to relay namespace-specific capabilities (maybe accepting a namespace on GetSystemInfo?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently GetSystemInfo is not a namespace call. I think we'd need server and cloud to chime in on the scope of making it conditionally authorized by namespace.

Copy link
Member

Choose a reason for hiding this comment

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

My fear is that not all SDKs make this call, and the ones that do only do it before worker start not at client dial time (because we allow people to use another namespace on the same client connection without any network calls in between). I think we can call this WorkerCapabilities and feel a bit safer if whatever idea you have for putting in this field are worker specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I was not expecting the SDKs to be calling this at client dial time or using it to make any SDK internal decisions. @bergundy you opened the issue here What was your expectation of the use of this API?

Copy link
Member

Choose a reason for hiding this comment

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

I don't expect the SDK to invoke this call.
I expect applications to use it though.

One of the use cases I had in mind is our features repo or other test frameworks that are designed to work with arbitrary server to disable certain tests when features are not implemented by the targeted server.

The UI is another example, it can use these capabilities to as feature flags.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK that was my expectation as well

Copy link
Member

Choose a reason for hiding this comment

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

👍 If we add those initial three capabilities listed later, that works for me.


// Namespace capability details. Should contain what features are enabled in a namespace.
message Capabilities {
}
Copy link
Member

Choose a reason for hiding this comment

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

You can already add eager_workflow_start, sync_update and async_update as the first set of capabilities.

Copy link
Member

Choose a reason for hiding this comment

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

To confirm, it is ok if the SDK never calls this?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, the SDK will get errors if it tries to use these APIs, the capabilities are meant to be used at the application layer.

Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

LGTM, but can you confirm with cloud that this is ok with them?

Comment on lines 61 to 62
// Whether scheduled workflows are supported on this namespace. This is only needed
// temporarily while the feature is experimental, so we can give it a high tag.
Copy link
Member

Choose a reason for hiding this comment

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

This one was an attempt at starting a list of capabilities. Maybe it should be moved into the new structure?

Also do we want to include versioning apis also? (we can have two fields for "v1" and "v2" since we're changing them)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it is worth moving it at this point

I can include versioning APIs, but the items I have in this PR are just initial features we can always add more

Copy link
Member

Choose a reason for hiding this comment

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

Okay. Looks good for now then

Comment on lines 61 to 62
// Whether scheduled workflows are supported on this namespace. This is only needed
// temporarily while the feature is experimental, so we can give it a high tag.
Copy link
Member

Choose a reason for hiding this comment

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

Okay. Looks good for now then

@Quinn-With-Two-Ns Quinn-With-Two-Ns merged commit 34e5d97 into temporalio:master Jan 30, 2024
4 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.

5 participants