Skip to content

Paulescu/taxi-data-api-python

Repository files navigation

Real-World ML

Build and deploy a professional REST API to Kubernetes with Gimlet πŸš€

Table of contents

Our goal

Let’s build and deploy a production-ready REST API that can serve data on historical taxi rides in NYC.

The original data is stored in one-month parquet files on this website, and our goal is to make it easily accessible to the WORLD through a REST API.

How to run the API locally?

Git clone this repository, cd into the root directory of the project and then run the following commands using make.

  1. Install Python Poetry (if necessary) and create an isolated virtual environmnet for development purposes.

    $ make install
    
  2. Test, build and run the dockerized REST API with

    $ make all
    
  3. Check the API is up and running locally, and that you can connect to it

    $ make health-check-local
    
  4. Send a sample request to the local API

    $ make sample-request-local
    

Good job. The API is up and running locally. However, until you don’t deploy it to a production environment, and make it accessible to

  • your clients πŸ’πŸ»β€β™€οΈ
  • your colleagues πŸ‘¨πŸ»β€πŸ’Ό
  • or the whole world 🌏

your real-world impact is ZERO.

Let me show you how to deploy this API to a production Kubernetes cluster.

What is Kubernetes? β˜ΈπŸ“¦

Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of your Dockerized apps

It is currently the most widely used container orchestration platform in the world, and it has become the de facto standard due to its robust features, large community support, and backing from major tech companies.

How to deploy the API to Kubernetes with Gimlet?

Gimlet is a tool that helps you quickly deploy your apps to ANY Kubernetes cluster.

  • You can do it entirely from the Gimlet UI, as explained in this article.

or

How to monitor our API with Elasticsearch and Kibana?

These are the steps:

  1. Spin up Elasticsearch and Kibana with the docker compose
  2. Add middleware to FastAPI app
  3. Build a dashboard with Kibana

See it in action

πŸ‘‰πŸ½ Click here to try the API

Wanna learn more real-world ML?

Join more than 19k builders to the Real-World ML Newsletter. Every Saturday morning.

About

Build and deploy a REST API for taxi trip data πŸš•

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published