diff --git a/mlops/unit_4_triggering/markdowns/__init__.py b/mlops/unit_4_triggering/markdowns/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/mlops/unit_4_triggering/markdowns/online_inference_guide.md b/mlops/unit_4_triggering/markdowns/online_inference_guide.md new file mode 100644 index 000000000..674738ebf --- /dev/null +++ b/mlops/unit_4_triggering/markdowns/online_inference_guide.md @@ -0,0 +1,37 @@ +# Sample online inference + +Use the following CURL command to get real-time predictions: + +```curl +curl --location 'http://localhost:6789/api/runs' \ +--header 'Authorization: Bearer fire' \ +--header 'Content-Type: application/json' \ +--header 'Cookie: lng=en' \ +--data '{ + "run": { + "pipeline_uuid": "predict", + "block_uuid": "inference", + "variables": { + "inputs": [ + { + "DOLocationID": "239", + "PULocationID": "236", + "trip_distance": 1.98 + }, + { + "DOLocationID": "170", + "PULocationID": "65", + "trip_distance": 6.54 + } + ] + } + } +}' +``` + +## Note + +The `Authorization` header is using this pipeline’s API trigger’s token value. +The token value is set to `fire` for this project. +If you create a new trigger, that token will change. +Only use a fixed token for testing or demonstration purposes. \ No newline at end of file diff --git a/mlops/unit_4_triggering/pipelines/predict/metadata.yaml b/mlops/unit_4_triggering/pipelines/predict/metadata.yaml index 1be72d5a8..d57819fa5 100755 --- a/mlops/unit_4_triggering/pipelines/predict/metadata.yaml +++ b/mlops/unit_4_triggering/pipelines/predict/metadata.yaml @@ -19,6 +19,23 @@ blocks: type: global_data_product upstream_blocks: [] uuid: model +- all_upstream_blocks_executed: true + color: null + configuration: + file_source: + path: unit_4_triggering/markdowns/online_inference_guide.md + downstream_blocks: [] + executor_config: null + executor_type: local_python + has_callback: false + language: markdown + name: online inference guide + retry_config: null + status: updated + timeout: null + type: markdown + upstream_blocks: [] + uuid: online_inference_guide - all_upstream_blocks_executed: true color: teal configuration: