Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: gitlab-ci Build of K8S #1

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
50fd1bc
create ci-master .gitlab-ci.yml
hh May 25, 2017
05ac213
update ci-master gitlab-ci.yml
hh Jun 5, 2017
56607c7
Merge branch 'master' of github.com:kubernetes/kubernetes into ci-master
hh Jun 5, 2017
894d879
Use release.env instead of release.vars
hh Jun 5, 2017
cd06bb8
add e2e to ci-master
hh Jun 5, 2017
96cce19
Update k8s builds to rebuild cross-cloud
hh Jun 23, 2017
4f1cbdb
Remove k8s binaries from release
hh Jun 23, 2017
02ec52b
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jun 23, 2017
7d8d36a
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jun 24, 2017
0626844
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jun 25, 2017
336bafd
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jun 26, 2017
c87b417
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jun 27, 2017
51d9332
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jun 28, 2017
9c06a97
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jun 29, 2017
5d92e78
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jun 30, 2017
3cb3b6f
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 1, 2017
83b7ee2
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 2, 2017
0128fca
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 3, 2017
0621d5a
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 4, 2017
e4f4083
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 5, 2017
d7fbbcb
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 6, 2017
83ac119
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 7, 2017
5a2556a
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 8, 2017
709789f
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 9, 2017
1366ed4
update ci-master to build binaries + containers
hh Jul 10, 2017
f74b94a
add util-linux so we have uuidgen
hh Jul 10, 2017
b648be8
Build hypercube for ci-master
hh Jul 10, 2017
807d328
hyperkube not hypercube
hh Jul 10, 2017
ff14f2d
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 11, 2017
34e4efa
Trigger cross-cloud with Kubernetes Master
hh Jul 11, 2017
6af2eab
Update .gitlab-ci.yml
hh Jul 11, 2017
8f3d325
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 12, 2017
8841796
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 13, 2017
466d5c7
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 14, 2017
df739d3
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 15, 2017
b4961c9
Merge branch 'master' of https://gitlab.cncf.ci/kubernetes/kubernetes…
Jul 16, 2017
9bf4822
k8s update_dashboard for ci-master
thewolfpack Nov 17, 2017
0687f75
moved branch ref check to dashboard update client
thewolfpack Nov 17, 2017
ed4e7d6
master head var update
thewolfpack Nov 17, 2017
7f40dea
Add Container job for Kubernetes
denverwilliams Nov 21, 2017
8cbdcc6
Build Hyperkube
denverwilliams Nov 21, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 138 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
image: docker:17.05.0
stages:
- build
- package
- release

variables:
DASHBOARD_STABLE_REF_NAME: "ci-v1.7.2"
DASHBOARD_MASTER_REF_NAME: "ci-master"
DASHBOARD_HEAD_REF_NAME: "$DASHBOARD_MASTER_REF_NAME"

before_script:
- apk update
- apk add bash tar rsync git curl make file util-linux
- echo "We are only going to build for amd64 for this demo"
- sed -i -e '/ linux\/arm/ s/^/#/' hack/lib/golang.sh
- sed -i -e '/ linux\/s390/ s/^/#/' hack/lib/golang.sh
- sed -i -e '/ linux\/386/ s/^/#/' hack/lib/golang.sh
- sed -i -e '/ linux\/ppc64le/ s/^/#/' hack/lib/golang.sh
- sed -i -e '/ darwin\/amd64/ s/^/#/' hack/lib/golang.sh
- sed -i -e '/ darwin\/386/ s/^/#/' hack/lib/golang.sh
- sed -i -e '/ windows\/386/ s/^/#/' hack/lib/golang.sh
- sed -i -e '/ windows\/amd64/ s/^/#/' hack/lib/golang.sh
- export CI_COMMIT_SHA_SHORT=$(echo ${CI_COMMIT_SHA} | cut -c -8)
- rm -f update_dashboard
- wget -O update_dashboard http://gitlab.dev.cncf.ci/cncf/cross-cloud/raw/ci-stable-v0.1.0/update_dashboard || apk update && apk add bash curl && curl -o update_dashboard http://gitlab.dev.cncf.ci/cncf/cross-cloud/raw/ci-stable-v0.1.0/update_dashboard
- chmod +x update_dashboard
- bash ./update_dashboard

after_script:
- rm -f update_dashboard
- wget -nv http://gitlab.dev.cncf.ci/cncf/cross-cloud/raw/ci-stable-v0.1.0/update_dashboard || apk update && apk add bash curl && curl -o update_dashboard http://gitlab.dev.cncf.ci/cncf/cross-cloud/raw/ci-stable-v0.1.0/update_dashboard
- chmod +x update_dashboard
- bash ./update_dashboard

compile:
stage: build
variables:
KUBE_DOCKER_REGISTRY: "${CI_REGISTRY_IMAGE}"
KUBE_DOCKER_IMAGE_TAG: "${CI_COMMIT_REF_SLUG}.${CI_PIPELINE_ID}.${CI_JOB_ID}"
KUBE_RELEASE_RUN_TESTS: "n"
KUBE_FASTBUILD: "false"
KUBE_VERBOSE: "0"
FEDERATION: "false"
script:
- apk update
- apk add bash tar rsync git curl make file
- export KUBE_DOCKER_REGISTRY="${CI_REGISTRY_IMAGE}"
- export KUBE_DOCKER_IMAGE_TAG="${CI_COMMIT_REF_SLUG}.${CI_COMMIT_SHA_SHORT}"
- echo "${KUBE_DOCKER_IMAGE_TAG}"
- ./build/release.sh
- ARCH=amd64
REGISTRY=${KUBE_DOCKER_REGISTRY}
VERSION=${KUBE_DOCKER_IMAGE_TAG}
make -C cluster/images/hyperkube/ build
- cp -a _output/dockerized/bin/linux/amd64 linux-amd64
- echo export KUBELET_ARTIFACT=https://gitlab.cncf.ci/kubernetes/kubernetes/-/jobs/${CI_JOB_ID}/artifacts/raw/linux-amd64/kubelet >> release.env
artifacts:
name: "${CI_JOB_NAME}.${CI_PIPELINE_ID}.${CI_JOB_ID}"
when: always
expire_in: 1 weeks
paths:
- release.env
- linux-amd64

container:
stage: package
variables:
KUBE_DOCKER_REGISTRY: "${CI_REGISTRY_IMAGE}"
KUBE_DOCKER_IMAGE_TAG: "${CI_COMMIT_REF_SLUG}.${CI_PIPELINE_ID}.${CI_COMMIT_SHA_SHORT}"
script:
- export KUBE_DOCKER_REGISTRY="${CI_REGISTRY_IMAGE}"
- export KUBE_DOCKER_IMAGE_TAG="${CI_COMMIT_REF_SLUG}.${CI_COMMIT_SHA_SHORT}"
- echo "${KUBE_DOCKER_IMAGE_TAG}"
- docker images | grep kubernetes/kubernetes
- docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY
- docker push "$CI_REGISTRY_IMAGE/hyperkube-amd64:$KUBE_DOCKER_IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE/kube-apiserver-amd64:$KUBE_DOCKER_IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE/kube-controller-manager-amd64:$KUBE_DOCKER_IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE/kube-scheduler-amd64:$KUBE_DOCKER_IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE/kube-proxy-amd64:$KUBE_DOCKER_IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE/kube-aggregator-amd64:$KUBE_DOCKER_IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE/cloud-controller-manager-amd64:$KUBE_DOCKER_IMAGE_TAG"
- echo export KUBERNETES_IMAGE="$CI_REGISTRY_IMAGE/hyperkube-amd64" > release.env
- echo export KUBERNETES_TAG="$KUBE_DOCKER_IMAGE_TAG" >> release.env
- echo export KUBE_APISERVER_IMAGE="$CI_REGISTRY_IMAGE/kube-apiserver-amd64" >> release.env
- echo export KUBE_APISERVER_TAG="$KUBE_DOCKER_IMAGE_TAG" >> release.env
- echo export KUBE_CONTROLLER_MANAGER_IMAGE="$CI_REGISTRY_IMAGE/kube-controller-manager-amd64" >> release.env
- echo export KUBE_CONTROLLER_MANAGER_TAG="$KUBE_DOCKER_IMAGE_TAG" >> release.env
- echo export KUBE_SCHEDULER_IMAGE="$CI_REGISTRY_IMAGE/kube-scheduler-amd64" >> release.env
- echo export KUBE_SCHEDULER_TAG="$KUBE_DOCKER_IMAGE_TAG" >> release.env
- echo export KUBE_PROXY_IMAGE="$CI_REGISTRY_IMAGE/kube-proxy-amd64" >> release.env
- echo export KUBE_PROXY_TAG="$KUBE_DOCKER_IMAGE_TAG" >> release.env
- echo export KUBE_AGGREGATOR_IMAGE="$CI_REGISTRY_IMAGE/kube-aggregator-amd64" >> release.env
- echo export KUBE_AGGREGATOR_TAG="$KUBE_DOCKER_IMAGE_TAG" >> release.env
- echo export CLOUD_CONTROLLER_IMAGE="$CI_REGISTRY_IMAGE/cloud-controller-manager-amd64" >> release.env
- echo export CLOUD_CONTROLLER_TAG="$KUBE_DOCKER_IMAGE_TAG" >> release.env
- cat release.env
artifacts:
name: "${CI_JOB_NAME}.${CI_PIPELINE_ID}.${CI_JOB_ID}"
when: always
expire_in: 1 weeks
paths:
- release.env

build-e2e:
stage: build
variables:
KUBE_DOCKER_REGISTRY: "${CI_REGISTRY_IMAGE}"
KUBE_DOCKER_IMAGE_TAG: "${CI_COMMIT_REF_SLUG}.${CI_PIPELINE_ID}.${CI_JOB_ID}"
script:
- docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY
- docker build -t "$CI_REGISTRY_IMAGE/kubernetes-e2e:$KUBE_DOCKER_IMAGE_TAG" ./e2e/
- docker push "$CI_REGISTRY_IMAGE/kubernetes-e2e:$KUBE_DOCKER_IMAGE_TAG"
- echo export KUBERNETES_E2E_IMAGE="$CI_REGISTRY_IMAGE/kubernetes-e2e" > e2e.env
- echo export KUBERNETES_E2E_TAG="$KUBE_DOCKER_IMAGE_TAG" >> e2e.env
artifacts:
name: "${CI_JOB_NAME}.${CI_PIPELINE_ID}.${CI_JOB_ID}"
expire_in: 1 weeks
paths:
- e2e.env

release:
stage: release
script:
- cat e2e.env
- cat release.env
- curl -X POST
-F token=$CI_JOB_TOKEN
-F ref=ci-master-v0.1.0
https://gitlab.cncf.ci/api/v4/projects/2/trigger/pipeline
artifacts:
name: "${CI_JOB_NAME}.${CI_PIPELINE_ID}.${CI_JOB_ID}"
expire_in: 1 weeks
paths:
- ci.vars
- release.env
- e2e.env
16 changes: 16 additions & 0 deletions e2e/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM golang:1.7
MAINTAINER "Denver Williams <[email protected]>"

# Install Deps
RUN apt-get update \
&& apt-get install -y rsync


# Copy Files
COPY files/ /kubernetes/e2e/

WORKDIR /kubernetes/e2e

RUN make build-conformance

CMD ["/bin/bash"]
24 changes: 24 additions & 0 deletions e2e/files/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
KUBERNETES_VERSION=v1.6.3
GOOS=$(shell go env GOOS)
GOPATH=$(shell go env GOPATH)
KUBERNETES_SRC=$(GOPATH)/src/k8s.io/kubernetes

build-conformance: kubernetes build-tests kubectl ginkgo

kubernetes:
git clone https://github.com/kubernetes/kubernetes
mkdir -p $(GOPATH)/src/k8s.io
mv kubernetes $(KUBERNETES_SRC)
cd $(KUBERNETES_SRC) && git checkout $(KUBERNETES_VERSION)

build-tests:
cd $(KUBERNETES_SRC) && make WHAT=test/e2e/e2e.test

kubectl:
cd $(KUBERNETES_SRC) && make WHAT=cmd/kubectl

ginkgo:
go get github.com/onsi/ginkgo/ginkgo
mkdir -p $(KUBERNETES_SRC)/_output/bin
cp $(shell go env GOPATH)/bin/ginkgo $(KUBERNETES_SRC)/_output/bin/ginkgo

17 changes: 17 additions & 0 deletions e2e/files/run-conformance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -e

# Run conformance test
# export KUBECONFIG=/cncf/data/aws-mvci-stable/kubeconfig
export KUBERNETES_CONFORMANCE_TEST=y
export KUBERNETES_PROVIDER=skeleton

# Run all conformance tests
cd $GOPATH/src/k8s.io/kubernetes
go run hack/e2e.go -v --test --test_args="--ginkgo.focus=\[Conformance\]"

# Run all parallel-safe conformance tests in parallel
GINKGO_PARALLEL=y go run hack/e2e.go -v --test --test_args="--ginkgo.focus=\[Conformance\] --ginkgo.skip=\[Serial\]"

# ... and finish up with remaining tests in serial
go run hack/e2e.go -v --test --test_args="--ginkgo.focus=\[Serial\].*\[Conformance\]"