Skip to content

Commit 8c623c6

Browse files
author
Wei Tie
committed
Merge branch 'master' into release-1.2
Signed-off-by: Wei Tie <wtie@cisco.com>
2 parents f1fe6c5 + 0308c0f commit 8c623c6

File tree

1,421 files changed

+255772
-332068
lines changed

Some content is hidden

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

1,421 files changed

+255772
-332068
lines changed

Godeps/Godeps.json

Lines changed: 560 additions & 607 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
DEFAULT_DOCKER_VERSION := 1.12.6
99
V2PLUGIN_DOCKER_VERSION := 1.13.1
1010
SHELL := /bin/bash
11-
EXCLUDE_DIRS := bin docs Godeps scripts vagrant vendor install
11+
# TODO: contivmodel should be removed once its code passes golint and misspell
12+
EXCLUDE_DIRS := bin docs Godeps scripts vagrant vendor install contivmodel
1213
PKG_DIRS := $(filter-out $(EXCLUDE_DIRS),$(subst /,,$(sort $(dir $(wildcard */)))))
1314
TO_BUILD := ./netplugin/ ./netmaster/ ./netctl/netctl/ ./mgmtfn/k8splugin/contivk8s/ ./mgmtfn/mesosplugin/netcontiv/
1415
HOST_GOBIN := `if [ -n "$$(go env GOBIN)" ]; then go env GOBIN; else dirname $$(which go); fi`
1516
HOST_GOROOT := `go env GOROOT`
1617
NAME := netplugin
1718
VERSION := $(shell scripts/getGitVersion.sh)
18-
TAR := $(shell command -v gtar || echo command -v tar || echo "Could not find tar")
19+
TAR := $(shell command -v gtar || command -v tar || echo "Could not find tar")
1920
TAR_EXT := tar.bz2
2021
export NETPLUGIN_CONTAINER_TAG := $(shell ./scripts/getGitVersion.sh)
2122
TAR_FILENAME := $(NAME)-$(VERSION).$(TAR_EXT)
@@ -25,7 +26,7 @@ export V2PLUGIN_TAR_FILENAME := v2plugin-$(VERSION).tar.gz
2526
GO_MIN_VERSION := 1.7
2627
GO_MAX_VERSION := 1.8
2728
GO_VERSION := $(shell go version | cut -d' ' -f3 | sed 's/go//')
28-
CI_HOST_TARGETS ?= "host-unit-test host-integ-test host-build-docker-image"
29+
CI_HOST_TARGETS ?= "host-unit-test host-integ-test host-build-docker-image tar host-pluginfs-create clean-tar"
2930
SYSTEM_TESTS_TO_RUN ?= "00SSH|Basic|Network|Policy|TestTrigger|ACIM|Netprofile"
3031
K8S_SYSTEM_TESTS_TO_RUN ?= "00SSH|Basic|Network|Policy"
3132
ACI_GW_IMAGE ?= "contiv/aci-gw:04-12-2017.2.2_1n"
@@ -130,19 +131,8 @@ update:
130131
start:
131132
CONTIV_DOCKER_VERSION="$${CONTIV_DOCKER_VERSION:-$(DEFAULT_DOCKER_VERSION)}" CONTIV_NODE_OS=${CONTIV_NODE_OS} vagrant up
132133

133-
# ===================================================================
134-
#kubernetes demo targets
135-
k8s-demo:
136-
cd vagrant/k8s/ && ./copy_demo.sh
137-
138-
k8s-demo-start:
139-
cd vagrant/k8s/ && ./restart_cluster.sh && vagrant ssh k8master
140-
141134
# ===================================================================
142135
# kubernetes cluster bringup/cleanup targets
143-
k8s-legacy-cluster:
144-
cd vagrant/k8s/ && ./setup_cluster.sh
145-
146136
k8s-cluster:
147137
cd vagrant/k8s/ && CONTIV_K8S_USE_KUBEADM=1 ./setup_cluster.sh
148138

@@ -157,15 +147,6 @@ k8s-l3-destroy:
157147

158148
# ===================================================================
159149
# kubernetes test targets
160-
k8s-legacy-test:
161-
export CONTIV_K8S_LEGACY=1 && \
162-
make k8s-sanity-cluster && \
163-
cd vagrant/k8s/ && vagrant ssh k8master -c 'bash -lc "cd /opt/gopath/src/github.com/contiv/netplugin && make run-build"' && \
164-
./start_sanity_service.sh
165-
cd $(GOPATH)/src/github.com/contiv/netplugin/scripts/python && PYTHONIOENCODING=utf-8 ./createcfg.py -scheduler 'k8s'
166-
CONTIV_K8S_LEGACY=1 CONTIV_NODES=3 go test -v -timeout 540m ./test/systemtests -check.v -check.abort -check.f "00SSH|TestBasic|TestNetwork|ACID|TestPolicy|TestTrigger"
167-
cd vagrant/k8s && vagrant destroy -f
168-
169150
k8s-test: k8s-cluster
170151
cd vagrant/k8s/ && vagrant ssh k8master -c 'bash -lc "cd /opt/gopath/src/github.com/contiv/netplugin && make run-build"'
171152
cd $(GOPATH)/src/github.com/contiv/netplugin/scripts/python && PYTHONIOENCODING=utf-8 ./createcfg.py -scheduler 'k8s' -binpath contiv/bin -install_mode 'kubeadm'
@@ -272,8 +253,8 @@ start-aci-gw:
272253
docker pull $(ACI_GW_IMAGE)
273254
docker run --net=host -itd -e "APIC_URL=SANITY" -e "APIC_USERNAME=IGNORE" -e "APIC_PASSWORD=IGNORE" --name=contiv-aci-gw $(ACI_GW_IMAGE)
274255

275-
host-build-docker-image:
276-
./scripts/netContain/build_image.sh
256+
host-build-docker-image: compile-with-docker binaries-from-container
257+
@./scripts/netContain/build_image.sh
277258

278259
host-cleanup:
279260
@echo dev: cleaning up services...
@@ -381,7 +362,7 @@ binaries-from-container:
381362
c_id=$$(docker create --name netplugin-build \
382363
netplugin-build:$(NETPLUGIN_CONTAINER_TAG)) && \
383364
for f in netplugin netmaster netctl contivk8s netcontiv; do \
384-
docker cp -a $${c_id}:/go/bin/$$f bin/$$f; done && \
365+
docker cp $${c_id}:/go/bin/$$f bin/$$f; done && \
385366
docker rm $${c_id}
386367

387368
##########################

RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ release isn't made from the HEAD of master.
7070
## Build and upload container image (manual only)
7171

7272
1. cd scripts/netContain
73-
2. ./ReleaseContainer.sh -v <version> -u contiv -i contiv/netplugin
73+
2. ./release_image.sh -v <version> \[-i <image_name>] \[-t <image_tag>]
7474

7575
Here <version> is a version that has been released using steps above and exists on github.

Vagrantfile

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ BEGIN {
1818
go_version = ENV['GO_VERSION'] || '1.7.6'
1919
docker_version = ENV['CONTIV_DOCKER_VERSION'] || '1.12.6'
2020
docker_swarm = ENV['CONTIV_DOCKER_SWARM'] || 'classic_mode'
21+
docker_ee_url = ENV['DOCKERURL']
2122
gopath_folder = '/opt/gopath'
2223
http_proxy = ENV['HTTP_PROXY'] || ENV['http_proxy'] || ''
2324
https_proxy = ENV['HTTPS_PROXY'] || ENV['https_proxy'] || ''
2425
build_version = ENV['BUILD_VERSION'] || ''
2526
cluster_ip_nodes = ''
2627
v2plugin_name = ENV['CONTIV_V2PLUGIN_NAME'] || 'contiv/v2netplugin:0.1'
27-
cluster_store = ENV['CONTIV_CLUSTER_STORE'] || 'etcd://localhost:2379'
28+
cluster_store_driver = ENV['CONTIV_CLUSTER_STORE_DRIVER'] || 'etcd'
29+
cluster_store_url = ENV['CONTIV_CLUSTER_STORE_URL'] || 'http://localhost:2379'
2830
nightly_release = ENV['NIGHTLY_RELEASE'] || ''
29-
node_os = ENV['CONTIV_NODE_OS'] || 'centos'
31+
node_os = ENV['CONTIV_NODE_OS'] != '' ? ENV['CONTIV_NODE_OS'] : 'centos'
3032
base_ip = ENV['CONTIV_IP_PREFIX'] || '192.168.2.'
3133
num_nodes = ENV['CONTIV_NODES'].to_i == 0 ? 3 : ENV['CONTIV_NODES'].to_i
3234
num_vm_cpus = (ENV['CONTIV_CPUS'] || 4).to_i
@@ -46,7 +48,8 @@ export https_proxy='#{https_proxy}'
4648
export NIGHTLY_RELEASE=#{nightly_release}
4749
export no_proxy=%{cluster_ip_nodes},127.0.0.1,localhost,netmaster
4850
export CLUSTER_NODE_IPS=%{cluster_ip_nodes}
49-
export CONTIV_CLUSTER_STORE=#{cluster_store}
51+
export CONTIV_CLUSTER_STORE_DRIVER=#{cluster_store_driver}
52+
export CONTIV_CLUSTER_STORE_URL=#{cluster_store_url}
5053
export CONTIV_V2PLUGIN_NAME=#{v2plugin_name}
5154
export CONTIV_DOCKER_SWARM=#{docker_swarm}
5255
export BUILD_VERSION=#{build_version}
@@ -93,6 +96,16 @@ rm -rf /var/lib/docker
9396
if [[ "#{node_os}" == "ubuntu" ]] && [[ "$reinstall" -eq 1 ]]; then
9497
sudo apt-get purge docker-engine -y || :
9598
curl https://get.docker.com | sed s/docker-engine/docker-engine=#{docker_version}-0~xenial/g | bash
99+
elif [[ "#{node_os}" == "centos" ]] && [[ -n "#{docker_ee_url}" ]]; then
100+
echo "Preparing for Docker EE installation"
101+
sudo yum remove -y docker docker-common docker-selinux docker-engine-selinux docker-engine docker-ce || :
102+
sudo rm /etc/yum.repos.d/*docker*
103+
export DOCKERURL='#{docker_ee_url}'
104+
sudo -E sh -c 'echo "$DOCKERURL/centos" > /etc/yum/vars/dockerurl'
105+
sudo -E yum-config-manager --add-repo "$DOCKERURL/centos/docker-ee.repo"
106+
echo "Installing Docker EE #{docker_version}"
107+
sudo yum -y install docker-ee-#{docker_version}
108+
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
96109
elif [[ "$reinstall" -eq 1 ]] && [[ "#{legacy_docker}" -eq 1 ]]; then
97110
# cleanup openstack-kilo repo if required
98111
yum remove docker-engine -y || :
@@ -105,6 +118,7 @@ elif [[ "$reinstall" -eq 1 ]] && [[ "#{legacy_docker}" -eq 1 ]]; then
105118
curl https://get.docker.com | sed s/docker-engine/docker-engine-#{docker_version}/ | bash
106119
fi
107120
elif [[ "$reinstall" -eq 1 ]]; then
121+
echo "Installing Docker CE #{docker_version}"
108122
yum remove docker-engine -y || :
109123
yum remove docker-ce || :
110124
yum-config-manager --disable openstack-kilo
@@ -119,7 +133,7 @@ fi
119133
if [[ #{docker_swarm} == "swarm_mode" ]]; then
120134
perl -i -lpe 's!^ExecStart(.+)$!ExecStart$1 !' /lib/systemd/system/docker.service
121135
else
122-
if [[ "$CONTIV_CLUSTER_STORE" == *"consul:"* ]]
136+
if [[ "$CONTIV_CLUSTER_STORE_DRIVER" == "consul" ]]
123137
then
124138
perl -i -lpe 's!^ExecStart(.+)$!ExecStart$1 -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --cluster-store=consul://localhost:8500!' /lib/systemd/system/docker.service
125139
else
@@ -128,7 +142,7 @@ else
128142
fi
129143
130144
# setup docker remote api
131-
mkdir /etc/systemd/system/docker.service.d
145+
mkdir -p /etc/systemd/system/docker.service.d
132146
echo "[Service]" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf
133147
echo "Environment=\\\"no_proxy=$CLUSTER_NODE_IPS,127.0.0.1,localhost,netmaster\\\" \\\"http_proxy=$http_proxy\\\" \\\"https_proxy=$https_proxy\\\"" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf
134148
sudo systemctl daemon-reload
@@ -225,7 +239,7 @@ module VagrantPlugins
225239

226240
def self.up_hook(arg)
227241
unless File.exist?(STATEFILE) # prevent it from writing more than once.
228-
f = File.open(STATEFILE, "w")
242+
f = File.open(STATEFILE, "w")
229243
ENV.each do |x,y|
230244
f.puts "%s=%s" % [x,y]
231245
end
@@ -256,7 +270,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
256270
config.vm.box_check_update = false
257271
if Vagrant.has_plugin?("vagrant-vbguest")
258272
config.vbguest.auto_update = false
259-
end
273+
end
260274
if node_os == "ubuntu" then
261275
config.vm.box = "contiv/ubuntu1604-netplugin"
262276
config.vm.box_version = "0.7.0"

vendor/github.com/contiv/contivmodel/.gitignore renamed to contivmodel/.gitignore

File renamed without changes.

vendor/github.com/contiv/contivmodel/LICENSE renamed to contivmodel/LICENSE

File renamed without changes.

vendor/github.com/contiv/contivmodel/Makefile renamed to contivmodel/Makefile

File renamed without changes.

vendor/github.com/contiv/contivmodel/README.md renamed to contivmodel/README.md

File renamed without changes.

vendor/github.com/contiv/contivmodel/aciGw.json renamed to contivmodel/aciGw.json

File renamed without changes.

vendor/github.com/contiv/contivmodel/appProfile.json renamed to contivmodel/appProfile.json

File renamed without changes.

0 commit comments

Comments
 (0)