Skip to content

Commit

Permalink
Merge tag 'v0.8.0' into migration
Browse files Browse the repository at this point in the history
  • Loading branch information
wenwu449 committed Oct 25, 2017
2 parents f8da501 + 7957245 commit adbc1cf
Show file tree
Hide file tree
Showing 6,069 changed files with 1,934,109 additions and 21,158 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
544 changes: 544 additions & 0 deletions .circleci/config.yml

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
./acs-engine
./acs-engine.exe
./_output
./.git
./test/acs-engine-test/acs-engine-test
./test/acs-engine-test/acs-engine-test
## autogenerated
./pkg/i18n/translations.go
./pkg/acsengine/templates.go
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

**Is this an ISSUE or FEATURE REQUEST?** (choose one):

---

**What version of acs-engine?**:

---


<!--
If this is a ISSUE, please:
- Fill in as much of the template below as you can. If you leave out
Expand Down
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,20 @@ test/user.env
user.env
test/acs-engine-test/acs-engine-test
.editorconfig
_dist/
bin/
.env

test/junit/
test/acs-engine-test/acs-engine-test.exe
pkg/operations/junit.xml
pkg/operations/kubernetesupgrade/junit.xml
pkg/acsengine/templates.go
pkg/i18n/translations.go

_logs/
test/acs-engine-test/report/TestReport.json
*.swp

# I have no idea why these get generated when I run the e2e test
test/e2e/kubernetes/translations/
19 changes: 14 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM buildpack-deps:xenial

RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install python-pip make build-essential curl openssl vim jq \
&& apt-get -y install python-pip make build-essential curl openssl vim jq gettext \
&& rm -rf /var/lib/apt/lists/*

ENV GO_VERSION 1.8
Expand All @@ -22,7 +22,7 @@ RUN mkdir /tmp/azurecli \

RUN curl -fsSL https://get.docker.com/ | sh

ENV KUBECTL_VERSION 1.6.0
ENV KUBECTL_VERSION 1.7.5
RUN curl "https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl

Expand All @@ -34,7 +34,16 @@ RUN git clone https://github.com/akesterson/cmdarg.git /tmp/cmdarg \
RUN git clone https://github.com/akesterson/shunit.git /tmp/shunit \
&& cd /tmp/shunit && make install && rm -rf /tmp/shunit

# Used by some CI jobs
ADD ./test/bootstrap/checkout-pr.sh /tmp/checkout-pr.sh

WORKDIR /gopath/src/github.com/Azure/acs-engine

# Cache vendor layer
ADD Makefile test.mk versioning.mk glide.yaml glide.lock /gopath/src/github.com/Azure/acs-engine/
RUN make bootstrap

# https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.0-preview2-download.md
RUN echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893 \
&& apt-get update \
&& apt-get -y install dotnet-sdk-2.0.0-preview2-006497

ADD . /gopath/src/github.com/Azure/acs-engine
148 changes: 127 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,145 @@
TARGETS = darwin/amd64 linux/amd64 windows/amd64
DIST_DIRS = find * -type d -exec

.NOTPARALLEL:

.PHONY: prereqs build test test_fmt validate-generated fmt lint ci devenv
.PHONY: bootstrap build test test_fmt validate-generated fmt lint ci devenv

ifdef DEBUG
GOFLAGS := -gcflags="-N -l"
else
GOFLAGS :=
endif

VERSION=`git describe --always --long --dirty`
BUILD=`date +%FT%T%z`
# go option
GO ?= go
TAGS :=
LDFLAGS :=
BINDIR := $(CURDIR)/bin
BINARIES := acs-engine
VERSION ?= $(shell git rev-parse HEAD)
VERSION_SHORT ?= $(shell git rev-parse --short HEAD)
GITTAG := $(shell git describe --exact-match --tags $(shell git log -n1 --pretty='%h') 2> /dev/null)
ifeq ($(GITTAG),)
GITTAG := $(VERSION_SHORT)
endif

# this isn't particularly pleasant, but it works with the least amount
# of requirements around $GOPATH. The extra sed is needed because `gofmt`
# operates on paths, go list returns package names, and `go fmt` always rewrites
# which is not what we need to do in the `test_fmt` target.
GOFILES=`go list ./... | grep -v "github.com/Azure/acs-engine/vendor" | sed 's|github.com/Azure/acs-engine|.|g' | grep -v -w '^.$$'`
REPO_PATH := github.com/Azure/acs-engine
DEV_ENV_IMAGE := quay.io/deis/go-dev:v1.2.0
DEV_ENV_WORK_DIR := /go/src/${REPO_PATH}
DEV_ENV_OPTS := --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_VARS}
DEV_ENV_CMD := docker run ${DEV_ENV_OPTS} ${DEV_ENV_IMAGE}
DEV_ENV_CMD_IT := docker run -it ${DEV_ENV_OPTS} ${DEV_ENV_IMAGE}
DEV_CMD_RUN := docker run ${DEV_ENV_OPTS}
ifdef DEBUG
LDFLAGS := -X main.version=${VERSION}
else
LDFLAGS := -s -X main.version=${VERSION}
endif
BINARY_DEST_DIR ?= bin

all: build

prereqs:
go get github.com/Masterminds/glide
go get github.com/jteeuwen/go-bindata/...
glide install
.PHONY: generate
generate: bootstrap
go generate $(GOFLAGS) -v `glide novendor | xargs go list`

.PHONY: build
build: generate
GOBIN=$(BINDIR) $(GO) install $(GOFLAGS) -ldflags '$(LDFLAGS)'
cd test/acs-engine-test; go build $(GOFLAGS)

build-binary: generate
go build $(GOFLAGS) -v -ldflags "${LDFLAGS}" -o ${BINARY_DEST_DIR}/acs-engine .

# usage: make clean build-cross dist VERSION=v0.4.0
.PHONY: build-cross
build-cross: build
build-cross: LDFLAGS += -extldflags "-static"
build-cross:
CGO_ENABLED=0 gox -output="_dist/acs-engine-${GITTAG}-{{.OS}}-{{.Arch}}/{{.Dir}}" -osarch='$(TARGETS)' $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)'

.PHONY: build-windows-k8s
build-windows-k8s:
./scripts/build-windows-k8s.sh -v ${K8S_VERSION} -p ${PATCH_VERSION}

.PHONY: dist
dist: build-cross
( \
cd _dist && \
$(DIST_DIRS) cp ../LICENSE {} \; && \
$(DIST_DIRS) cp ../README.md {} \; && \
$(DIST_DIRS) tar -zcf {}.tar.gz {} \; && \
$(DIST_DIRS) zip -r {}.zip {} \; \
)

build:
go generate -v $(GOFILES)
go build -v -ldflags="-X github.com/Azure/acs-engine/cmd.BuildSHA=${VERSION} -X github.com/Azure/acs-engine/cmd.BuildTime=${BUILD}"
cd test/acs-engine-test; go build -v
.PHONY: checksum
checksum:
for f in _dist/*.{gz,zip} ; do \
shasum -a 256 "$${f}" | awk '{print $$1}' > "$${f}.sha256" ; \
done

test: test_fmt
go test -v $(GOFILES)
.PHONY: clean
clean:
@rm -rf $(BINDIR) ./_dist

GIT_BASEDIR = $(shell git rev-parse --show-toplevel 2>/dev/null)
ifneq ($(GIT_BASEDIR),)
LDFLAGS += -X github.com/Azure/acs-engine/pkg/test.JUnitOutDir=${GIT_BASEDIR}/test/junit
endif

test: generate
ginkgo -skipPackage test/e2e -r .

.PHONY: test-style
test-style:
@scripts/validate-go.sh

validate-generated:
./scripts/validate-generated.sh
.PHONY: test-e2e
test-e2e:
@test/e2e.sh

HAS_GLIDE := $(shell command -v glide;)
HAS_GOX := $(shell command -v gox;)
HAS_GIT := $(shell command -v git;)
HAS_GOBINDATA := $(shell command -v go-bindata;)
HAS_GOMETALINTER := $(shell command -v gometalinter;)
HAS_GINKGO := $(shell command -v ginkgo;)

.PHONY: bootstrap
bootstrap:
ifndef HAS_GLIDE
go get -u github.com/Masterminds/glide
endif
ifndef HAS_GOX
go get -u github.com/mitchellh/gox
endif
ifndef HAS_GOBINDATA
go get github.com/jteeuwen/go-bindata/...
endif
ifndef HAS_GIT
$(error You must install Git)
endif
ifndef HAS_GOMETALINTER
go get -u github.com/alecthomas/gometalinter
gometalinter --install
endif
ifndef HAS_GINKGO
go get -u github.com/onsi/ginkgo/ginkgo
endif

build-vendor:
${DEV_ENV_CMD} rm -f glide.lock && rm -Rf vendor/ && glide --debug install --force

ci: prereqs validate-generated build test lint
ci: bootstrap test-style build test lint
./scripts/coverage.sh --coveralls

.PHONY: coverage
coverage:
@scripts/ginkgo.coverage.sh

devenv:
./scripts/devenv.sh

include versioning.mk
include test.mk
82 changes: 9 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Microsoft Azure Container Service Engine - Builds Docker Enabled Clusters
[![Coverage Status](https://coveralls.io/repos/github/Azure/acs-engine/badge.svg?branch=master)](https://coveralls.io/github/Azure/acs-engine?branch=master)
[![CircleCI](https://circleci.com/gh/Azure/acs-engine/tree/master.svg?style=svg)](https://circleci.com/gh/Azure/acs-engine/tree/master)

## Overview

Expand All @@ -8,9 +10,9 @@ The cluster definition file enables the following customizations to your Docker
* choice of DC/OS, Kubernetes, Swarm Mode, or Swarm orchestrators
* multiple agent pools where each agent pool can specify:
* standard or premium VM Sizes,
* node count,
* node count,
* Virtual Machine ScaleSets or Availability Sets,
* Storage Account Disks or Managed Disks (under private preview),
* Storage Account Disks or Managed Disks (under private preview)
* Docker cluster sizes of 1200
* Custom VNET

Expand All @@ -22,9 +24,9 @@ The cluster definition file enables the following customizations to your Docker
* [Kubernetes Walkthrough](docs/kubernetes.md) - shows how to create a Kubernetes enabled Docker cluster on Azure
* [Swarm Walkthrough](docs/swarm.md) - shows how to create a Swarm enabled Docker cluster on Azure
* [Swarm Mode Walkthrough](docs/swarmmode.md) - shows how to create a Swarm Mode cluster on Azure
* [Custom VNET](examples/vnet) - shows how to use a custom VNET
* [Custom VNET](examples/vnet) - shows how to use a custom VNET
* [Attached Disks](examples/disks-storageaccount) - shows how to attach up to 4 disks per node
* [Managed Disks](examples/disks-managed) (under private preview) - shows how to use managed disks
* [Managed Disks](examples/disks-managed) (under private preview) - shows how to use managed disks
* [Large Clusters](examples/largeclusters) - shows how to create cluster sizes of up to 1200 nodes

## Contributing
Expand All @@ -38,7 +40,9 @@ Please follow these instructions before submitting a PR:
should deploy the relevant example cluster definitions to ensure you're not
introducing any sort of regression.

## Usage (Template Generation)
## Usage

### Generate Templates

Usage is best demonstrated with an example:

Expand All @@ -55,74 +59,6 @@ This produces a new directory inside `_output/` that contains an ARM template
for deploying Kubernetes into Azure. (In the case of Kubernetes, some additional
needed assets are generated and placed in the output directory.)

## Deployment Usage

Generated templates can be deployed using
[the Azure XPlat CLI (v0.10**.0** only)](https://github.com/Azure/azure-xplat-cli/releases/tag/v0.10.0-May2016),
[the Azure CLI 2.0](https://github.com/Azure/azure-cli) or
[Powershell](https://github.com/Azure/azure-powershell).

### Deploying with Azure XPlat CLI

**NOTE:** Some deployments will fail if certain versions of the Azure XPlat CLI are used. It's recommended that you use [Azure XPlat CLI 0.10**.0**](https://github.com/Azure/azure-xplat-cli/releases/tag/v0.10.0-May2016) until a new point release of `0.10.x` is available with the fix.

```bash
$ azure login

$ azure account set "<SUBSCRIPTION NAME OR ID>"

$ azure config mode arm

$ azure group create \
--name="<RESOURCE_GROUP_NAME>" \
--location="<LOCATION>"

$ azure group deployment create \
--name="<DEPLOYMENT NAME>" \
--resource-group="<RESOURCE_GROUP_NAME>" \
--template-file="./_output/<INSTANCE>/azuredeploy.json" \
--parameters-file="./_output/<INSTANCE>/azuredeploy.parameters.json"
```

### Deploying with Azure CLI 2.0
**NOTE:** Azure CLI 2.0 is still in preview, so changes may occur.
Please reference [the Azure CLI 2.0 GitHub Repo](https://github.com/Azure/azure-cli) for updated commands and please
ensure that your installation is up to date with the latest release. (Releases occur weekly!)

```bash
$ az login

$ az account set --subscription "<SUBSCRIPTION NAME OR ID>"

$ az group create \
--name "<RESOURCE_GROUP_NAME>" \
--location "<LOCATION>"

$ az group deployment create \
--name "<DEPLOYMENT NAME>" \
--resource-group "<RESOURCE_GROUP_NAME>" \
--template-file "./_output/<INSTANCE>/azuredeploy.json" \
--parameters "./_output/<INSTANCE>/azuredeploy.parameters.json"
```

### Deploying with Powershell

```powershell
Add-AzureRmAccount
Select-AzureRmSubscription -SubscriptionID <SUBSCRIPTION_ID>
New-AzureRmResourceGroup `
-Name <RESOURCE_GROUP_NAME> `
-Location <LOCATION>
New-AzureRmResourceGroupDeployment `
-Name <DEPLOYMENT_NAME> `
-ResourceGroupName <RESOURCE_GROUP_NAME> `
-TemplateFile _output\<INSTANCE>\azuredeploy.json `
-TemplateParameterFile _output\<INSTANCE>\azuredeploy.parameters.json
```

## Code of conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
Loading

0 comments on commit adbc1cf

Please sign in to comment.