Code Monkey home page Code Monkey logo

beamlinejs's Introduction

BeamlineJS

"In accelerator physics, a beamline refers to the trajectory of the beam of accelerated particles, including the overall construction of the path segment (vacuum tube, magnets, diagnostic devices) along a specific path of an accelerator facility. This part is either

  • the line in a linear accelerator along which a beam of particles travels, or
  • the path leading from a cyclic accelerator to the experimental endstation (as in synchrotron light sources or cyclotrons)."

BeamlineJS will accelerate the build, test, release and deployment of node.js based lambda functions across various facilities (regions).

Highlights

  • Auto-scaleable (AWS Lambda) and multi-region availability.
  • Ability to setup BeamlineJS in multiple regions.
  • Automatically create pull request to merge from fork into develop branch and from develop branch to master (read further to see the Git branching model it uses).
  • Development and QA (staging) pipeline are started automatically when merge of PR is successful on the respective branch.
  • Manages lambda function versioning and aliases.
  • Handles rollbacks in case of failures.
  • Verifies the SHA256 of lambda function’s code and configuration.
  • Uses NodeJS frameworks to run unit, functional (QA), integration and load tests.
  • Sends slack notifications
  • function code is released in S3 bucket
  • Multi region testing at fork, development, staging (qa) and production pipelines.

Coming soon

  • BeamlineJ - CI/CD pipeline for AWS Lambda function with Java runtime
  • BeamlinePY - CI/CD pipeline for AWS Lambda function with Python runtime

Architecture

alt text

CI/CD Flow

alt text

Versioning & Aliases

alt text

Setup Beamline

You can setup your own Beamline by following below simple steps. Please note that for Beamline to work you will have to create accounts using vendor services that may result in $$ cost. Please go through the pricing model of each services offered by the vendors prior to using these services.

It will create following three AWS Lambda functions:

This function is used for sending Slack notifications to your slack channel(s).

This function manages the overall execution of BeamlineJS. It parses the GitHub event and then initiates the pipeline based on the event.

This function will perform the continuous integration and deployment of CLIENT based on the Beamline configuration provided by the CLIENT.

CLIENT- Is the AWS Lambda function which will use BeamlineJS functions to perform its automated build, test and deployment activities.

Prerequisites

Setup

I have tested these steps only on MAC. I don't see a reason why it will not work on Windows. You will need something like GitBash to run these steps on Windows

  • Clone BeamlineJS repository on your local machine
git clone https://github.com/GaurangBhatt/BeamlineJS.git
  • Navigate into your cloned repository's home directory and run following commands

    • Copy setup.properties.rename file and create setup.properties file

      cp setup.properties.rename setup.properties
      
      • Update setup.properties file to change
        • AWS_PROFILE_NAME - name of your configured profile using AWS Secret key and access key
        • INFRASTRUCTURE_PREFIX - to any string value of your choice
        • GITHUB_PERSONAL_TOKEN - to your personal token
        • S3_BUCKET_NAME - name of your S3 bucket
        • AWS_REGIONS - provide comma separated list of all regions where you want to install/setup BeamlineJS
        • PRIMARY_AWS_REGION - Set the primary region. This will integrate the SNS topic of this region to your repository via repository hooks
        • REPOSITORY_HOOKS_URLS - comma separated list of all repository hook URLs to which you want to add Amazon SNS integration
    • Update beamline-env-variables.json and pipeline-manager-env-variables.json file

      • Change FUNCTION_PREFIX to INFRASTRUCTURE_PREFIX value from setup.properties
    • Install and setup BeamlineJS

      chmod +x setup.sh
      ./setup.sh
      
    • Uninstall BeamlineJS

      chmod +x uninstall.sh
      ./uninstall.sh
      
    • Create Amazon SNS integration with your repository If you want to disable the hook then set active=false

      curl -v -b -X POST \
      -H "Content-Type: application/json" \
      -H "Authorization: token ${GITHUB_PERSONAL_TOKEN}" \
      -d '{
        "name": "amazonsns",
        "active": true,
        "events": ["push", "pull_request"],
        "config": {
          "aws_key": "'"${AWS_ACCESS_KEY}"'",
          "aws_secret": "'"${AWS_SECRET_KEY}"'",
          "sns_topic": "'"${snsTopicARN}"'",
          "sns_region": "'"${PRIMARY_AWS_REGION}"'"
        }
      }' \
      "${REPOSITORY_HOOK_URL}"
      

beamlinejs's People

Contributors

gaurangbhatt avatar

Watchers

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