Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
use Circle CI as dedicated CI for acs-engine, make CI results public (#…
Browse files Browse the repository at this point in the history
…1148)

* chore(ci): use circle-ci as CI platform

* ref(Dockerfile): cache make bootstrap step

* chore(ci): separate e2e tests into separate step

* ref(ci): require manual approval to start e2e tests

* ref(ci): use microsoft/acs-engine:latest as base test image

* chore(kubectl): bump kubectl to v1.6.6

* fix(setup): install gometalinter as part of bootstrap

* ref(CI): remove docker build, refactor e2e test step

Circle CI runs all steps in the microsoft/acs-engine:latest container
and clones the latest code into the container, so no explicit need to
build an image

* fix(ci): explicitly run bootstrap at each step

* fix(ci): add GOPATH env

* fix(ci): bootstrap once. maybe?

* ref(e2e): set default ENV vars, remove cruft

* ref(ci): don't hold e2e pending on unit tests

* docs(ci): add CI badge

* fix(e2e): fix env vars

* fix(e2e): run e2e in docker container

* Revert "fix(e2e): run e2e in docker container"

This reverts commit 9e7e4765257d6a7e52d5af5eb547da6f74f9fea1.

* ref(e2e): remove Jenkins groovy scripts

* ref(ci): run subset of e2e tests for PRs, remove KV tests

- acse-pr.json becomes acse-feature-validation.json that we can use for
integration testing at a later stage (merge to master, releases, etc.)
- New acse-pr.json runs 4 e2e tests, one for each orchestrator
- Remove Key Vault setup in PR tests.

* chore(e2e): run full set of feature validation tests on master branch
  • Loading branch information
seanknox authored Aug 2, 2017
1 parent dc1854d commit 3adb1b8
Show file tree
Hide file tree
Showing 17 changed files with 232 additions and 737 deletions.
73 changes: 73 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
version: 2
jobs:
test:
working_directory: /go/src/github.com/Azure/acs-engine
docker:
- image: microsoft/acs-engine:latest
environment:
GOPATH: /go
steps:
- checkout
- run: echo 'export PATH=$GOPATH/bin:$PATH' >> $BASH_ENV
- run:
name: Install dependencies
command: make bootstrap
- run:
name: Run style and unit tests
command: make test-style build test
- run:
name: Generate test coverage results
command: make build coverage
e2e:
working_directory: /go/src/github.com/Azure/acs-engine
docker:
- image: microsoft/acs-engine:latest
environment:
GOPATH: /go
steps:
- checkout
- run: |
echo 'export PATH=$GOPATH/bin:$PATH' >> $BASH_ENV
echo 'export BUILD_NUMBER=${CIRCLE_BUILD_NUM}' >> $BASH_ENV
echo 'export RESOURCE_GROUP_PREFIX=y' >> $BASH_ENV
echo 'export SKIP_METRICS=y' >> $BASH_ENV
echo 'export STAGE_TIMEOUT_MIN=30' >> $BASH_ENV
echo 'export NUM_OF_RETRIES=2' >> $BASH_ENV
echo 'export TEST_CONFIG=test/acse-conf/acse-pr.json' >> $BASH_ENV
- run:
name: e2e tests
command: make bootstrap build test-e2e
master:
working_directory: /go/src/github.com/Azure/acs-engine
docker:
- image: microsoft/acs-engine:latest
environment:
GOPATH: /go
steps:
- checkout
- run: |
echo 'export PATH=$GOPATH/bin:$PATH' >> $BASH_ENV
echo 'export BUILD_NUMBER=${CIRCLE_BUILD_NUM}' >> $BASH_ENV
echo 'export RESOURCE_GROUP_PREFIX=y' >> $BASH_ENV
echo 'export SKIP_METRICS=y' >> $BASH_ENV
echo 'export STAGE_TIMEOUT_MIN=30' >> $BASH_ENV
echo 'export NUM_OF_RETRIES=2' >> $BASH_ENV
echo 'export TEST_CONFIG=test/acse-conf/acse-feature-validation.json' >> $BASH_ENV
- run:
name: Feature validation tests
command: make bootstrap build test-e2e

workflows:
version: 2
build_and_test:
jobs:
- test
- e2e-hold:
type: approval
- e2e:
requires:
- e2e-hold
- master:
filters:
branches:
only: master
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
./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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ test/acs-engine-test/acs-engine-test
.editorconfig
_dist/
bin/
.env

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/
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.6.6
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,10 @@ 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 versioning.mk glide.yaml glide.lock /gopath/src/github.com/Azure/acs-engine/
RUN make bootstrap

ADD . /gopath/src/github.com/Azure/acs-engine
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,22 @@ checksum:
clean:
@rm -rf $(BINDIR) ./_dist

test: test_fmt
test: test-style
go test -v $(GOFILES)

.PHONY: test-style
test-style:
@scripts/validate-go.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;)

.PHONY: bootstrap
bootstrap:
Expand All @@ -83,6 +88,10 @@ ifndef HAS_GOBINDATA
endif
ifndef HAS_GIT
$(error You must install Git)
endif
ifndef HAS_GOMETALINTER
go get -u github.com/alecthomas/gometalinter
gometalinter --install
endif
glide install

Expand Down
41 changes: 21 additions & 20 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# Microsoft Azure Container Service Engine - Builds Docker Enabled Clusters

## Overview

This cluster definition examples demonstrate how to create a customized Docker Enabled Cluster on Microsoft Azure.

## User Guides

* [ACS Engine](acsengine.md) - shows you how to build and use the ACS engine to generate custom Docker enabled container clusters
* [Cluster Definition](clusterdefinition.md) - describes the components of the cluster definition file
* [DC/OS Walkthrough](dcos.md) - shows how to create a DC/OS enabled Docker cluster on Azure
* [Kubernetes Walkthrough](kubernetes.md) - shows how to create a Kubernetes enabled Docker cluster on Azure
* [Kubernetes Windows Walkthrough](kubernetes.windows.md) - shows how to create a hybrid Kubernetes Windows enabled Docker cluster on Azure.
* [Kubernetes with GPU support Walkthrough](kubernetes.gpu.md) - shows how to create a Kubernetes cluster with GPU support.
* [Swarm Walkthrough](swarm.md) - shows how to create a Swarm enabled Docker cluster on Azure
* [Swarm Mode Walkthrough](swarmmode.md) - shows how to create a Swarm Mode cluster on Azure
* [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
* [Large Clusters](../examples/largeclusters) - shows how to create cluster sizes of up to 1200 nodes
# Microsoft Azure Container Service Engine - Builds Docker Enabled Clusters
[![CircleCI](https://circleci.com/gh/Azure/acs-engine/tree/master.svg?style=svg)](https://circleci.com/gh/Azure/acs-engine/tree/master)

## Overview

This cluster definition examples demonstrate how to create a customized Docker Enabled Cluster on Microsoft Azure.

## User Guides

* [ACS Engine](acsengine.md) - shows you how to build and use the ACS engine to generate custom Docker enabled container clusters
* [Cluster Definition](clusterdefinition.md) - describes the components of the cluster definition file
* [DC/OS Walkthrough](dcos.md) - shows how to create a DC/OS enabled Docker cluster on Azure
* [Kubernetes Walkthrough](kubernetes.md) - shows how to create a Kubernetes enabled Docker cluster on Azure
* [Kubernetes Windows Walkthrough](kubernetes.windows.md) - shows how to create a hybrid Kubernetes Windows enabled Docker cluster on Azure.
* [Kubernetes with GPU support Walkthrough](kubernetes.gpu.md) - shows how to create a Kubernetes cluster with GPU support.
* [Swarm Walkthrough](swarm.md) - shows how to create a Swarm enabled Docker cluster on Azure
* [Swarm Mode Walkthrough](swarmmode.md) - shows how to create a Swarm Mode cluster on Azure
* [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
* [Large Clusters](../examples/largeclusters) - shows how to create cluster sizes of up to 1200 nodes
10 changes: 5 additions & 5 deletions test/acs-engine-test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ func (m *TestManager) Run() error {
func (m *TestManager) testRun(d config.Deployment, index, attempt int, timeout time.Duration) *report.ErrorInfo {
rgPrefix := os.Getenv("RESOURCE_GROUP_PREFIX")
if rgPrefix == "" {
rgPrefix = "x"
rgPrefix = "y"
fmt.Printf("RESOURCE_GROUP_PREFIX is not set. Using default '%s'\n", rgPrefix)
}
testName := strings.TrimSuffix(d.ClusterDefinition, filepath.Ext(d.ClusterDefinition))
instanceName := fmt.Sprintf("acse-%d-%s-%s-%d-%d", rand.Intn(0x0ffffff), d.Location, os.Getenv("BUILD_NUMBER"), index, attempt)
resourceGroup := fmt.Sprintf("%s-%s-%s-%s-%d-%d", rgPrefix, strings.Replace(testName, "/", "-", -1), d.Location, os.Getenv("BUILD_NUMBER"), index, attempt)
instanceName := fmt.Sprintf("acse-%d-%s-%s-%d-%d", rand.Intn(0x0ffffff), d.Location, os.Getenv("CIRCLE_BUILD_NUM"), index, attempt)
resourceGroup := fmt.Sprintf("%s-%s-%s-%s-%d-%d", rgPrefix, strings.Replace(testName, "/", "-", -1), d.Location, os.Getenv("CIRCLE_BUILD_NUM"), index, attempt)
logFile := fmt.Sprintf("%s/%s.log", logDir, resourceGroup)
validateLogFile := fmt.Sprintf("%s/validate-%s.log", logDir, resourceGroup)

Expand Down Expand Up @@ -423,9 +423,9 @@ func mainInternal() error {
return err
}
// get Jenkins build number
buildNum, err := strconv.Atoi(os.Getenv("BUILD_NUMBER"))
buildNum, err := strconv.Atoi(os.Getenv("CIRCLE_BUILD_NUM"))
if err != nil {
fmt.Println("Warning: BUILD_NUMBER is not set or invalid. Assuming 0")
fmt.Println("Warning: CIRCLE_BUILD_NUM is not set or invalid. Assuming 0")
buildNum = 0
}
// set environment variable ENABLE_METRICS=y to enable sending the metrics (disabled by default)
Expand Down
100 changes: 100 additions & 0 deletions test/acse-conf/acse-feature-validation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"deployments": [
{
"cluster_definition": "windows/kubernetes-hybrid.json",
"location": "eastus"
},
{
"cluster_definition": "windows/kubernetes.json",
"location": "eastus"
},
{
"cluster_definition": "dcos-versions/dcos1.8.8.json",
"location": "eastus"
},
{
"cluster_definition": "disks-managed/dcos-preAttachedDisks-vmas.json",
"location": "eastus2"
},
{
"cluster_definition": "disks-managed/dcos-vmss.json",
"location": "eastus2"
},
{
"cluster_definition": "disks-managed/kubernetes-preAttachedDisks-vmas.json",
"location": "eastus2"
},
{
"cluster_definition": "disks-managed/kubernetes-vmas.json",
"location": "eastus2"
},
{
"cluster_definition": "disks-managed/swarm-preAttachedDisks-vmas-windows.json",
"location": "eastus2"
},
{
"cluster_definition": "disks-managed/swarm-preAttachedDisks-vmss.json",
"location": "southcentralus"
},
{
"cluster_definition": "disks-managed/swarmmode-vmas.json",
"location": "southcentralus"
},
{
"cluster_definition": "disks-managed/swarmmode-vmss.json",
"location": "southcentralus"
},
{
"cluster_definition": "disks-storageaccount/dcos.json",
"location": "westus"
},
{
"cluster_definition": "disks-storageaccount/kubernetes.json",
"location": "westus"
},
{
"cluster_definition": "disks-storageaccount/swarmmode.json",
"location": "centralus"
},
{
"cluster_definition": "keyvaultcerts/swarm-windows.json",
"location": "westus"
},
{
"cluster_definition": "keyvaultcerts/swarmmode.json",
"location": "westus"
},
{
"cluster_definition": "kubernetesversions/kubernetes1.5.7.json",
"location": "centralus"
},
{
"cluster_definition": "networkpolicy/kubernetes-calico.json",
"location": "centralus"
},
{
"cluster_definition": "custom-pod-cidr/kubernetes.json",
"location": "westus2"
},
{
"cluster_definition": "v20170131/swarmmode.json",
"location": "westus2"
},
{
"cluster_definition": "vnet/dcosvnet.json",
"location": "westus2"
},
{
"cluster_definition": "vnet/kubernetesvnet.json",
"location": "westus2"
},
{
"cluster_definition": "vnet/swarmmodevnet.json",
"location": "westus2"
},
{
"cluster_definition": "managed-identity/kubernetes-msi.json",
"location": "westus2"
}
]
}
Loading

0 comments on commit 3adb1b8

Please sign in to comment.