Git Product home page Git Product logo

cem-cicd's Introduction

Creating blank BitSwan BSPump application

Prerequisites

  • python3
  • pip
  • docker

Install

Install required libraries:

$ pip install asab bspump 

Clone git repository to your work directory:

$ git clone [email protected]:LibertyAces/BitSwanPump-BlankApp.git bspump-blank-app

Run in docker

Move to the directory (it is bspump-blank-app in our case):

$ cd bspump-blank-app

Then you can build your docker image:

$ docker build -t bspump-blank-app .

Once you have your docker image built, run it in a container:

$ sudo docker run -p 8888:8888 -p 8080:8080 bspump-blank-app

We use port 8888 for TCP Sink and 8080 for web handler in sample pipeline.

Test it works

In new terminal use netCat to connect to TCPSink:

nc -v localhost 8888

Now write any message, "test" for example. You should see your message enriched in docker container stderr.

Or you can try it out using http endpoint. Just call

http://localhost:8080/blank?message=test

Customize

From here you should have your BSPump application up and running. You may go on and customize it to your needs. Basic pipline structure is defined in pipeline init:

    self.build(
        bspump.socket.TCPSource(app, self, config={"host": "0.0.0.0", "port": 8888}),
        ShakespeareanEnricher(app, self),
        bspump.common.PPrintSink(app, self, stream=sys.stderr)
    )

You can see the TCPSource at the beginning, followed by any number of processors, ending with sink. To customize the pipline simply replace any part of it by your own alternative.

You can find more information about available sources, sinks and processors at https://github.com/LibertyAces/BitSwanPump

cem-cicd's People

Contributors

awichera avatar premyslcerny avatar sukicz avatar ateska avatar mpavelka 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.