-
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
Rework API #2071
Rework API #2071
Conversation
Great work, some feedback from giving it a first try:
Screencast.from.07-30-2024.01.25.22.PM.webm
2024-07-30 20:27:51 ERROR [manager] [HTTP error response] PipelineNotRunningOrPaused: Pipeline 0191054a-5ae2-7362-9993-c8c097f5a56b is not currently running or paused.
Screencast.from.07-30-2024.01.28.57.PM.webm
Screencast.from.07-30-2024.01.33.27.PM.webm-if autosave is off and turned back on, if the state has changed the default action should be to save
|
Thanks a ton for the feedback, a few replies already:
The return code should be an error (issuing an action which is not valid in a certain status).
These are the current defaults, I agree it would be good to change to None, though for this PR not planning on changing that part of the API. |
0fd0650
to
2a9cde0
Compare
.with(['Initializing', P.any, P.nullish, P._], () => 'Initializing' as const) | ||
.with(['Paused', P.any, P.nullish, 'CompilingSql'], () => 'Compiling sql' as const) | ||
.with(['Paused', P.any, P.nullish, 'Pending'], () => 'Queued' as const) | ||
.with(['Paused', P.any, P.nullish, 'CompilingRust'], () => 'Compiling bin' as const) |
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.
Compiling Rust
.with(['Shutdown', 'Running', P.nullish, P._], () => 'Running' as const) | ||
.with(['Provisioning', P.any, P.nullish, P._], () => 'Starting up' as const) | ||
.with(['Initializing', P.any, P.nullish, P._], () => 'Initializing' as const) | ||
.with(['Paused', P.any, P.nullish, 'CompilingSql'], () => 'Compiling sql' as const) |
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.
Compiling SQL
.with(['Paused', P.any, P.nullish, 'CompilingRust'], () => 'Compiling bin' as const) | ||
.with(['Paused', P.any, P.nullish, P._], () => 'Paused' as const) | ||
.with(['Running', P.any, P.nullish, P._], () => 'Running' as const) | ||
.with(['ShuttingDown', P.any, P.nullish, P._], () => 'ShuttingDown' as const) |
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.
Shutting Down
.with(['Shutdown', P.any, P.nullish, 'Success'], () => 'Shutdown' as const) | ||
.with(['Shutdown', P.any, P.select(P.nonNullable), P.any], () => 'Shutdown' as const) | ||
.with(['Shutdown', 'Running', P.nullish, P._], () => 'Running' as const) | ||
.with(['Provisioning', P.any, P.nullish, P._], () => 'Starting up' as const) |
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.
=> 'Provisioning' sounds clearer
I think for logging we should only log (I think there were cases even before this where we logged error! in the manager when we shouldn't have so maybe it's still the same issue) |
Yeah I noticed this too after coming back to the pipeline manager after a while. We shouldn't be spamming error! logs when the user isn't doing anything wrong. So either these are not legitimate errors, and shouldn't be logged, or the UI shouldn't be doing whatever it was that's causing these error logs. |
We could distinguish that error-level log messages should only occur when there was truly an error at the api-server. In this case, the UI is issuing an invalid request (we can diagnose why), so it should get back an HTTP error though (maybe log level should just be info of it though, or even debug). |
For a user it's confusing to see errors in a log if they aren't really errors for him -- for debugging our own code a lower log-level should suffice. Sending HTTP errors back is totally fine, just doesn't need to be logged as an 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.
I read every character!
@@ -0,0 +1,9 @@ | |||
{ |
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.
can we move this out of basedir into web-console?
@@ -117,7 +118,13 @@ fn parquet_output() { | |||
let mut encoder = ParquetEncoder::new( | |||
Box::new(consumer), | |||
config, | |||
Relation::new("TestStruct2", false, TestStruct2::schema(), false), | |||
Relation::new( |
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.
probably should make this a method on teststruct2, but not so important
crates/pipeline-types/src/config.rs
Outdated
@@ -44,6 +41,7 @@ fn default_tracing() -> bool { | |||
|
|||
/// Pipeline configuration specified by the user when creating | |||
/// a new pipeline instance. | |||
/// TODO: change this description |
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.
can it be fixed 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.
Yes, changed to:
/// Overall pipeline configuration.
///
/// It is generated upon the deployment of a pipeline and contains
/// the shape of the overall pipeline configuration.
///
/// Its input and output endpoints are generated based on the schema
/// of the compiled program. The runtime configuration is directly
/// provided by the user. Storage configuration, if applicable,
/// is set by the runner.
@@ -74,6 +72,16 @@ pub struct PipelineConfig { | |||
pub outputs: BTreeMap<Cow<'static, str>, OutputEndpointConfig>, | |||
} | |||
|
|||
impl PipelineConfig { | |||
pub fn from_yaml(s: &str) -> Self { |
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.
doesn't need to be fixed now but maybe we can make an issue to settle on one config format, e.g., keep json everywhere or switch everything to a human friendly format, but ideally not have both
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.
Yes, currently it uses YAML in the database but JSON for the API, I'm in favor of the latter I think
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.
Will make a note of it, but likely not this PR
version: Version, | ||
// REGULAR ENDPOINTS | ||
|
||
/// Extended pipeline descriptor with code being optionally included. |
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.
maybe it should just always have the code?
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.
The motivation is that with many pipelines could become a large response if polled regularly.
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.
It would simplify it though -- let's see in terms of API poll performance how we fare
, body = ErrorResponse | ||
, example = json!(examples::error_duplicate_name())), | ||
(status = BAD_REQUEST | ||
, description = "Pipeline is not shutdown" |
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.
, description = "Pipeline is not shutdown" | |
, description = "Pipeline needs to be shutdown to be modified" |
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.
Done, updated in three places (full update, partial update, and delete).
web-console-sveltekit/README.md
Outdated
- `static/`: Static assets served as-is |
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.
Adding general comment here but we should rm -rf web-console and mv web-console-sveltekit to web-console
Rebased on latest main |
openapi.json
Outdated
@@ -2913,7 +2913,7 @@ | |||
} | |||
} | |||
], | |||
"description": "Pipeline configuration specified by the user when creating\na new pipeline instance.\nTODO: change this description\n\nThis is the shape of the overall pipeline configuration. It encapsulates a\n[`RuntimeConfig`], which is the publicly exposed way for users to configure\npipelines." | |||
"description": "Overall pipeline configuration.\n\nIt is generated upon the deployment of a pipeline and contains\nthe shape of the overall pipeline configuration.\n\nIts input and output endpoints are generated based on the schema\nof the compiled program. The runtime configuration is directly\nprovided by the user. Storage configuration, if applicable,\nis set by the runner." |
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 for the PipelineConfig? The first two sentences are redundant and don't tell the user much about the object. Just say: "Pipeline's runtime configuration, including the number of workers, resource allocations, and connectors used. It represents configuration entries provided by the user (...) and entries derived from the program and system deployment (connectors...)"
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.
It is part of the OpenAPI spec because it is a generated field deployment_config
, which the user has in the extended pipeline descriptor. I agree I wrote it a bit verbose, will adjust the text 👍
@Karakatiza666 the pipeline settings no longer shows after click for me on latest commit Screencast.from.08-01-2024.09.41.06.AM.webm |
@snkas Some bugs to fix. When following the REST API tutorial, I noticed a few things. I created the following file:
|
The biggest downside to making them optional is that any typos will go unnoticed as the property is now optional (e.g., The primary form factor where this is an inconvenience is doing direct API calls, which now that the CURL tutorial is rewritten (thank you :) ) people will use as basis in any case. I'm leaning towards keeping it explicit for now ( |
Replaced with the error:
I've added the relation name now to the error and added that the position is within the string, for example:
Exact positional indication in the SQL program will require additional information from the SQL compiler. |
The compiler can provide the starting point in the source sql program for the connectors string. If that's enough I can add a property to the Metadata json |
Ideally it would be just for each property such that in the future if we have new or different property expectations, it line/column number can be used for those as well. We can for now have a dedicated one for the |
I call everything metadata including the properties themselves |
Signed-off-by: Simon Kassing <simon.kassing@feldera.com>
Signed-off-by: Simon Kassing <simon.kassing@feldera.com>
Signed-off-by: Simon Kassing <simon.kassing@feldera.com>
Signed-off-by: Simon Kassing <simon.kassing@feldera.com>
Signed-off-by: Leonid Ryzhyk <ryzhyk@gmail.com>
Signed-off-by: Leonid Ryzhyk <leonid@feldera.com>
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Signed-off-by: Leonid Ryzhyk <leonid@feldera.com> Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Signed-off-by: Ben Pfaff <blp@feldera.com>
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Switch new web-console to serve from / Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Otherwise if you have a very low rate, it will not insert anything until the batch is full which might take too long for the rate set to produce them. Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Signed-off-by: Leonid Ryzhyk <leonid@feldera.com>
Signed-off-by: Lalith Suresh <lalith@feldera.com>
Signed-off-by: Lalith Suresh <lalith@feldera.com>
This reverts commit 6b165f8.
Signed-off-by: Lalith Suresh <lalith@feldera.com>
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Signed-off-by: Leonid Ryzhyk <leonid@feldera.com>
Signed-off-by: Leonid Ryzhyk <leonid@feldera.com>
API rework which makes the program part of the pipeline and the connectors defined from the SQL.
Removes services fully.
Progress back-end:
Manual database tests-> Will be a subsequent PRUpdate authentication-> New authentication will be a subsequent PRImprove error reporting-> Will be a subsequent PRErrors instead of unwraps where possible-> Will be a subsequent PRProgress UI:
Progress others:
Try it out:
Start the pipeline-manager (note that it will delete all existing pipeline-related tables):
... followed by a Kafka instance:
... followed by running the demo:
Is this a user-visible change (yes/no): yes