Code Monkey home page Code Monkey logo

bytewax-hopsworks-example's Introduction

Compute and store real-time features for crypto trading with Python

Let's connect 🤗
Twitter â€ĸ LinkedIn â€ĸ Newsletter

Table of contents

  1. What is this repo about?
  2. How to run this code
  3. Wannna build real-world ML products?

What is this repo about?

This repository shows how to

  • fetch real-time trade data (aka raw data) from the Coinbase Websocket API
  • transform trade data into OHLC data (aka features) in real-time using Bytewax, and
  • store these features in a serverless Feature Store like Hopsworks.

This repository is a natural continuation of this previous project where we built a Streamlit app with real-time feature engineering, but lacked state persistence: after each re-load of the Streamlit app, we lost all features generated up to that point.

In this project we add state to our system through a a Feature Store. We use Hopsworks because

  • it is serverless, so we do not need to handle infrastructure
  • it has a very generous free tier, with up to 25GB of free storage.

How to run this code

  1. Create a Python virtual environment with the project dependencies with

    $ make init
    
  2. Set your Hopsworks project name and API key as environment variables by running the following script (to generate these head to hopsworks.ai, create a free account, create a project and generate an API key for free)

    $ . ./set_environment_variables.sh
    
  3. To run the feature pipeline locally

    $ make run
    
  4. To deploy the feature pipeline on an AWS EC2 instance you first need to have an AWS account and the aws-cli tool installed in your local system. Then run the following command to deploy your feature pipeline on an EC2 instance

    $ make deploy
    
  5. Feature pipeline logs are send to AWS CloudWatch. Run the following command to grab the URL where you can see the logs.

    $ make list
    
  6. To shutdown the feature pipeline on AWS and free resources run

    $ make delete
    

ℹī¸ Implementation details

  • We use Bytewax as our stream-processing engine and the waxctl command line tool to deploy our dataflow to EC2.

  • If you want to deploy the pipeline to a Kubernetes cluster, you will need to adjust the arguments passed to waxctl in the Makefile. Check the documentation here to learn how.

Wannna build real-world ML products?

Check the Real-World ML Program, a hands-on, 3-hour course where you will learn how to design, build, deploy, and monitor complete ML products.

bytewax-hopsworks-example's People

Contributors

paulescu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.