From eaf53792461cf9b88c98ea9ae8670f60658a268f Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sun, 30 Nov 2014 13:55:10 -0800 Subject: [PATCH] Update readme with clear instructions --- DEVELOPERS.md | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 13 ++++--- README.md | 43 +++--------------------- 3 files changed, 107 insertions(+), 42 deletions(-) create mode 100644 DEVELOPERS.md diff --git a/DEVELOPERS.md b/DEVELOPERS.md new file mode 100644 index 000000000..3d8e4d89f --- /dev/null +++ b/DEVELOPERS.md @@ -0,0 +1,93 @@ +### Build Dependencies + +Minio build depends on ``yasm`` and Go 1.3+ + +##### Install yasm + +Yasm is a Modular Assembler used for compiling [Intel Storage Acceleration Library](https://01.org/intel%C2%AE-storage-acceleration-library-open-source-version) + +```sh +$ sudo apt-get install yasm +``` +##### Install Go 1.3+ (Ubuntu) + +[Download the archive](https://golang.org/dl/) and extract it into ``/usr/local``, creating a Go tree in ``/usr/local/go``. For example: +```sh +$ tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz +``` + +Choose the archive file appropriate for your installation. For instance, if you are installing Go version 1.2.1 for 64-bit x86 on Linux, the archive you want is called ``go1.2.1.linux-amd64.tar.gz`` + +(Typically these commands must be run as root or through sudo.) + +Add ``/usr/local/go/bin`` to the ``PATH`` environment variable. You can do this by adding this line to your /etc/profile (for a system-wide installation) or ``$HOME/.profile``: +```sh +$ export PATH=$PATH:/usr/local/go/bin +``` + +##### Setting up ``GOPATH`` environment variable + +The ``GOPATH`` environment variable specifies the location of your workspace. It is likely the only environment variable you'll need to set when developing Go code. + +To get started, create a workspace directory and set GOPATH accordingly. Your workspace can be located wherever you like, but we'll use ``$HOME/mygo`` in this document. Note that this must not be the same path as your Go installation. +```sh +$ mkdir $HOME/mygo +$ export GOPATH=$HOME/mygo +``` + +For convenience, add the workspace's bin subdirectory to your ``PATH``: +```sh +$ export PATH=$PATH:$GOPATH/bin +``` + +For more detailed documentation refer [GOPATH](http://golang.org/doc/code.html#GOPATH) + +### Installing Minio (Source) + +#### Get directly from GitHub: + +Once we are finished the prerequisites in the previous step we now build minio + +```sh +$ go get -u github.com/minio-io/minio +$ cd $GOPATH/src/github.com/minio-io/minio +$ make getdeps +$ make +... +``` + +#### Clone locally (for contributors): + +```sh +$ git clone https://github.com/minio-io/minio +$ cd minio +$ make getdeps +$ make +``` + +Because Go expects all of your libraries to be found in either $GOROOT or $GOPATH, it's necessary to symlink the project to the following path: + +```sh +$ ln -s /path/to/your/minio $GOPATH/src/github.com/minio-io/minio +``` + +### Contribution Guidelines + +We welcome your contributions. To make the process as seamless as possible, we ask for the following: + +* Go ahead and fork the project and make your changes. We encourage pull requests to discuss code changes. + - Fork it + - Create your feature branch (git checkout -b my-new-feature) + - Commit your changes (git commit -am 'Add some feature') + - Push to the branch (git push origin my-new-feature) + - Create new Pull Request + +* When you're ready to create a pull request, be sure to: + - Have test cases for the new code. If you have questions about how to do it, please ask in your pull request. + - Run go fmt + - Squash your commits into a single commit. git rebase -i. It's okay to force update your pull request. + - Make sure go test ./... passes, and go build completes. + +##### NOTE + +This document assumes that minio user is using Ubuntu 12.04 or 14.04 LTS release diff --git a/Makefile b/Makefile index 4a641f209..60433a969 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,24 @@ #GOPATH := $(CURDIR)/tmp/gopath +MAKE_OPTIONS := -s -all: test install +all: getdeps test install + +getdeps: + @go get -u github.com/tools/godep && echo "Installing godep" + @go get -u code.google.com/p/go.tools/cmd/cover && echo "Installing cover" build-erasure: - cd pkgs/erasure && make + @cd pkgs/erasure && ${MAKE} ${MAKE_OPTIONS} build-signify: - cd pkgs/signify && make + @cd pkgs/signify && ${MAKE} ${MAKE_OPTIONS} test: build-erasure build-signify godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkgs/storage godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkgs/gateway install: build-erasure - godep go install github.com/minio-io/minio/cmd/erasure-demo + @godep go install github.com/minio-io/minio/cmd/erasure-demo && echo "Installed erasure-demo into ${GOPATH}/bin" save: godep save ./... diff --git a/README.md b/README.md index 6bd4005d9..add006d24 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,10 @@ -Introduction -============ -Minio is an open source object storage released under Apache license v2. +## Introduction -It uses ``Rubberband Erasure`` coding to dynamically protect the data. -Minio was inspired by Amazon S3 API and Haystack Object Format. +Minio is an open source object storage released under [Apache license v2](./LICENSE) . It uses ``Rubberband Erasure`` coding to dynamically protect the data. +Minio's design was inspired by Amazon's S3 for its API and Facebook's Haystack for its immutable data structure. -Dependencies -============ -* go1.3.3 -* godep - * go get github.com/tools/godep -* yasm -* cover - * go get code.google.com/p/go.tools/cmd/cover or yum install golang-cover +### Build Minio from Source -Dependency management -===================== - -Install or updating a new dependency ------------------------------------- -```sh -go get -u github.com/example/dependency -# import github.com/example/dependency in go src code -godep save ./... -``` - -Commit all Godep/ modifications, including vendorized files. - -Restoring dev environment dependencies --------------------------------------- -```sh -godep restore -``` - - -Compiling -========= -```sh -make -``` +[Source Install](./DEVELOPERS.md) [![Analytics](https://ga-beacon.appspot.com/UA-56860620-3/minio/readme)](https://github.com/igrigorik/ga-beacon)