Giter Club home page Giter Club logo

tech-mobile-appcelerator-amp's Introduction

amp

At the top level, we still have the swarm script for starting infrastructure services. We will need this for one more sprint, but it will be going away.

Prerequisites

The need for any prerequisites other than Docker is being eliminated. When you build, for example, protoc runs in a container. However, for the time being you should install go on your system as well as:

  • lint go get -u github.com/golang/lint/golint

Directories

  • api/rpc - contains the directories for specifying our rpc services and messages. They should be segregated by service and only contain *.proto files for definitions and *.pb.go files that are generated by the rpc rule in the Makefile (make rpc). Running make install or make build will automatically invoke the rpc rule.
  • api/server - contains the implementation files for the api/rpc/* service interfaces, and also contains server.go, which registers each service with a server on port 50501.
  • api/cmd - contains directories corresponding to the two generated executable binaries: amp (the CLI) and amplifier (the server daemon).
  • data/elasticsearch - the elasticsearch data layer (obviously).
  • vendor - used by glide to lock down versions and is supposed to be committed to version control, along with glide.lock and glide.yaml.

Tests

Test should generally be colocated with the packages they test. For example, see api/server/project_test.go, which tests the project service (api/server/project.go).

It is usually most expedient to just run go test in the package directory you want to test. But for convenience, make test will run tests on the github.com/appcelerator/amp/api/server package to ensure that service tests are passing.

Makefile

  • make - (no arguments) will print version/build info, run a check on your code, then install amp and amplifier in $GOPATH/bin.
  • make check - runs a series of formatting and lint checks on the source. Make sure to run before submitting a PR.
  • make fmt - will format the source according to go conventions.
  • make clean - cleans up auto-generated code and deletes the amp and amplifier executables from $GOPATH/src.
  • make rpc - run this if you want to update generated files without doing a full build.
  • make install - will (re)build the project and install the executable binaries (amp and amplifier) in $GOPATH/src.
  • make build - will build a docker image (appcelerator/amp:latest) that contains the binaries.
  • make run - will run amplifier in a container.

Package Management

The project uses Glide for vendoring, which is an approach to locking down packages that you have tested for a specific version. Glide isn't the only tool that supports vendoring, but it is one of the more popular ones. The Go community generally commits all the vendor artifacts (the vendor directory and lock file (glide.lock), along with the dependency specification (glide.yaml) file).

When you want to add new dependencies to the project, run glide get <package>. If you want to update to the latest versions, run glide update and then make test to make sure nothing broke.

Swarm

Use the swarm shell script to launch amp cluster services.

$ ./swarm pull
$ ./swarm start
$ ./swarm ls
$ ./swarm restart (equivalent to stop, pull, start)
$ ./swarm stop

tech-mobile-appcelerator-amp's People

Contributors

subfuzion avatar chrisccoy avatar generalhenry avatar freignat91 avatar

Watchers

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