-
Notifications
You must be signed in to change notification settings - Fork 592
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
PUT /v1/transform/{name}/meta #18236
PUT /v1/transform/{name}/meta #18236
Conversation
/dt |
An alternative is to have an endpoint like: PATCH /transform/{name} where you can patch the transform object. Parameters would include environment variables, is paused and maybe some others? @mo-redpanda this patch endpoint could support updating environment variables only for console based transforms. |
I like that idea. Unfortunately our seastar http mess doesn't support PATCH, so maybe |
(or finally go in and see how much work it would be to add PATCH support!) |
I am not a REST purest so fine with PUT |
2d26643
to
5d87f40
Compare
force push contents:
|
5d87f40
to
f5d4848
Compare
force push fix swagger |
f5d4848
to
9072e0c
Compare
force push contents:
|
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.
🌶️
src/go/rpk/pkg/cli/transform/meta.go
Outdated
|
||
func newStartCommand(fs afero.Fs, p *config.Params) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "start [NAME]", |
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 would recommend creating an RFC and/or bringing this naming up with Mo + Rogger. Start makes me think I need to start transforms after deploying. Alternative name suggestion: resume
(gcloud uses this terminology). Others to consider: unpause
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.
yea, waffled on this a bit and went with what's in the ticket as a placeholder...I'm partial to suspend/resume in this context, but RFC seems prudent.
|
||
func newPauseCommand(fs afero.Fs, p *config.Params) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "pause [NAME]", |
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.
Alternatively consider the naming gcloud uses: suspend
. Not sure if that is more clear or not to see what's happening under the hood.
}, | ||
"transform_metadata_patch": { | ||
"id": "transform_metadata_patch", | ||
"description": "A partial update to transform metadata", |
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 there a way to document the semantics? I feel like patch requests are sometimes hard to understand. For example would be good to say things like:
- environment map is overridden (so no deep patches)
- If not present then it is unchanged
9072e0c
to
0572830
Compare
force push contents:
|
0572830
to
eb29a27
Compare
force push - rebase |
eb29a27
to
2f90747
Compare
force push contents:
|
Also adds a couple of model types: is_transform_paused (bool) transform_metadata_patch - map<str, str> - Overwrite transform environment map (PUT semantics) - paused - Pause or unpause the transform Also adds ::paused to transform_metadata stream operator Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
fd1ff3e
to
0074461
Compare
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.
rpk changes LGTM, thanks!
- Paused transforms show `inactive` partitions in report - Metadata updates with is_paused::yes prevents new processor creation Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
Proxy for existing plugin_table method. Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
Looks up a transform by name, modifies metadata accordingly with the environment map and paused state in the request, and upserts. includes a unit test for the pause update specifically, since it affects processor state. Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
patch_transform_metadata From request body reads: - A paused state (optional) - A list of environment_variables (optional) - If present, overwrites the environment map in current metadata If neither field is present in the request body, return success but don't bother propagating it to the cluster. Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
0074461
to
b6f724d
Compare
force push contents:
|
CI Failure is |
Includes some code to parse a JSON request body into a transform_metadata_patch Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
PUT transform/{name}/meta Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
Admin API returns environment variables as a list of objects, but rpk is clever enough to parse those out into a map before dumping json. Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
- calls /v1/transform/{name}/meta - patchMetadataRequest body: - IsPaused *bool - Environment *[]EnvironmentVariable Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
Pause and resume a transform via Admin API Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
Includes both rpk and admin API usage. NOTE: env patches are not yet supported by `rpk transform` Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
b6f724d
to
e9fd450
Compare
force push adds |
Introduce an Admin API endpoint for patching transform metadata
Also adds rpk experience for pause/resume (no env manipulation for now)
TODO:
rpk
for pause/start(PUNT)rpk
for env mutationDocs issue: https://github.com/redpanda-data/documentation-private/issues/2437
Closes CORE-1653
Backports Required
Release Notes
Improvements