Skip to content

Commit adbc1cf

Browse files
committed
Merge tag 'v0.8.0' into migration
2 parents f8da501 + 7957245 commit adbc1cf

File tree

6,069 files changed

+1934109
-21158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,069 files changed

+1934109
-21158
lines changed

.circleci/config.yml

+544
Large diffs are not rendered by default.

.dockerignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
./acs-engine
22
./acs-engine.exe
33
./_output
4-
./.git
5-
./test/acs-engine-test/acs-engine-test
4+
./test/acs-engine-test/acs-engine-test
5+
## autogenerated
6+
./pkg/i18n/translations.go
7+
./pkg/acsengine/templates.go

.github/ISSUE_TEMPLATE.md

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

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

9+
---
10+
11+
**What version of acs-engine?**:
12+
13+
---
14+
15+
916
<!--
1017
If this is a ISSUE, please:
1118
- Fill in as much of the template below as you can. If you leave out

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,20 @@ test/user.env
88
user.env
99
test/acs-engine-test/acs-engine-test
1010
.editorconfig
11+
_dist/
12+
bin/
13+
.env
1114

15+
test/junit/
1216
test/acs-engine-test/acs-engine-test.exe
1317
pkg/operations/junit.xml
1418
pkg/operations/kubernetesupgrade/junit.xml
1519
pkg/acsengine/templates.go
20+
pkg/i18n/translations.go
21+
22+
_logs/
23+
test/acs-engine-test/report/TestReport.json
24+
*.swp
25+
26+
# I have no idea why these get generated when I run the e2e test
27+
test/e2e/kubernetes/translations/

Dockerfile

+14-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM buildpack-deps:xenial
22

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

88
ENV GO_VERSION 1.8
@@ -22,7 +22,7 @@ RUN mkdir /tmp/azurecli \
2222

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

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

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

37-
# Used by some CI jobs
38-
ADD ./test/bootstrap/checkout-pr.sh /tmp/checkout-pr.sh
39-
4037
WORKDIR /gopath/src/github.com/Azure/acs-engine
38+
39+
# Cache vendor layer
40+
ADD Makefile test.mk versioning.mk glide.yaml glide.lock /gopath/src/github.com/Azure/acs-engine/
41+
RUN make bootstrap
42+
43+
# https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.0-preview2-download.md
44+
RUN echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list \
45+
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893 \
46+
&& apt-get update \
47+
&& apt-get -y install dotnet-sdk-2.0.0-preview2-006497
48+
49+
ADD . /gopath/src/github.com/Azure/acs-engine

Makefile

+127-21
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,145 @@
1+
TARGETS = darwin/amd64 linux/amd64 windows/amd64
2+
DIST_DIRS = find * -type d -exec
3+
14
.NOTPARALLEL:
25

3-
.PHONY: prereqs build test test_fmt validate-generated fmt lint ci devenv
6+
.PHONY: bootstrap build test test_fmt validate-generated fmt lint ci devenv
7+
8+
ifdef DEBUG
9+
GOFLAGS := -gcflags="-N -l"
10+
else
11+
GOFLAGS :=
12+
endif
413

5-
VERSION=`git describe --always --long --dirty`
6-
BUILD=`date +%FT%T%z`
14+
# go option
15+
GO ?= go
16+
TAGS :=
17+
LDFLAGS :=
18+
BINDIR := $(CURDIR)/bin
19+
BINARIES := acs-engine
20+
VERSION ?= $(shell git rev-parse HEAD)
21+
VERSION_SHORT ?= $(shell git rev-parse --short HEAD)
22+
GITTAG := $(shell git describe --exact-match --tags $(shell git log -n1 --pretty='%h') 2> /dev/null)
23+
ifeq ($(GITTAG),)
24+
GITTAG := $(VERSION_SHORT)
25+
endif
726

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

1441
all: build
1542

16-
prereqs:
17-
go get github.com/Masterminds/glide
18-
go get github.com/jteeuwen/go-bindata/...
19-
glide install
43+
.PHONY: generate
44+
generate: bootstrap
45+
go generate $(GOFLAGS) -v `glide novendor | xargs go list`
46+
47+
.PHONY: build
48+
build: generate
49+
GOBIN=$(BINDIR) $(GO) install $(GOFLAGS) -ldflags '$(LDFLAGS)'
50+
cd test/acs-engine-test; go build $(GOFLAGS)
51+
52+
build-binary: generate
53+
go build $(GOFLAGS) -v -ldflags "${LDFLAGS}" -o ${BINARY_DEST_DIR}/acs-engine .
54+
55+
# usage: make clean build-cross dist VERSION=v0.4.0
56+
.PHONY: build-cross
57+
build-cross: build
58+
build-cross: LDFLAGS += -extldflags "-static"
59+
build-cross:
60+
CGO_ENABLED=0 gox -output="_dist/acs-engine-${GITTAG}-{{.OS}}-{{.Arch}}/{{.Dir}}" -osarch='$(TARGETS)' $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)'
61+
62+
.PHONY: build-windows-k8s
63+
build-windows-k8s:
64+
./scripts/build-windows-k8s.sh -v ${K8S_VERSION} -p ${PATCH_VERSION}
65+
66+
.PHONY: dist
67+
dist: build-cross
68+
( \
69+
cd _dist && \
70+
$(DIST_DIRS) cp ../LICENSE {} \; && \
71+
$(DIST_DIRS) cp ../README.md {} \; && \
72+
$(DIST_DIRS) tar -zcf {}.tar.gz {} \; && \
73+
$(DIST_DIRS) zip -r {}.zip {} \; \
74+
)
2075

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

26-
test: test_fmt
27-
go test -v $(GOFILES)
82+
.PHONY: clean
83+
clean:
84+
@rm -rf $(BINDIR) ./_dist
85+
86+
GIT_BASEDIR = $(shell git rev-parse --show-toplevel 2>/dev/null)
87+
ifneq ($(GIT_BASEDIR),)
88+
LDFLAGS += -X github.com/Azure/acs-engine/pkg/test.JUnitOutDir=${GIT_BASEDIR}/test/junit
89+
endif
90+
91+
test: generate
92+
ginkgo -skipPackage test/e2e -r .
2893

2994
.PHONY: test-style
3095
test-style:
3196
@scripts/validate-go.sh
3297

33-
validate-generated:
34-
./scripts/validate-generated.sh
98+
.PHONY: test-e2e
99+
test-e2e:
100+
@test/e2e.sh
101+
102+
HAS_GLIDE := $(shell command -v glide;)
103+
HAS_GOX := $(shell command -v gox;)
104+
HAS_GIT := $(shell command -v git;)
105+
HAS_GOBINDATA := $(shell command -v go-bindata;)
106+
HAS_GOMETALINTER := $(shell command -v gometalinter;)
107+
HAS_GINKGO := $(shell command -v ginkgo;)
108+
109+
.PHONY: bootstrap
110+
bootstrap:
111+
ifndef HAS_GLIDE
112+
go get -u github.com/Masterminds/glide
113+
endif
114+
ifndef HAS_GOX
115+
go get -u github.com/mitchellh/gox
116+
endif
117+
ifndef HAS_GOBINDATA
118+
go get github.com/jteeuwen/go-bindata/...
119+
endif
120+
ifndef HAS_GIT
121+
$(error You must install Git)
122+
endif
123+
ifndef HAS_GOMETALINTER
124+
go get -u github.com/alecthomas/gometalinter
125+
gometalinter --install
126+
endif
127+
ifndef HAS_GINKGO
128+
go get -u github.com/onsi/ginkgo/ginkgo
129+
endif
130+
131+
build-vendor:
132+
${DEV_ENV_CMD} rm -f glide.lock && rm -Rf vendor/ && glide --debug install --force
35133

36-
ci: prereqs validate-generated build test lint
134+
ci: bootstrap test-style build test lint
135+
./scripts/coverage.sh --coveralls
136+
137+
.PHONY: coverage
138+
coverage:
139+
@scripts/ginkgo.coverage.sh
37140

38141
devenv:
39142
./scripts/devenv.sh
143+
144+
include versioning.mk
145+
include test.mk

README.md

+9-73
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Microsoft Azure Container Service Engine - Builds Docker Enabled Clusters
2+
[![Coverage Status](https://coveralls.io/repos/github/Azure/acs-engine/badge.svg?branch=master)](https://coveralls.io/github/Azure/acs-engine?branch=master)
3+
[![CircleCI](https://circleci.com/gh/Azure/acs-engine/tree/master.svg?style=svg)](https://circleci.com/gh/Azure/acs-engine/tree/master)
24

35
## Overview
46

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

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

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

41-
## Usage (Template Generation)
43+
## Usage
44+
45+
### Generate Templates
4246

4347
Usage is best demonstrated with an example:
4448

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

58-
## Deployment Usage
59-
60-
Generated templates can be deployed using
61-
[the Azure XPlat CLI (v0.10**.0** only)](https://github.com/Azure/azure-xplat-cli/releases/tag/v0.10.0-May2016),
62-
[the Azure CLI 2.0](https://github.com/Azure/azure-cli) or
63-
[Powershell](https://github.com/Azure/azure-powershell).
64-
65-
### Deploying with Azure XPlat CLI
66-
67-
**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.
68-
69-
```bash
70-
$ azure login
71-
72-
$ azure account set "<SUBSCRIPTION NAME OR ID>"
73-
74-
$ azure config mode arm
75-
76-
$ azure group create \
77-
--name="<RESOURCE_GROUP_NAME>" \
78-
--location="<LOCATION>"
79-
80-
$ azure group deployment create \
81-
--name="<DEPLOYMENT NAME>" \
82-
--resource-group="<RESOURCE_GROUP_NAME>" \
83-
--template-file="./_output/<INSTANCE>/azuredeploy.json" \
84-
--parameters-file="./_output/<INSTANCE>/azuredeploy.parameters.json"
85-
```
86-
87-
### Deploying with Azure CLI 2.0
88-
**NOTE:** Azure CLI 2.0 is still in preview, so changes may occur.
89-
Please reference [the Azure CLI 2.0 GitHub Repo](https://github.com/Azure/azure-cli) for updated commands and please
90-
ensure that your installation is up to date with the latest release. (Releases occur weekly!)
91-
92-
```bash
93-
$ az login
94-
95-
$ az account set --subscription "<SUBSCRIPTION NAME OR ID>"
96-
97-
$ az group create \
98-
--name "<RESOURCE_GROUP_NAME>" \
99-
--location "<LOCATION>"
100-
101-
$ az group deployment create \
102-
--name "<DEPLOYMENT NAME>" \
103-
--resource-group "<RESOURCE_GROUP_NAME>" \
104-
--template-file "./_output/<INSTANCE>/azuredeploy.json" \
105-
--parameters "./_output/<INSTANCE>/azuredeploy.parameters.json"
106-
```
107-
108-
### Deploying with Powershell
109-
110-
```powershell
111-
Add-AzureRmAccount
112-
113-
Select-AzureRmSubscription -SubscriptionID <SUBSCRIPTION_ID>
114-
115-
New-AzureRmResourceGroup `
116-
-Name <RESOURCE_GROUP_NAME> `
117-
-Location <LOCATION>
118-
119-
New-AzureRmResourceGroupDeployment `
120-
-Name <DEPLOYMENT_NAME> `
121-
-ResourceGroupName <RESOURCE_GROUP_NAME> `
122-
-TemplateFile _output\<INSTANCE>\azuredeploy.json `
123-
-TemplateParameterFile _output\<INSTANCE>\azuredeploy.parameters.json
124-
```
125-
12662
## Code of conduct
12763

12864
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 [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

0 commit comments

Comments
 (0)