Git Product home page Git Product logo

orchid's Introduction

Orchid

It is a microservice Kono used to create news feed, notifications, timeline units to users. The microservice keeps polling AWS SQS, write the feeds generated from other app/service to database.

Installation

  • The project is tested against Go 1.6
  • GOPATH should be set properly
  • Use glide to manage vendor packages. Please see the glide's installation guide.
    • After installing glide, glide install should be good to go.

Configuration

Orchid uses configuration from environment variables. All environment variables start with ORCHID_ prefix. We list the required and optional environment variable for each executable.

bin/newsfeed-writer

  • ORCHID_DYNAMODB_REGION
    • It specifies the AWS DynamoDB resource region. See ORCHID_DYNAMODB_NEWS_FEED_TABLE.
  • ORCHID_DYNAMODB_NEWS_FEED_TABLE
    • The table name into which the news feed document will be inserted.
  • ORCHID_SQS_REGION
    • It specifies the AWS SQS resouce region.
  • ORCHID_SQS_QUEUE_URL
    • The URL of the AWS SQS queue. The workers will compete news feed data from the AWS SQS queue.
  • ORCHID_PARALLEL
    • It specifies the number of worker to activate. The workers will compete message from AWS SQS queue.

bin/notification-writer

  • ORCHID_DYNAMODB_REGION
    • It specifies the AWS DynamoDB resource region. See ORCHID_DYNAMODB_NOTIFICATION_TABLE.
  • ORCHID_DYNAMODB_NOTIFICATION_TABLE
    • The table name into which the notification document will be inserted.
  • ORCHID_SQS_REGION
    • It specifies the AWS SQS resouce region.
  • ORCHID_SQS_QUEUE_URL
    • The URL of the AWS SQS queue. The workers will compete notification data from the AWS SQS queue.
  • ORCHID_PARALLEL
    • It specifies the number of worker to activate. The workers will compete message from AWS SQS queue.

bin/timeline-writer

  • ORCHID_DYNAMODB_REGION
    • It specifies the AWS DynamoDB resource region. See ORCHID_DYNAMODB_TIMELINE_TABLE.
  • ORCHID_DYNAMODB_TIMELINE_TABLE
    • The table name into which the timeline document will be inserted.
  • ORCHID_SQS_REGION
    • It specifies the AWS SQS resouce region.
  • ORCHID_SQS_QUEUE_URL
    • The URL of the AWS SQS queue. The workers will compete timeline data from the AWS SQS queue.
  • ORCHID_PARALLEL
    • It specifies the number of worker to activate. The workers will compete message from AWS SQS queue.

Unit Test

ORCHID_DYNAMODB_REGION=... \
ORCHID_DYNAMODB_NEWS_FEED_TABLE=... \
ORCHID_DYNAMODB_NOTIFICATION_TABLE=... \
ORCHID_SQS_REGION=... \
ORCHID_SQS_QUEUE_URL=... \
go test -v -cover -tags "unit newsfeed notification timeline"

Integration Test

ORCHID_DYNAMODB_REGION=... \
ORCHID_DYNAMODB_NEWS_FEED_TABLE=... \
ORCHID_DYNAMODB_NOTIFICATION_TABLE=... \
ORCHID_SQS_REGION=... \
ORCHID_SQS_QUEUE_URL=... \
go test -v -cover -tags "integration newsfeed notification timeline"

Stop

Send ctrl-c signal to the executable, it will stop until all received messages are consumed.

Deploy

Deploy NewsFeed writer

cd deploy/newsfeed
./deploy_news_feed_writer <deployment-group> <app-version> <s3-bucket>
  • deployment-group: AWS CodeDeploy deployment-group
  • app-version: git tag version
  • s3-bucket: The deploying instance region

Deploy Notification writer

cd deploy/notification
./deploy_notification_writer <deployment-group> <app-version> <s3-bucket>
  • deployment-group: AWS CodeDeploy deployment-group
  • app-version: git tag version
  • s3-bucket: The deploying instance region

Deploy Timeline writer

cd deploy/timeline
./deploy_timeline_writer <deployment-group> <app-version> <s3-bucket>
  • deployment-group: AWS CodeDeploy deployment-group
  • app-version: git tag version
  • s3-bucket: The deploying instance region

orchid's People

Contributors

yu-liang-kono avatar

Watchers

James Cloos avatar  avatar  avatar  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.