Sion code for review.

Sion

Sion is an elastic, high-performance, cost-effective cloud storage that is built atop ephemeral cloud funtions.

Prepare

  • EC2 Proxy

    Amazon EC2 AMI: ubuntu-xenial-16.04

    Golang version: 1.16

    Be sure the port 6378 - 6379 is avaiable on the proxy

    We recommend that EC2 proxy and Lambda functions are under the same VPC network, and deploy Sion on a EC2 instance with high bandwidth (c5n family will be a good choice).

  • Golang install

    Jump to install_go.md

  • Package install

    Install basic package

    sudo apt-get update
    sudo apt-get -y upgrade
    sudo apt install awscli
    sudo apt install zip

    Clone this repo

    go get -u github.com/sionreview/sion

    Run aws configure to setup your AWS credential.

    aws configure
  • Lambda Runtime

    Lambda Role setup

    Go to AWS IAM console and create a role for the lambda cache node (Lambda function).

    AWS IAM console -> Roles -> Create Role -> Lambda ->

    AWSLambdaFullAccess,

    AWSLambdaVPCAccessExecutionRole,

    AWSLambdaENIManagementAccess

    Enable Lambda internet access under VPC

    Plese refer to this article. (You could skip this step if you do not want to run InfiniCache under VPC).

  • S3

    Create the S3 bucket to store the zip file of the Lambda code and data output from Lambda functions. Remember the name of this bucket for the configuration in next step.

  • Configuration

    Lambda function create and config

    Edit deploy/create_function.sh and deploy/update_function.sh

    PREFIX="your lambda function prefix"
    S3="your bucket name"
    cluster=1000 # number of lambda for window rotation.
    mem=1536

    Edit destination S3 bucket in lambda/config.go, these buckets are for data collection and durable storage.

    S3_COLLECTOR_BUCKET = "your data collection bucket"
    S3_BACKUP_BUCKET = "your COS bucket"

    Edit the aws settings and the VPC configuration in deploy/deploy_function.go. If you do not want to run InfiniCache under VPC, you do not need to modify the subnet and securityGroup settings.

    ROLE = "arn:aws:iam::[aws account id]:role/[role name]"
    REGION = "us-east-1"
    ...
    ...
    subnet = []*string{
      aws.String("your subnet 1"),
      aws.String("your subnet 2"),
    }
    securityGroup = []*string{
      aws.String("your security group")
    }

    Run script to create and deploy lambda functions (Also, if you do not want to run InfiniCache under VPC, you need to set the vpc flag to be false in deploy/create_function.sh).

    export GO111MODULE="on"
    go get
    deploy/create_function.sh 600

    Proxy configuration

    Edit proxy/config/config.go, change the aws region, deployment size, and prefix of the Lambda functions.

    const AWSRegion = "us-east-1"
    const LambdaMaxDeployments = 1000 // Number of lambda for window rotation.
    const LambdaPrefix = "Your Lambda Function Prefix"
    const ServerPublicIp = ""  // Leave it empty if using VPC.

Execution

  • Proxy server

    Run make start to start proxy server. make start would print nothing to the console. If you want to check the log message, you need to set the debug flag to be true in the proxy/proxy.go.

    make start

    To stop proxy server, run make stop. If make stop is not working, you could use pgrep proxy, pgrep go to find the pid, and check the infinicache pid and kill them.

  • Client library

    The toy demo for Client Library

    go run client/example/main.go

    The result should be

    ~$ go run client/example/main.go
    2020/03/08 05:05:19 EcRedis Set foo 14630930
    2020/03/08 05:05:19 EcRedis Got foo 3551124 ( 2677371 865495 )
  • Stand-alone local simulation

    Enable local function execution by editing lambda/config.go:

    DRY_RUN = true

    Run make start-local to start a stand-alone local proxy server, which will invoke functions locally to simulation Lambda execution.

    Run make test to put/get a toy object.

Similar Resources

Source code for trevor-edris.io

about-me - Source code for trevor-edris.io A large majority of the base code for this project has been adapted from https://github.com/mikestefanello/

Jan 20, 2022

Bitfield - A collection of code samples, listings, and solutions to challenges from the book For the Love of Go

Bitfield - A collection of code samples, listings, and solutions to challenges from the book For the Love of Go

For the Love of Go - code listings This is a collection of code samples, listing

Jan 10, 2022

Cleanv - Golang SDK for Vue Projects. It is able to structure a clean code/arch pattern

Cleanv - Golang SDK for Vue Projects.  It is able to structure a clean code/arch pattern

Cleanv - Golang SDK for Vue Projects Why? This project is part of my personal portfolio, so, I'll be happy if you could provide me any feedback about

Apr 24, 2022

Aws-cognito-demo-go - Source code for AWS Cognito in Go

AWS Cognito Demo in Go Source code for YouTube series, AWS Cognito in Go - https

Dec 10, 2022

Edtienda - PayPal Integration Course Code

PayPal Integration Para ejecutar el cรณdigo debes realizar los siguientes pasos:

Feb 3, 2022

This package includes various utilities and extensions for your Go code.

Go utilities This package includes various utilities and extensions for your Go code. Inspired by lodash Install go get github.com/murat/go-utils@mast

May 11, 2022

Year-end-review - enables those want to look back on PRs at the end of year to review PRs and the comments as single Markdown file.

year-end-review year-end-review enables those want to look back on PRs at the end of year to review PRs and the comments as single Markdown file. HOW

Dec 31, 2021

SionReplayer is the workload replayer for SION project.

SionReplayer SionReplayer is the workload replayer for SION project. Simulation A sample of IBM docker registry trace is included. To run the simulati

Jan 13, 2022

๐Ÿถ Automated code review tool integrated with any code analysis tools regardless of programming language

๐Ÿถ Automated code review tool integrated with any code analysis tools regardless of programming language

reviewdog - A code review dog who keeps your codebase healthy. reviewdog provides a way to post review comments to code hosting service, such as GitHu

Jan 2, 2023

A Golang tool that does static analysis, unit testing, code review and generate code quality report.

A Golang tool that does static analysis, unit testing, code review and generate code quality report.

goreporter A Golang tool that does static analysis, unit testing, code review and generate code quality report. This is a tool that concurrently runs

Jan 8, 2023

๐Ÿ”Ž Help find Trojan Source vulnerability in code ๐Ÿ‘€ . Useful for code review in project with multiple collaborators

TrojanSourceFinder TrojanSourceFinder helps developers detect "Trojan Source" vulnerability in source code. Trojan Source vulnerability allows an atta

Nov 9, 2022

๐Ÿถ Automated code review tool integrated with any code analysis tools regardless of programming language

๐Ÿถ Automated code review tool integrated with any code analysis tools regardless of programming language

reviewdog - A code review dog who keeps your codebase healthy. reviewdog provides a way to post review comments to code hosting service, such as GitHu

Jan 7, 2023

GitHub Review Stats

gh-review-stats - GitHub Review Stats A command line tool for examining review statistics for GitHub repositories. Installing Download a pre-built bin

Jul 21, 2022

A command-line to create a pull request to review the entire content of a Github repository.

Pull Request Me Pull Request Me (PRMe) creates a pull request for the entire content of a Github repository. This is useful to solicit review comments

Nov 2, 2021

Send Slack reports of pull requests pending review

Send Slack reports of pull requests pending review

preport Born out of a desire to get pull requests reviewed faster without having to send manual reminders, preport generates reports of GitLab pull re

Nov 23, 2021

Snitch - a Slack bot that fetches pending review PRs built in Go

Snitch - a Slack bot that fetches pending review PRs built in Go

Snitch Snitch is a Slack bot that fetches and publish PRs with pendings reviews

Nov 29, 2022

Easy creation of review tasks for the Jira with a Discord notifications.

easy-jira-task-review Easy creation of review tasks for the Jira with a Discord notifications. Any ideas and help are welcome Installation Install go

Dec 1, 2022

Github cli extension to approve or reject pending deployments that are waiting for review.

gh-deploy A gh cli extension to approve or reject pending deployments that are waiting for review. Installation Installation requires a minimum versio

Nov 2, 2022
"there" also called "GoThere" aims to be a simple Go Library to reduce redundant code for REST APIs.

there "there" also called "GoThere" aims to be a simple Go Library to reduce redundant code for REST APIs. Despite the existence of the other librarie

Dec 25, 2022
A compute service that lets you run code without provisioning or managing servers

AWS Lambda for Go Lambda is a compute service that lets you run code without provisioning or managing servers. Lambda runs your code on a high-availab

Oct 13, 2021
Pulumi - Modern Infrastructure as Code. Any cloud, any language ๐Ÿš€
Pulumi - Modern Infrastructure as Code. Any cloud, any language ๐Ÿš€

Pulumi's Infrastructure as Code SDK is the easiest way to create and deploy cloud software that use containers, serverless functions, hosted services,

Dec 30, 2022
Go client library for efficient postal code lookup (powered by GeoNames)

go-poco Client library for efficient postal code lookup (powered by GeoNames) Installation go-poco may be installed using the go get command: go get g

Dec 23, 2021
Fetch input data for Advent of Code challenges.

Import the inputs for Advent of Code challenges straight into your code. Fetched data is cached by default. Usage Log into Advent of Code from your br

Oct 12, 2022
An unofficial package in Golang to help developers implement ZATCA (Fatoora) QR code easily.

Zatca SDK GO An unofficial package in Golang to help developers to implement ZATCA (Fatoora) QR code easily which required for e-invoicing โœ… The hash

Jan 1, 2023
Us-api: a simple service that returns the US state code based on the state

us-api us-api is a simple service that returns the US state code based on the state. It does not support creating, updating nor deleting data. Local D

Dec 13, 2021
Example code to demonstrate how to mock external clients via context.Context

Mocking external client libraries using context.Context This code is paired with a blog post: Mocking external client libraries using context.Context

Nov 6, 2022
This repository will have code implemented for the 100 days of golang.

golang_100 This repository will have code implemented for the 100 days of golang. The resources I will use to do this 100 days golang programming are:

Jan 10, 2022
A YANG-centric Go toolkit - Go/Protobuf Code Generation; Validation; Marshaling/Unmarshaling
A YANG-centric Go toolkit - Go/Protobuf Code Generation; Validation; Marshaling/Unmarshaling

Introduction ygot (YANG Go Tools) is a collection of Go utilities that can be used to: Generate a set of Go structures and enumerated values for a set

Jan 8, 2023