Coder Social home page Coder Social logo

kongjustin / app-autoscaler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloudfoundry/app-autoscaler

0.0 1.0 0.0 5.57 MB

Auto Scaling for CF Applications

License: Apache License 2.0

JavaScript 27.42% Shell 0.21% Java 26.25% Go 46.13%

app-autoscaler's Introduction

App-AutoScaler Build Status

This is an incubation project for Cloud Foundry. You can follow the development progress on Pivotal Tracker.

The App-AutoScaler provides the capability to adjust the computation resources for Cloud Foundry applications through

  • Dynamic scaling based on application performance metrics
  • Scheduled scaling based on time

The App-AutoScaler is provided as a Cloud Foundry service offering. Any application bound with App-AutoScaler service will be able to use it. It has the following components:

  • api : provides public APIs to manage scaling policy
  • servicebroker: implements the Cloud Foundry service broker API
  • metricscollector: collects container's memory usage
  • eventgenerator: aggreates memory metrics, evaluates scaling rules and triggers events for dynamic scaling
  • scheduler: manages the schedules in scaling policy and trigger events for scheduled scaling
  • scalingengine: takes the scaling actions based on dynamic scaling rules or schedules

Development

System requirements

Database requirement

The App-AutoScaler uses Postgres as the backend data store. To download and install, refer to PostgreSQL web site.

Setup

To set up the development, firstly clone this project

$ git clone https://github.com/cloudfoundry-incubator/app-autoscaler.git
$ cd app-autoscaler
$ git submodule update --init --recursive

Initialize the Database

createuser postgres -s
psql postgres://[email protected]:5432 -c 'DROP DATABASE IF EXISTS autoscaler'
psql postgres://[email protected]:5432 -c 'CREATE DATABASE autoscaler'

mvn package
java -cp 'db/target/lib/*' liquibase.integration.commandline.Main --url jdbc:postgresql://127.0.0.1/autoscaler --driver=org.postgresql.Driver --changeLogFile=api/db/api.db.changelog.yml update
java -cp 'db/target/lib/*' liquibase.integration.commandline.Main --url jdbc:postgresql://127.0.0.1/autoscaler --driver=org.postgresql.Driver --changeLogFile=servicebroker/db/servicebroker.db.changelog.json update
java -cp 'db/target/lib/*' liquibase.integration.commandline.Main --url jdbc:postgresql://127.0.0.1/autoscaler --driver=org.postgresql.Driver --changeLogFile=scheduler/db/scheduler.changelog-master.yaml update
java -cp 'db/target/lib/*' liquibase.integration.commandline.Main --url jdbc:postgresql://127.0.0.1/autoscaler --driver=org.postgresql.Driver --changeLogFile=scheduler/db/quartz.changelog-master.yaml update
java -cp 'db/target/lib/*' liquibase.integration.commandline.Main --url jdbc:postgresql://127.0.0.1/autoscaler --driver=org.postgresql.Driver --changeLogFile=src/autoscaler/metricscollector/db/metricscollector.db.changelog.yml update
java -cp 'db/target/lib/*' liquibase.integration.commandline.Main --url jdbc:postgresql://127.0.0.1/autoscaler --driver=org.postgresql.Driver --changeLogFile=src/autoscaler/eventgenerator/db/dataaggregator.db.changelog.yml update
java -cp 'db/target/lib/*' liquibase.integration.commandline.Main --url jdbc:postgresql://127.0.0.1/autoscaler --driver=org.postgresql.Driver --changeLogFile=src/autoscaler/scalingengine/db/scalingengine.db.changelog.yml update

Generate TLS Certificates

./scripts/generate_test_certs.sh

Install consul

To be able to run unit tests and integration tests, you'll need to install consul binary.

if uname -a | grep Darwin; then os=darwin; else os=linux; fi
curl -L -o $TMPDIR/consul-0.7.5.zip "https://releases.hashicorp.com/consul/0.7.5/consul_0.7.5_${os}_amd64.zip"
unzip $TMPDIR/consul-0.7.5.zip -d $GOPATH/bin
rm $TMPDIR/consul-0.7.5.zip

Unit tests

pushd api
npm install
npm test
popd

pushd servicebroker
npm install
npm test
popd

go install github.com/onsi/ginkgo/ginkgo
export DBURL=postgres://postgres@localhost/autoscaler?sslmode=disable
pushd src/autoscaler
ginkgo -r -race -randomizeAllSpecs
popd

pushd scheduler
mvn test
popd

Integration tests

pushd api
npm install
popd

pushd servicebroker
npm install
popd

pushd scheduler
mvn package -DskipTests
popd

go install github.com/onsi/ginkgo/ginkgo
export DBURL=postgres://postgres@localhost/autoscaler?sslmode=disable
ginkgo -r -race -randomizeAllSpecs src/integration

Deploy and offer Auto-Scaler as a service

Go to app-autoscaler-release project for how to BOSH deploy App-AutoScaler and use the service

End-user manual

Docs describes more deep knowledge of App-AutoScaler from end-user's perspective, including policy definition, supported metric type, public API definition , commond line tool support and etc.

License

This project is released under version 2.0 of the Apache License.

app-autoscaler's People

Contributors

7chanho avatar boyang9527 avatar cdlliuy avatar fraenkel avatar ghaih avatar julz avatar kanekoh avatar kongjicdl avatar paltanmoy avatar pradyutsarma avatar qibobo avatar rohitsharma04 avatar software-engineer-mj avatar

Watchers

 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.