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

Proofreading the README #22

Open
Galileo-Galilei opened this issue Feb 12, 2024 · 4 comments
Open

Proofreading the README #22

Galileo-Galilei opened this issue Feb 12, 2024 · 4 comments

Comments

@Galileo-Galilei
Copy link
Collaborator

Galileo-Galilei commented Feb 12, 2024

I started to follow the README step by step to try to make it more beginner friendly. The ultimate goal is to have a "copy-pasteable " example so user can try kedroboot out easily. thi is just the beginning, and I'll resume it later.

Here is my journey:

Step 1 : Start from scratch from an empty starter

kedro new --starter=spaceflights-pandas 
pip install kedro-boot==0.2.0
conda create -n temp python=3.10 -y
kedro registry list # warning

PB

Failed to load kedro_boot.app.fastapi.cli commands from EntryPoint(name='fastapi', value='kedro_boot.app.fastapi.cli:fastapi_command', utils.py:11 group='kedro_boot'). Full exception: No module named 'uvicorn'

Solution

pip install -e . # to get pandas and all. This is more du to the starter but confusing

Step 2: try to start a Kedro Server

kedro boot fastapi

PB

no command name fastapi

Solution

This is due to pyctuator not installed => indeed the readme shows "pip install kedro-boot[fastapi]", my bad but the error message is very confusing.

PB 2

"No config patterns were found for 'fastapi' in your config loader" # weird because there is a try/except but it is a MissingConfigError instead of a KeyError

except MissingConfigException:
LOGGER.warning(

Solution 2

  • add empty fastapi.yml

💡 Maybe we should add a "kedro boot fastapi init" command ?

  • update settings.py
CONFIG_LOADER_ARGS = {
    "base_env": "base", # needed
    "default_run_env": "local", # needed
    "config_patterns": {
        "fastapi": ["fastapi*/"],
    },
}

Step 3

The result of the previous step serves on localhost:5000 {"detail":"Not Found"}. this is not niformative. i guess the next step is to create a pydantic model for the dataset to model but this is not very clear.

💡 Maybe we should add a resolver and read it form a metadata in the catalog?

# catalog.yml

my_data: 
    type: ...
    filepath: ...
    metadata: 
        fastapi: 
            schema: ${pydantic:path/to/file.py}
@takikadiri
Copy link
Owner

Step 1 and 2 are normally solved. The code is in the main branch. Can you please repass those tests on it before the patch release ?

I'll keep this issue open as it aim at more higher level goal (have a "copy-pasteable" example)

@Galileo-Galilei
Copy link
Collaborator Author

Overall, I get all the information needed in the README, but it is quite hard to follow because it introduces a lot of concepts and we have to go back and forth to understand what to do and how theses concepts are related.

I think it is important to be able to read the README from top to bottom linearly, evntually not explaining all concepts (we can refer to other sections), because it helps to have something "just working" to try out instead of having to understand concepts first.

My preference order to introduce concetps would go like this :

  1. Standalone mode
    1. Introduce KedroBootSession ("standalone mode) and give examples of how one can use it
    2. Introduce some lightweight explanation about the CompilationSpecs with examples
  2. KedroBoot Apps
    1. Introduce the app concept and give examples and taht it inherits automatically from a KedroBootSession
    2. Introduce the mapping between CompilationSpecs and namespaced pipeline, and finally an example of an app running from end to end

@m-gris
Copy link
Contributor

m-gris commented Apr 2, 2024

In the Monte Carlo Section:

kedro boot --app monte_carlo_pi.app.MonteCarloApp --pipeline monte_carlo

Usage: kedro boot [OPTIONS] COMMAND [ARGS]...
Try 'kedro boot -h' for help.

Error: No such option: --app

The run command is missing. It should therefore be:

kedro boot run --app monte_carlo_pi.app.MonteCarloApp --pipeline monte_carlo

@m-gris
Copy link
Contributor

m-gris commented Apr 2, 2024

In Use Case 1 code example

from kedro_boot.framework.compilation.specs import CompilationSpec

ModuleNotFoundError: No module named 'kedro_boot.framework.compilation

The import could be updated to

from kedro_boot.framework.compiler.specs import CompilationSpec

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

No branches or pull requests

3 participants