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

pipeline-manager: add a config API endpoint to get a list of canned demo URLs #1385

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

lalithsuresh
Copy link
Collaborator

@lalithsuresh lalithsuresh commented Feb 4, 2024

Signed-off-by: Lalith Suresh lalith@feldera.com

Is this a user-visible change (yes/no): yes

@snkas
Copy link
Contributor

snkas commented Feb 7, 2024

  • Canned demo endpoint now returns a list of JSON objects of type:

    [
      {
          "title": "...",
          "description": "...",
          "url": "..."
      },
      ...
    ]
    
  • Added a first canned demo: warehouse

  • Rebased against main (kept the Cargo.lock changes)

  • Minor comment and text changes

@snkas
Copy link
Contributor

snkas commented Feb 7, 2024

Command to run it directly:

cargo run --bin=pipeline-manager --features pg-embed -- --dev-mode --canned-demos='{"title": "Warehouse", "description": "Use case of a warehouse that stores product items which are bought and sold.", "url": "https://raw.githubusercontent.com/feldera/feldera/features/demo/demos/warehouse/demo.json"}'

... and then you can check the endpoint using:

curl -X GET 'http://localhost:8080/v0/config/demos' | jq

@lalithsuresh
Copy link
Collaborator Author

@snkas My understanding was that the title and description will be encoded in the json file that describes the demo. I don't think we need to repeat that in the CLI argument here. Besides, it'll be a pain to render via Helm with all the escaping. :)

@snkas
Copy link
Contributor

snkas commented Feb 8, 2024

@lalithsuresh , @Karakatiza666 had a strong preference to have the name and description be part of the demo list itself I think for UI placeholders while the demo JSON is loaded in. I agree it becomes a pain in terms of escaping when passing serialized JSON... We can keep it a list of URLs in this first version and then revisit it later on. What do you think @Karakatiza666 ?

@snkas
Copy link
Contributor

snkas commented Feb 8, 2024

Reverted to just a list of strings (URLs).

@snkas
Copy link
Contributor

snkas commented Feb 8, 2024

Split off the canned demo warehouse to separate PR: #1401

Command to run it directly:

cargo run --bin=pipeline-manager --features pg-embed -- --dev-mode --canned-demos=https://raw.githubusercontent.com/feldera/feldera/canned-demo-warehouse/demo/demos/warehouse/demo.json

... and then you can check the endpoint using:

curl -X GET 'http://localhost:8080/v0/config/demos' | jq

snkas added a commit that referenced this pull request Feb 8, 2024
…emo URLs (#1385)

Co-authored-by: Lalith Suresh <lalith@feldera.com>
Signed-off-by: Lalith Suresh <lalith@feldera.com>
Signed-off-by: Simon Kassing <simon.kassing@feldera.com>
@snkas
Copy link
Contributor

snkas commented Feb 8, 2024

Ready for final review

Notes:

  • There is not yet a --canned-demos <...> argument added to the pipeline-manager in the docker-compose.yml because (1) test-docker-compose-stable will not work as the previous image does not have the argument, and (2) there are not yet any canned demos merged into main.
    As such, the demos tab will be empty in the docker compose for now when building from source.
  • My idea is the following: leave the docker-compose.yml have no --canned-demos <...> argument until the next release, at which point afterwards (after the release) I update the docker-compose.yml with the --canned-demos <...> of all the canned demos we have merged into main till then.
  • Added CHANGELOG entry
  • @lalithsuresh : I kept the Cargo.lock changes from your original commit

@snkas snkas mentioned this pull request Feb 8, 2024
@snkas snkas requested a review from ryzhyk February 8, 2024 19:04
crates/pipeline_manager/src/api/config_api.rs Outdated Show resolved Hide resolved
security(("JSON web token (JWT) or API key" = [])),
tag = "Configuration",
)]
#[get("/config/demos")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this have to be under /config? Seems like demos should be a separate tag.

Copy link
Contributor

Choose a reason for hiding this comment

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

The reasoning is I think that it is part of the configuration with which you start the pipeline-manager (it is provided as a command-line argument), as such you fetch it from the config.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I get it. I do think it's a bit of a stretch, but I'm ok with it.

snkas added a commit that referenced this pull request Feb 8, 2024
…emo URLs (#1385)

Co-authored-by: Lalith Suresh <lalith@feldera.com>
Signed-off-by: Lalith Suresh <lalith@feldera.com>
Signed-off-by: Simon Kassing <simon.kassing@feldera.com>
snkas added a commit that referenced this pull request Feb 8, 2024
Co-authored-by: Lalith Suresh <lalith@feldera.com>
Signed-off-by: Lalith Suresh <lalith@feldera.com>
Signed-off-by: Simon Kassing <simon.kassing@feldera.com>
Co-authored-by: Lalith Suresh <lalith@feldera.com>
Signed-off-by: Lalith Suresh <lalith@feldera.com>
Signed-off-by: Simon Kassing <simon.kassing@feldera.com>
@snkas
Copy link
Contributor

snkas commented Feb 8, 2024

Rebased with main, awaiting CI to pass to merge.

Changes:

  • Rebasing
  • "self-describe" -> "describe"
  • Removed "canned"

@snkas snkas merged commit 61e5097 into main Feb 8, 2024
5 checks passed
@snkas snkas deleted the features branch February 8, 2024 20:50
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.

None yet

4 participants