Code Monkey home page Code Monkey logo

rsong-proxy's Introduction

GitHub Logo

RSong Proxy

This repository is archived in favor of rsong

A client facing REST layer to proxy RSong requests to RSongs Rholang contracts.

RSong is implemented as a combination of multiple microservices and their interactions. These microservices are:

  • rsong-acquisition
  • rsong-proxy
  • rosng-microbatch

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system

Prerequisites

Installs

clone and build the project

git clone [email protected]:rchain/rsong-proxy.git
cd rsong-proxy
sbt compile

Running the project locally

To run the project locally:

  • set the environment variables
  • run the docker

Alternatively you may build and run the project from source code.

Environment variables

To run the project locally, configure your environment variables:

##
export LOCAL_GRPC='localhost'
export GCP_GRPC='dd.dd.dd.dd'
export AWS_GRPC='dd.dd.dd.dd'
export DOCKER_GRPC='172.17.0.2'
export HTTP_PORT=9000
export GRPC_SERVER=$LOCAL_GRPC
export GRPC_PORT_INTERNAL=40404
export GRPC_PORT_EXTERNAL=40401
export PRD_K8='http://prd-rchain.com'
export DEV_K8='http://dev-rchain.com'
export LOCAL_K8='http://localhost'
export HOST_URL=$LOCAL_K8

You may consider using direnv to manage projects environment variables

Run the docker image

Circle CI build process publishes the rsong-proxy docker image to docker hub. To run the image:

sccripts/docker-run.sh

Running the Source code

sbt clean compile run
## to create a local dokcer image
sbt clean compile docker:stage docker:publishLocal
docker images | grep 'rsong-proxy'

Running tests:

tests are:

  • unit tests
  • integration tests

Unit tests

sbt clean test

Integration tests

  • configure .envrc for both rsong-proxy and rsong-acquisition are configured for the same node instance
  • execute rsong-acquisition to migrate the song data to node
  • build rsong-proxy and run integration tests
Execute rsong-acquisition
cd ../rsong-acquisition
## make sure rsong-acquisition & rsong-proxy are using the same node
sbt clean compile universal:packageBin
cd target/universal && unzip ./rsong-acquisition-1.2-SNAPSHOT && cd rsong-acquisition-1.2-SNAPSHOT
./bin/rsong-acquisition
Execute rsong-proxy integration tests

Integration tests are run by the python script rsong-int-tests.py.
The scripts assumes requests is installed.

sbt clean compile run
## from a different terminal:
./scripts/rsong-int-tests.py localhost:9000

url Inventory

host='localhost:9000'

## create a new user 
curl -X POST $host/v1/user/<user_id>

## retrieve  user  object
curl  $host/v1/user/<user_id>

## retrive a user's song
curl -v  GET $host/v1/song/song1?userId=123 | jq

##  retrive user's songs
curl -v  GET $host/v1/song\?userId=user123\&perPage=10\&page=1 | jq

for asset urls, see output from:

curl GET $host/v1/song/song1?userId=123 | jq

Built With

circle-ci

Runtime env

  • rnode
  • rsong-proxy

rnode

rnode is build from the latest rchain dev branch deployed to GCP. This is a single instance at this time.

rsong-proxy

rsong-proxy runs on kubernetes-cluster on GCP See deployment-prd-spec for more detail

References

rsong-proxy's People

Contributors

dckc avatar kayvank avatar kentshikama avatar pyrocto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rsong-proxy's Issues

upgrade rsong-acquisition to node 0.8.4

Summary:

upgrade to node 0.8.4

Detail:

upgrade to node 0.8.4

Required tasks are:

  • upgrading the rsong rnode
  • modify the classpath for the new rchain-0.8.4 libraries
  • modify for node api changes

migrate Rsong-prosy to RChain kubernetes account.

Summary:

migrate to RChain kubernetes account.

Detail:

RSong app was developed under my GCP account, kayvan. Simple transfer of project to Rchain GCP account is not possible without involving and creating Google tickets.

Required-Work

create a new k8 kluster
create a new VM for rnode
create required dns names
create required ingress and tls

create new repo for rsong-admin

Summary:

create new git hub repo for rsong-admin

Detail

create new git hub repo for rsong-admin as such

  • master branch is protect & will require code review before merge
  • open source

create a GCP CI/CD pipeline for Rsong-proxy

Summary

crate ci/cd gcp pipeline for rsong-proxy.

Detail

Expectations are:

  • gcp universal docker registry
  • automatic deployment for k8 cluster from master-branch
  • no manual work for deployments

create GCP web infrastructure to

Summary:

create GCP infrastructure to support Rsong web components

Detail:

Create GCP infrastructure to support RSong related apps

  • kubernetes cluster
  • ingress to forward traffic to back-end components
  • ssl /tls support

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.