Skip to content

Commit

Permalink
initial commit to add original content
Browse files Browse the repository at this point in the history
Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
  • Loading branch information
allencloud committed Oct 24, 2017
0 parents commit 64fbb26
Show file tree
Hide file tree
Showing 1,164 changed files with 367,783 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -0,0 +1 @@
# CHANGELOG
153 changes: 153 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,153 @@
# Contributing to Pouch

It is warmly welcomed if you have interest to hack on Pouch. First, we encourage this kind of willing very much. And here is a list of contributing guide for you.

## Topics

* [Reporting security issues](#reporting-security-issues)
* [Reporting general issues](#reporting-general-issues)
* [Code and doc contribution](#code-and-doc-contribution)
* [Engage to help anything](#engage-to-help-anything)

## Reporting security issues

Security issues are always treated seriously. As our usual principle, we discourage anyone to spread security issues. If you find a security issue of Pouch, please do not discuss it in public and even do not open a public issue. Instead we encourage you to send us a private email to report this.

## Reporting general issues

To be honest, we regard every user of Pouch as a very kind contributor. After experiencing Pouch, you may have some feedback for the project. Then feel free to open an issue via [NEW ISSUE](https://github.com/alibaba/pouch/issues/new).

Since we collaborate project Pouch in a distributed way, we appreciate **WELL-WRITTEN**, **DETAILED**, **EXPLICIT** issue reports. To make the communication more efficient, we wish everyone could search if your issue is an existing one in the searching list. If you find it existing, please add your details in comments under the existing issue instead of opening a brand new one.

To make the issue details as standard as possible, we setup an [ISSUE TEMPLATE](./.github/ISSUE_TEMPLATE.md) for issue reporters. Please **BE SURE** to follow the instructions to fill fields in template.

There are lot of cases when you could open an issue:

* bug report
* feature request
* performance issues
* feature proposal
* feature design
* help wanted
* doc incomplete
* test improvement
* any questions on project
* and so on

Also we must remind that when filing a new issue, please remember to remove the sensitive data from your post. Sensitive data could be password, secret key, network locations, private business data and so on.

## Code and doc contribution

Every action to make project Pouch better is encouraged. On GitHub, every improvement for Pouch could be via a PR (short for pull request).

* If you find a typo, try to fix it!
* If you find a bug, try to fix it!
* If you find some redundant codes, try to remove them!
* If you find some test cases missing, try to add them!
* If you could enhance a feature, please **DO NOT** hesitate!
* If you find code implicit, try to add comments to make it clear!
* If you find code ugly, try to refactor that!
* If you can help to improve documents, it could not be better!
* If you find document incorrect, just do it and fix that!
* ...

Actually it is impossible to list them completely. Just remember one princinple:

> WE ARE LOOKING FORWARD TO ANY PR FROM YOU.
Since you are ready to improve Pouch with a PR, we suggest you could take a look at the PR rules here.

* [Workspace Preparation](#workspace-preparation)
* [Branch Definition](#branch-definition)
* [Commit Rules](#commit-rules)
* [PR Description](#pr-description)

### Workspace Preparation

To put forward a PR, we assume you have registered a GitHub ID. Then you could finish the preparation in the following steps:

1. **FORK** Pouch to your repository. To make this work, you just need to click the button Fork in right-left of [alibaba/pouch](https://github.com/alibaba/pouch) main page. Then you will end up with your repository in `https://github.com/<your-username>/pouch`, in which `your-username` is your GitHub username.

2. **CLONE** your own repository to develop locally. Use `git clone https://github.com/<your-username>/pouch.git` to clone repository to your local machine. Then you can create new branches to finish the change you wish to make. Branch creation should be read the [Git Flow](#git-flow) part.

3. **Set Remote** upstream to be https://github.com/alibaba/pouch.git using the following two commands:
```
git remote add upstream https://github.com/alibaba/pouch.git
git remote set-url --push upstream no-pushing
```

With this remote setting, you can check you git remote configuration like this:
```
$ git remote -v
origin https://github.com/<your-username>/pouch.git (fetch)
origin https://github.com/<your-username>/pouch.git (push)
upstream https://github.com/alibaba/pouch.git (fetch)
upstream no-pushing (push)
```

Adding this, we can easily synchronize local branches with upstream branches.

### Branch Definition

Right now we assume every contribution via pull request is for [branch master](https://github.com/alibaba/pouch/tree/master) in Pouch. Before contributing, be aware of branch definition would help a lot.

As a contributor, keep in mind again that every contribution via pull request is for branch master. While in project pouch, there are several other branches, we generally call them rc branches, release branches and backport branches.

Before officially releasing a version, we will checkout a rc(release candidate) branch. In this branch, we will test more than branch master, and will [cherry-pick](https://git-scm.com/docs/git-cherry-pick) some new severe fix commit to this branch.

When officially releasing a version, there will be a release branch before tagging. After tagging, we will delete the release branch.

When backporting some fixes to existing released version, we will checkout backport branches. After backporting, the backporting effects will be in PATCH number in MAJOR.MINOR.PATCH of [SemVer](http://semver.org/).

### Commit Rules

Actually in Pouch, we take two rules serious when committing:

* [Commit Message](#commit-message)
* [Commit Content](#commit-content)

#### Commit Message

Commit message could help reviewers better understand what is the purpose of submitted PR. It could help accelerate the code review procedure as well. We encourage contributors to use **EXPLICIT** commit message rather than ambiguous message. In general, we advocate the following commit message type:

* docs: xxxx. For example, "docs: add docs about storage installation".
* feature: xxxx.For example, "feature: make result show in sorted order".
* bugfix: xxxx. For example, "bugfix: fix panic when input nil parameter".
* refactor: xxxx. For example, "refactor: simplify to make codes more readable".
* test: xxx. For example, "test: add unit test case for func InsertIntoArray".
* other readable and explicit expression ways.

On the other side, we discourage contributors from committing message like the following ways:

* ~~fix bug~~
* ~~update~~
* ~~add doc~~

#### Commit Content

Commit content represents all content changes included in one commit. We had better include things in one single commit which could support reviewer's complete review without any other commits' help. In another word, contents in one single commit can pass the CI to avoid code mess. In brief, there are two minor rules for us to keep in mind:

* avoid very large change in a commit;
* complete and reviewable for each commit.

In addition, in the code change part, we suggest that all contributors should read the [code style of Pouch](docs/contributions/code_styles.md).

No matter commit message, or commit content, we do take more emphasis on code review.

### PR Description

PR is the only way to make change to Pouch project files. To help reviewers better get your purpose, PR description could not be too detailed. We encourage contributors to follow the [PR template](./.github/PULL_REQUEST_TEMPLATE.md) to finish the pull request.

## Engage to help anything

We choose GitHub as the primary place for Pouch to collaborate. So the latest updates of Pouch are always here. Although contributions via PR is an explicit way to help, we still call for any other ways.

* reply to other's issues if you could;
* help solve other user's problems;
* help review other's PR design;
* help review other's codes in PR;
* discuss about Pouch to make things clearer;
* advocate Pouch technology beyond GitHub;
* write blogs on Pouch and so on.

In a word, **ANY HELP IS CONTRIBUTION.**
40 changes: 40 additions & 0 deletions Dockerfile
@@ -0,0 +1,40 @@
FROM ubuntu:16.04

# install wget to download golang source code
# install git
RUN apt-get update \
&& apt-get install -y \
wget \
git \
make \
gcc \
vim \
tree \
&& apt-get clean

# set go version this image use
ENV GO_VERSION=1.8.3
ENV ARCH=amd64

# install golang which version is GO_VERSION
RUN wget https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${ARCH}.tar.gz \
&& tar -C /usr/local -xzf go${GO_VERSION}.linux-${ARCH}.tar.gz \
&& rm go${GO_VERSION}.linux-${ARCH}.tar.gz

# create GOPATH
RUN mkdir /go
WORKDIR /go
ENV GOPATH=/go

# set go binary path to local $PATH
# go binary path is /usr/local/go/bin
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH

# install golint. currently golint has no released version.
RUN go get -u github.com/golang/lint/golint

COPY . /go/src/github.com/alibaba/pouch

# The environment is setup, when run what you need, just setup the CMD when `pouch run`
# For exmaple, this Dockerfile will build an image named `pouch-image`.
# When running unit test, just execute `pouch run pouch-image make unit-test`.
58 changes: 58 additions & 0 deletions FAQ.md
@@ -0,0 +1,58 @@
# Frequently Asked Questions

## What does Pouch mean?

Pouch refers to some kinds of small bags. One kind is brood pouch which is used to protect very young life. This is a metaphor that Software Pouch has its responsibilty to take care of applications very closely. In another word, application is the keyword in Pouch's world.

## What can Pouch bring you?

Pouch is a convenient tool providing container services for developers and operators.

Pouch can help to build a successful work flow for your IT engineering easily. We can also have such idea that Pouch is a huge helper to inovate DevOps for enterprises.

For developers, it can provide a standard way to package various applications. The standarized environment provided by Pouch could help you easily run CI(continuous integration) and improve CD(continuous delivery) efficieny. With this software, engineers can pack apllication with no effort and run applications out of box.

For operators, automation is one of the obvious benifits. Manual operation can be reduced to a fairly small percentage with Pouch. Operator could never mind the heterogeneous machine architeture and operation system. And they has alibities to focus more on application operation rather than hardware operation.

In addition, if you own a huge datacenter, Pouch is the best choice you ever have. It can increase the resource utilization of datacenter a lot at a very low effort. Besides, isolation ability is bright feature of Pouchd.

## What is the history of Pouch?

Originally in 2011, Pouch is a pure container service in Alibaba. It is used to serve millions of trade business of Taobao. At that time, Pouch is based on a technology named by [LXC](https://en.wikipedia.org/wiki/LXC).

With the evolution of container technology in industry, [Docker](https://www.docker.com/) technology comes up and becomes popular with its inovative layered image technology. In 2015, Pouch introduces docker's images technology to its own architeture to make itself much stronger.

As more and more scenes experience, Pouch gets lots of polishes and denifitely turns production-ready. Currently it supports most of the running of business in Alibaba.

## What is the role of Pouch in container ecosystem?

Maybe many people would say that container ecosystem has been very mature. What is the role of Pouch?

First, we admit there are so many software in container ecosystem. However, according to container technology experience in Alibaba, current ecosystem is good, but can be better, especially on the attitude towards application as container engine. So Pouch is a lighter and more useful container engine in ecosystem.

In the underlying support of container runtime, Pouch takes such opinion that lighter VM based on hypervisor is as important as container based on kernel support, such as cgroup and namespace. We can say container engine part of Pouch is very pure. More responsibility on container orchestration relies on upper orchestration technologies, like [Kubernetes](https://github.com/kubernetes/kubernetes), [Mesos](https://github.com/apache/mesos).

## What is difference between Pouch and Docker?

Pouch and Docker are both excellent container solution for users. They do similar things if comparing them at a glance. But more specifically, they have different emphasize on each one's target. Pouch takes more emphasis on application experience, while Docker advocates "one process one container" a lot. Pouch cannot ignore isolation threat of container technology in some particular scene, while Docker relies on kernel to achieve isolation heavily. Pouch brings an open attitude for the surrounding ecosystem, while docker also works on this but maybe not so much.

Here we list some additional features of Pouch:

* rich container: It means that there is not only one application process in container any more. Each container has its init process, and other systsem services on premise according to user's need.
* strong isolation: Pouch can create a VM with hypervisor technology via [runV](https://github.com/hyperhq/runv) and [clearcontainer](https://github.com/clearcontainers/runtime)
* high kernel compatibility: Pouch has a wide range of kernel version support. It is a long road for industry to upgrade kernel version to 3.10+. Pouch could help legecy kernel world to enjoy the fresh container technology.
* P2P image distribution: In a very large datacenter, image distribution is heavy load for network. Pouch can take advantage of P2P image distribution solutions to improve this.

## What is version rule of Pouch ?

We set the version rule of Pouch on the basis of [SemVer](http://semver.org/). Briefly speaking, we follow version number of MAJOR.MINOR.PATCH, such as 0.2.1, 1.1.3. For more details, please refer to [SemVer](http://semver.org/).

## What is the roadmap of Pouch?

See [ROADMAP.md](./ROADMAP.md)

## How to contribute to Pouch?

It is warmly welcomed if you have interest to contribute to Pouch.

More details, please refer to [CONTRIBUTION.md](./CONTRIBUTION.md)

0 comments on commit 64fbb26

Please sign in to comment.