Code Monkey home page Code Monkey logo

pyflink-getting-started's Introduction

Pyflink - The Python Apache Flink Interpreter

This repository will include code examples and walkthroughs for the following common tasks:

Thank you to @kremrik for the helpful miniconda instructions below.


Table of Contents

  1. ๐Ÿ’ป ย  ย  Local Development using Pyflink
  2. ๐Ÿ“ฆ ย  ย  Packaging your Pyflink Application for use with Kinesis Data Analytics for Apache Flink
  3. ๐Ÿš€ ย  ย  Deploying and running your Pyflink Application to Kinesis Data Analytics for Apache Flink
  4. ๐Ÿ“„ ย  ย  Logging in a Pyflink Application, and where to see those logs in Kinesis Data Analytics for Apache Flink
  5. ๐Ÿ”ง ย  ย  Basic Troubleshooting and Monitoring


Prerequisites

  1. Install Miniconda with Dependencies

    1. Follow the instructions here to download to your machine.

      bash Miniconda3-latest-MacOSX-x86_64.sh

      This is for my case, but verify yours!

    2. Ensure that you prepend miniconda to your PATH, in your .bashrc or elsewhere:

      export PATH=~/miniconda3/bin:$PATH

      Then type:

      source ~/.bashrc
    3. Verify your path has been setup correctly after sourcing your .bashrc by typing:

      which python
      > /home/$USER/miniconda3/bin/python
    4. Once installed, create a virtual environment to use for your flink environment:

      conda create -n my-new-environment pip python=3.8

      This creates a new conda environment with pip installed. The pip at the end of this documentation ensures that when running pip install commands, they are installed to the correct location.

      I've found that python 3.9 > doesn't play nicely with some of the Apache Flink dependencies, so just specify 3.8.

    5. After creating your new environment, activate it by typing:

      conda activate my-new-environment

      Then verify that the correct pip is being used:

      which pip
      > /home/$USER/miniconda3/envs/my-new-environment/bin/pip

      Once this is set up, installing modules like apache-flink is as simple as typing pip install apache-flink, which will install it into your miniconda environment.

      Go ahead and install apache-flink since we'll need it for the rest of this exercise.

      (my-new-environment) $ pip install apache-flink==1.15.2

Additional Note: Please validate that you are either using Java 8 or Java 11 when running examples. There are compatibility issues with later versions of Java due to the Py4j libary calling out to the Kinesis Connector.

(my-new-environment) jdber@147dda1bd4b4 ~ % java -version
openjdk version "11.0.9.1" 2020-11-04 LTS
OpenJDK Runtime Environment Corretto-11.0.9.12.1 (build 11.0.9.1+12-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.9.12.1 (build 11.0.9.1+12-LTS, mixed mode)

Continue on to Getting Started!

pyflink-getting-started's People

Contributors

jeremyber-aws avatar amazon-auto avatar qingl-aws avatar shehoque 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.