blob: 749a60222401f4f1ed49478dc0dbe0ca4cd9a432 [file] [log] [blame]
Zack Williamsce63eb02017-02-28 10:46:22 -07001# CORD Master Makefile
2
3# Timestamp for log files
4TS := $(shell date +'%Y%m%dT%H%M%SZ')
5
Zack Williamsce63eb02017-02-28 10:46:22 -07006# Source path
7BUILD ?= .
8CORD ?= ..
9PI ?= $(BUILD)/platform-install
Zack Williamsa7104e32018-01-03 10:55:26 -070010KUBESPRAY ?= $(BUILD)/kubespray
Zack Williamsce63eb02017-02-28 10:46:22 -070011MAAS ?= $(BUILD)/maas
Zack Williams2f56eee2017-07-17 09:59:16 -070012ONOS_APPS ?= $(CORD)/onos-apps
Zack Williamsce63eb02017-02-28 10:46:22 -070013
14# Configuration paths
Andy Bavier4775df22018-01-05 10:52:30 -070015ifdef PODCONFIG_PATH
Andy Bavier78b0edf2018-01-08 12:57:26 -070016 USECASE := $(shell grep cord_profile: $(PODCONFIG_PATH) | awk '{print $$2}' | awk -F '-' '{print $$1}')
Andy Bavier4775df22018-01-05 10:52:30 -070017else ifdef PODCONFIG
18 USECASE := $(shell echo $(PODCONFIG) | awk -F '-' '{print $$1}')
19else
20 USECASE = invalid
21endif
22
Andy Bavier3316e602017-12-20 19:36:00 -070023PROFILE_D ?= $(CORD)/orchestration/profiles/$(USECASE)
Zack Williamsa7104e32018-01-03 10:55:26 -070024PODCONFIG_PATH ?= $(PROFILE_D)/podconfig/$(PODCONFIG)
Zack Williamsce63eb02017-02-28 10:46:22 -070025
26SCENARIOS_D ?= $(BUILD)/scenarios
27GENCONFIG_D ?= $(BUILD)/genconfig
28
Zack Williamse53c9ca2017-11-29 16:22:13 -070029CONFIG_CORD_PROFILE_DIR ?= $(CORD)/../cord_profile
30
Zack Williamsce63eb02017-02-28 10:46:22 -070031# Milestones/logs paths
32M ?= $(BUILD)/milestones
33LOGS ?= $(BUILD)/logs
34
Zack Williams32295d52017-08-28 22:49:37 -070035PREP_MS ?= $(M)/prereqs-check $(M)/build-local-bootstrap $(M)/ciab-ovs $(M)/vagrant-up $(M)/vagrant-ssh-install $(M)/copy-cord $(M)/cord-config $(M)/copy-config $(M)/prep-buildnode $(M)/prep-headnode $(M)/deploy-elasticstack $(M)/prep-computenode
Zack Williams9f42b972018-01-10 15:05:35 -070036KS_MS ?= $(M)/prep-kubespray $(M)/deploy-kubespray $(M)/finish-kubespray $(M)/install-kubernetes-tools $(M)/start-xos-helm
Andy Bavier35d238e2017-07-24 16:47:22 -070037MAAS_MS ?= $(M)/build-maas-images $(M)/maas-prime $(M)/publish-maas-images $(M)/deploy-maas
38OPENSTACK_MS ?= $(M)/glance-images $(M)/deploy-openstack $(M)/deploy-computenode $(M)/onboard-openstack
Scott Baker9a4d0a12018-03-09 07:52:02 -080039XOS_MS ?= $(M)/docker-images $(M)/publish-docker-images $(M)/start-xos $(M)/onboard-profile
Andy Bavier35d238e2017-07-24 16:47:22 -070040ONOS_MS ?= $(M)/build-onos-apps $(M)/publish-onos-apps $(M)/deploy-onos $(M)/deploy-mavenrepo
Andy Bavierb36b84e2017-08-10 14:46:32 -070041POST_INSTALL_MS ?= $(M)/setup-automation $(M)/setup-ciab-pcu $(M)/compute1-up $(M)/compute2-up $(M)/compute3-up
Scott Baker9a4d0a12018-03-09 07:52:02 -080042LOCAL_MILESTONES ?= $(M)/local-cord-config $(M)/local-docker-images $(M)/local-start-xos $(M)/local-onboard-profile
Zack Williamsa7104e32018-01-03 10:55:26 -070043ALL_MILESTONES ?= $(PREP_MS) $(KS_MS) $(MAAS_MS) $(OPENSTACK_MS) $(XOS_MS) $(ONOS_MS) $(POST_INSTALL_MS) $(LOCAL_MILESTONES)
Zack Williamsce63eb02017-02-28 10:46:22 -070044
45# Configuration files
46MASTER_CONFIG ?= $(GENCONFIG_D)/config.yml
47MAKEFILE_CONFIG ?= $(GENCONFIG_D)/config.mk
48INVENTORY ?= $(GENCONFIG_D)/inventory.ini
49PROFILE_NAME_F ?= $(GENCONFIG_D)/cord_profile
50SCENARIO_NAME_F ?= $(GENCONFIG_D)/cord_scenario
51
52CONFIG_FILES = $(MASTER_CONFIG) $(MAKEFILE_CONFIG) $(INVENTORY) $(PROFILE_NAME_F) $(SCENARIO_NAME_F)
53
54include $(MAKEFILE_CONFIG)
55
56# Set using files from genconfig
57SCENARIO = $(shell cat $(SCENARIO_NAME_F))
58PROFILE = $(shell cat $(PROFILE_NAME_F))
59
60# Host names for SSH commands
61BUILDNODE ?= head1
62HEADNODE ?= ${BUILDNODE}
63
64# Vagrant config
65VAGRANT_PROVIDER ?= libvirt
66VAGRANT_VMS ?= $(HEADNODE)
Andy Bavier35d238e2017-07-24 16:47:22 -070067VAGRANT_SWITCHES ?= leaf1
Zack Williamsce63eb02017-02-28 10:46:22 -070068VAGRANT_CWD ?= $(SCENARIOS_D)/$(SCENARIO)/
Zack Williamsce63eb02017-02-28 10:46:22 -070069
Luca Pretedcac43b2017-09-14 14:35:13 -070070# Virsh config
71VIRSH_CORDDEV_DOMAIN ?= cord_corddev
72
Zack Williamsce63eb02017-02-28 10:46:22 -070073# Ansible args, for verbosity and other runtime parameters
74ANSIBLE_ARGS ?=
Zack Williamsf87ef6e2017-10-16 22:30:00 -070075EXTRA_VARS ?= --extra-vars "@/opt/cord_profile/genconfig/config.yml"
Zack Williamsce63eb02017-02-28 10:46:22 -070076
77# Commands
78SHELL = bash -o pipefail
79VAGRANT ?= VAGRANT_CWD=$(VAGRANT_CWD) vagrant
80ANSIBLE ?= ansible -i $(INVENTORY)
81ANSIBLE_PB ?= ansible-playbook $(ANSIBLE_ARGS) -i $(INVENTORY) --extra-vars @$(MASTER_CONFIG)
Zack Williamsd589e082018-03-01 17:21:56 -070082ANSIBLE_PB_KS ?= ANSIBLE_CONFIG=../ansible.cfg ansible-playbook $(ANSIBLE_ARGS) -b -i inventory/cord/hosts.ini --extra-vars @../$(MASTER_CONFIG)
Zack Williamsf87ef6e2017-10-16 22:30:00 -070083ANSIBLE_PB_LOCAL ?= ansible-playbook $(ANSIBLE_ARGS) -i $(PI)/inventory/head-localhost $(EXTRA_VARS)
84ANSIBLE_PB_MAAS ?= ansible-playbook $(ANSIBLE_ARGS) -i /etc/maas/ansible/pod-inventory $(EXTRA_VARS)
Zack Williamsce63eb02017-02-28 10:46:22 -070085IMAGEBUILDER ?= python $(BUILD)/scripts/imagebuilder.py
Zack Williamsa7104e32018-01-03 10:55:26 -070086LOGCMD ?= 2>&1 | tee -a $(abspath $(LOGS)/$(TS)_$(@F))
Zack Williamsce63eb02017-02-28 10:46:22 -070087SSH_HEAD ?= ssh $(HEADNODE)
88SSH_BUILD ?= ssh $(BUILDNODE)
89
90# default target, prints help
91.DEFAULT: help
92
93help:
Zack Williams32295d52017-08-28 22:49:37 -070094 @echo "Please specify a target (config, build, ...)"
Zack Williamsce63eb02017-02-28 10:46:22 -070095
96# Config file generation
Zack Williamsd3a527c2017-09-13 12:24:57 -070097config: $(CONFIG_FILES)
Zack Williams32295d52017-08-28 22:49:37 -070098 @echo ""
99 @echo "CORD is configured with profile: '$(PROFILE)', scenario: '$(SCENARIO)'"
100 @echo "Run 'make -j4 build' to continue."
Zack Williamsce63eb02017-02-28 10:46:22 -0700101
Zack Williamsce63eb02017-02-28 10:46:22 -0700102$(CONFIG_FILES):
Andy Bavier4775df22018-01-05 10:52:30 -0700103 @test -e "$(PODCONFIG_PATH)" || { echo ""; echo "PODCONFIG file $(PODCONFIG_PATH) doesn't exist!" ; echo "*** Specify a valid CORD config file using PODCONFIG or PODCONFIG_PATH ***"; echo ""; exit 1; }
Zack Williams299098d2018-04-19 22:15:52 -0700104 ansible-playbook $(ANSIBLE_ARGS) -i 'localhost,' --extra-vars="cord_podconfig='$(PODCONFIG_PATH)' genconfig_dir='$(GENCONFIG_D)' scenarios_dir='$(SCENARIOS_D)' platform_install_dir='$(PI)' cord_profile_src_dir='$(PROFILE_D)' " $(BUILD)/ansible/genconfig.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700105
Zack Williamsd3a527c2017-09-13 12:24:57 -0700106printconfig:
Zack Williams32295d52017-08-28 22:49:37 -0700107 @echo "Scenario: '$(SCENARIO)'"
108 @echo "Profile: '$(PROFILE)'"
Zack Williamsce63eb02017-02-28 10:46:22 -0700109
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700110# == BUILD TARGET == #
111# This is entirely determined by the podconfig/scenario, and should generally
112# be set to only one value - everything else should be a dependency
Zack Williamsce63eb02017-02-28 10:46:22 -0700113build: $(BUILD_TARGETS)
Matthew Davisdfe1ea82018-04-27 07:43:24 +0000114 @echo "make build finished sucessfully"
Zack Williamsce63eb02017-02-28 10:46:22 -0700115
Zack Williams32295d52017-08-28 22:49:37 -0700116# Utility targets
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700117ansible-ping:
118 $(ANSIBLE) -m ping all $(LOGCMD)
119
120ansible-setup:
121 $(ANSIBLE) -m setup all $(LOGCMD)
122
Zack Williamsce63eb02017-02-28 10:46:22 -0700123clean-images:
Scott Baker9a4d0a12018-03-09 07:52:02 -0800124 rm -f $(M)/docker-images $(M)/local-docker-images $(M)/copy-cord $(M)/build-maas-images $(M)/build-onos-apps $(M)/publish-maas-images $(M)/publish-docker-images $(M)/publish-onos-apps
Zack Williamsce63eb02017-02-28 10:46:22 -0700125
126clean-genconfig:
127 rm -f $(CONFIG_FILES)
128
129clean-profile:
Zack Williams93ae6382017-10-04 16:31:06 -0700130 rm -rf $(CONFIG_CORD_PROFILE_DIR)/*
Zack Williamsd3a527c2017-09-13 12:24:57 -0700131 rm -f $(M)/cord-config $(M)/copy-config $(M)/onboard-profile $(M)/local-onboard-profile $(M)/onboard-openstack $(M)/refresh-fabric
Zack Williamsce63eb02017-02-28 10:46:22 -0700132
Luca Pretedcac43b2017-09-14 14:35:13 -0700133clean-all: virsh-domain-destroy vagrant-destroy clean-profile clean-genconfig
Zack Williamsce63eb02017-02-28 10:46:22 -0700134 rm -f $(ALL_MILESTONES)
135
Zack Williams32295d52017-08-28 22:49:37 -0700136clean-onos:
Zack Williams9d0b6272017-09-21 16:43:39 -0700137 $(ANSIBLE_PB) $(PI)/teardown-onos-playbook.yml $(LOGCMD)
Zack Williams32295d52017-08-28 22:49:37 -0700138 rm -f $(M)/deploy-onos $(M)/onos-debug
139
140clean-openstack:
141 $(SSH_HEAD) "/opt/cord/build/platform-install/scripts/clean_openstack.sh" $(LOGCMD)
142 rm -f $(M)/onboard-openstack
143
Zack Williamsa7104e32018-01-03 10:55:26 -0700144clean-kubespray:
145 rm -f $(KS_MS)
146 rm -rf $(KUBESPRAY)
147
Zack Williamsba3e2462018-01-19 11:52:31 -0700148# prereqs append the milestones dir to the front, but diag targets can be run multiple times
149$(M)/collect-diag: | collect-diag
150$(M)/collect-diag-maas: | collect-diag-maas
151
Zack Williams32295d52017-08-28 22:49:37 -0700152collect-diag:
153 $(ANSIBLE_PB) $(PI)/collect-diag-playbook.yml $(LOGCMD)
154
Zack Williamsba3e2462018-01-19 11:52:31 -0700155collect-diag-maas:
156 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) --private-key ~/.ssh/cord_rsa $(PI)/collect-diag-playbook.yml" $(LOGCMD)
157
Zack Williams32295d52017-08-28 22:49:37 -0700158compute-node-refresh:
159 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) --private-key ~/.ssh/cord_rsa $(PI)/compute-node-refresh-playbook.yml" $(LOGCMD)
160
Zack Williams2b26e562017-09-05 16:14:04 -0700161vagrant-destroy:
Zack Williams75a1df32017-11-14 14:48:45 -0700162 $(VAGRANT) destroy -f $(LOGCMD) || true
Zack Williams32295d52017-08-28 22:49:37 -0700163 rm -f $(M)/vagrant-up $(M)/vagrant-ssh-install $(VAGRANT_SSH_CONF)
Zack Williams2b26e562017-09-05 16:14:04 -0700164
Luca Pretedcac43b2017-09-14 14:35:13 -0700165virsh-domain-destroy:
166 virsh destroy ${VIRSH_CORDDEV_DOMAIN} || true
167 virsh undefine ${VIRSH_CORDDEV_DOMAIN} || true
168
Zack Williams2b26e562017-09-05 16:14:04 -0700169xos-teardown: xos-update-images
Zack Williams9d0b6272017-09-21 16:43:39 -0700170 $(ANSIBLE_PB) $(PI)/teardown-xos-playbook.yml $(LOGCMD)
Zack Williamse53c9ca2017-11-29 16:22:13 -0700171 rm -f $(M)/onboard-profile
Matteo Scandolobb164c62018-03-01 08:23:09 -0800172 rm -f $(M)/local-onboard-profile
Zack Williams2b26e562017-09-05 16:14:04 -0700173
174xos-update-images: clean-images
175 rm -f $(M)/start-xos $(M)/local-start-xos
176
Zack Williamse53c9ca2017-11-29 16:22:13 -0700177# local scenario helpers
178clean-local: local-xos-teardown clean-profile clean-genconfig clean-images
179 rm -f $(LOCAL_MILESTONES)
180
181local-ubuntu-dev-env:
182 $(ANSIBLE_PB) $(PI)/bootstrap-dev-env.yml $(LOGCMD)
183
Zack Williamsf2572b52018-01-24 08:19:49 -0700184local-xos-teardown: xos-update-images
Andy Bavieree2a1a52018-01-26 14:37:29 -0800185 $(eval COMPOSE_FILE := $(shell cd $(CONFIG_CORD_PROFILE_DIR); ls dynamic_load/* 2>/dev/null | tr '\n' ':')docker-compose.yml)
186 cd $(CONFIG_CORD_PROFILE_DIR); COMPOSE_FILE=$(COMPOSE_FILE) docker-compose -p $(PROFILE) rm -s -f || true
Zack Williamse53c9ca2017-11-29 16:22:13 -0700187 rm -f $(M)/local-onboard-profile
188
Matteo Scandoloe75e7972017-12-12 13:23:54 -0800189# ===== usage: make xos-service-config NAME=exampleservice PATH=exampleservice KEYPAIR=exampleservice_rsa =======
190
191xos-service-config:
192 # NOTE check that variables are set before calling ansible?
193 $(ANSIBLE_PB) --extra-vars 'xos_dynamic_services={"name": $(NAME), "path"=$(PATH), "keypair"= $(KEYPAIR)}' $(PI)/xos-service-config.yml $(LOGCMD)
194
195xos-services-up:
196 $(ANSIBLE_PB) $(PI)/xos-services-up.yml $(LOGCMD)
197
Zack Williams7b9f0c52018-05-04 10:19:33 -0700198# wait for dynamic loading
199DYNAMICLOAD_WAIT ?= 60
200DYNAMICLOAD_URL ?= http://localhost:9101
201DYNAMICLOAD_MODELS ?=
202
203xos-wait-dynamicload:
204 python $(BUILD)/scripts/xos-wait-dynamicload.py $(DYNAMICLOAD_WAIT) $(DYNAMICLOAD_URL) $(DYNAMICLOAD_MODELS)
205
Zack Williamse53c9ca2017-11-29 16:22:13 -0700206# docs
207.PHONY: docs
208docs:
209 cd docs; make
Andy Bavier35d238e2017-07-24 16:47:22 -0700210
Zack Williamsce63eb02017-02-28 10:46:22 -0700211# == PREREQS == #
Zack Williams9f42b972018-01-10 15:05:35 -0700212VAGRANT_UP_PREREQS ?=
213COPY_CORD_PREREQS ?=
214CORD_CONFIG_PREREQS ?=
215CONFIG_SSH_KEY_PREREQS ?=
216PREP_BUILDNODE_PREREQS ?=
217PREP_HEADNODE_PREREQS ?=
218PREP_KUBESPRAY_PREREQS ?=
219DOCKER_IMAGES_PREREQS ?=
220PUBLISH_DOCKER_IMAGES_PREREQS ?=
221START_XOS_PREREQS ?=
222BUILD_ONOS_APPS_PREREQS ?=
223DEPLOY_ONOS_PREREQS ?=
224DEPLOY_MAVENREPO_PREREQS ?=
225DEPLOY_OPENSTACK_PREREQS ?=
226ONBOARD_OPENSTACK_PREREQS ?=
227SETUP_AUTOMATION_PREREQS ?=
228TESTING_PREREQS ?=
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700229
Zack Williamsce63eb02017-02-28 10:46:22 -0700230# == MILESTONES == #
231# empty target files are touched in the milestones dir to indicate completion
232
Andy Bavier35d238e2017-07-24 16:47:22 -0700233# Prep targets
Zack Williamsce63eb02017-02-28 10:46:22 -0700234$(M)/prereqs-check:
235 $(ANSIBLE_PB) $(PI)/prereqs-check-playbook.yml $(LOGCMD)
236 touch $@
237
Andy Bavierafaa5302017-08-15 08:56:15 -0700238$(M)/build-local-bootstrap:
239 $(ANSIBLE_PB) $(BUILD)/ansible/build-local-bootstrap.yml $(LOGCMD)
240 touch $@
241
Andy Bavierb36b84e2017-08-10 14:46:32 -0700242$(M)/ciab-ovs:
243 $(ANSIBLE_PB) $(BUILD)/ansible/ciab-ovs.yml $(LOGCMD)
244 touch $@
245
Zack Williamsce63eb02017-02-28 10:46:22 -0700246$(M)/vagrant-up: | $(VAGRANT_UP_PREREQS)
247 $(VAGRANT) up $(VAGRANT_VMS) --provider $(VAGRANT_PROVIDER) $(LOGCMD)
Zack Williams32295d52017-08-28 22:49:37 -0700248 touch $@
249
250$(M)/vagrant-ssh-install: | $(M)/vagrant-up
Andy Baviere6c255f2017-09-15 16:13:37 -0700251 $(VAGRANT) ssh-config $(VAGRANT_VMS) > /tmp/vagrant_ssh_config
252 $(ANSIBLE_PB) $(BUILD)/ansible/vagrant-ssh-install.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700253 touch $@
254
Zack Williams39c9aa92017-10-17 08:35:00 -0700255$(M)/config-ssh-key: | $(CONFIG_SSH_KEY_PREREQS)
Zack Williams2b26e562017-09-05 16:14:04 -0700256 $(ANSIBLE_PB) $(BUILD)/ansible/config-ssh-key.yml $(LOGCMD)
257 touch $@
258
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700259$(M)/copy-cord: | $(COPY_CORD_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700260 $(ANSIBLE_PB) $(PI)/copy-cord-playbook.yml $(LOGCMD)
261 touch $@
262
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700263$(M)/cord-config: | $(CORD_CONFIG_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700264 $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
Zack Williamsc597d422018-01-22 14:25:06 -0700265 rm -rf $(CONFIG_CORD_PROFILE_DIR)/genconfig
Zack Williamsce63eb02017-02-28 10:46:22 -0700266 cp -r $(GENCONFIG_D) $(CONFIG_CORD_PROFILE_DIR)/genconfig
267 touch $@
268
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700269$(M)/copy-config: | $(M)/cord-config
Zack Williamsce63eb02017-02-28 10:46:22 -0700270 $(ANSIBLE_PB) $(PI)/copy-profile-playbook.yml $(LOGCMD)
271 touch $@
272
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700273$(M)/prep-buildnode: | $(M)/cord-config $(PREP_BUILDNODE_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700274 $(ANSIBLE_PB) $(PI)/prep-buildnode-playbook.yml $(LOGCMD)
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700275 @echo Waiting 20 seconds to timeout SSH ControlPersist, and so future ansible commands gain docker group membership
276 sleep 20
Zack Williamsce63eb02017-02-28 10:46:22 -0700277 touch $@
278
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700279$(M)/prep-headnode: | $(M)/cord-config $(PREP_HEADNODE_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700280 $(ANSIBLE_PB) $(PI)/prep-headnode-playbook.yml $(LOGCMD)
281 touch $@
282
Zack Williams0a7ef162017-07-18 18:15:26 -0700283$(M)/deploy-elasticstack: | $(M)/prep-headnode
Zack Williamsce63eb02017-02-28 10:46:22 -0700284 $(ANSIBLE_PB) $(PI)/deploy-elasticstack-playbook.yml $(LOGCMD)
285 touch $@
286
287$(M)/prep-computenode: | $(M)/prep-headnode
288 $(ANSIBLE_PB) $(PI)/prep-computenode-playbook.yml $(LOGCMD)
289 touch $@
290
Andy Bavier35d238e2017-07-24 16:47:22 -0700291
Zack Williams9f42b972018-01-10 15:05:35 -0700292# kubernetes targets
293$(M)/prep-kubespray: | $(M)/prep-headnode $(M)/prep-computenode $(PREP_KUBESPRAY_PREREQS)
Zack Williamsa7104e32018-01-03 10:55:26 -0700294 $(ANSIBLE_PB) $(BUILD)/ansible/prep-kubespray.yml $(LOGCMD)
295 touch $@
296
297$(M)/deploy-kubespray: | $(M)/prep-kubespray
298 cd $(KUBESPRAY); $(ANSIBLE_PB_KS) cluster.yml $(LOGCMD)
299 touch $@
300
Zack Williams9f42b972018-01-10 15:05:35 -0700301$(M)/finish-kubespray: | $(M)/deploy-kubespray
302 cd $(BUILD); $(ANSIBLE_PB) $(BUILD)/ansible/finish-kubespray.yml $(LOGCMD)
303 touch $@
304
Zack Williams917cceb2018-03-13 13:28:59 -0700305$(M)/install-kubernetes-tools: | $(M)/finish-kubespray
Zack Williams9f42b972018-01-10 15:05:35 -0700306 $(ANSIBLE_PB) $(PI)/install-kubernetes-tools-playbook.yml $(LOGCMD)
307 touch $@
308
Zack Williams917cceb2018-03-13 13:28:59 -0700309$(M)/start-xos-helm: | $(M)/install-kubernetes-tools $(M)/publish-docker-images
Zack Williams9f42b972018-01-10 15:05:35 -0700310 $(ANSIBLE_PB) $(PI)/start-xos-helm-playbook.yml $(LOGCMD)
311 touch $@
312
Zack Williamsa7104e32018-01-03 10:55:26 -0700313
Andy Bavier35d238e2017-07-24 16:47:22 -0700314# MaaS targets
315$(M)/build-maas-images: | $(M)/prep-buildnode $(BUILD_MAAS_IMAGES_PREREQS)
Andy Bavierafaa5302017-08-15 08:56:15 -0700316 $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build/maas; rm -f consul.image; make MAKE_CONFIG=../$(MAKEFILE_CONFIG) build" $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700317 touch $@
318
Andy Bavier21e4fe42017-09-29 10:27:12 -0700319$(M)/maas-prime: | $(M)/prep-headnode
Andy Bavier35d238e2017-07-24 16:47:22 -0700320 $(ANSIBLE_PB) $(MAAS)/prime-node.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700321 touch $@
322
Andy Bavier35d238e2017-07-24 16:47:22 -0700323$(M)/publish-maas-images: | $(M)/maas-prime $(M)/build-maas-images
Andy Bavier09410472017-08-15 14:29:35 -0700324 $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build/maas; rm -f consul.publish; make MAKE_CONFIG=../$(MAKEFILE_CONFIG) publish" $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700325 touch $@
326
Andy Bavier35d238e2017-07-24 16:47:22 -0700327$(M)/deploy-maas: | $(M)/publish-maas-images $(M)/cord-config $(M)/copy-config
328 $(ANSIBLE_PB) $(MAAS)/head-node.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700329 touch $@
330
Andy Bavier35d238e2017-07-24 16:47:22 -0700331
332# ONOS targets
Zack Williams5e039f02017-11-16 09:50:09 -0700333$(M)/deploy-mavenrepo: | $(M)/docker-images $(DEPLOY_MAVENREPO_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700334 $(ANSIBLE_PB) $(PI)/deploy-mavenrepo-playbook.yml $(LOGCMD)
335 touch $@
336
Zack Williams8845ee52017-10-04 23:13:26 -0700337$(M)/deploy-onos: | $(M)/docker-images $(M)/deploy-mavenrepo $(DEPLOY_ONOS_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700338 $(ANSIBLE_PB) $(PI)/deploy-onos-playbook.yml $(LOGCMD)
339 touch $@
340
Zack Williams58e41572017-09-29 07:57:14 -0700341$(M)/onos-debug: | $(M)/onboard-profile $(M)/deploy-onos
Zack Williams32295d52017-08-28 22:49:37 -0700342 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onos-debug-playbook.yml" $(LOGCMD)
343 touch $@
344
Andy Bavier35d238e2017-07-24 16:47:22 -0700345
346# XOS targets
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700347$(M)/docker-images: | $(M)/prep-buildnode $(DOCKER_IMAGES_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700348 $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build; $(IMAGEBUILDER) -f $(MASTER_CONFIG) -l $(BUILD)/image_logs -g $(BUILD)/ib_graph.dot -a $(BUILD)/ib_actions.yml " $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700349 touch $@
350
Andy Bavier35d238e2017-07-24 16:47:22 -0700351# Requires ib_actions.yml file which is on the build host
Scott Baker9a4d0a12018-03-09 07:52:02 -0800352$(M)/publish-docker-images: | $(M)/docker-images $(PUBLISH_DOCKER_IMAGES_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700353 $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build; $(ANSIBLE_PB_LOCAL) $(PI)/publish-images-playbook.yml" $(LOGCMD)
354 touch $@
355
Zack Williamsd6939ad2018-03-28 15:14:39 -0700356$(M)/start-xos: | $(M)/prep-headnode $(M)/cord-config $(M)/docker-images $(START_XOS_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700357 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/start-xos-playbook.yml" $(LOGCMD)
358 touch $@
359
Andy Bavier35d238e2017-07-24 16:47:22 -0700360$(M)/onboard-profile: | $(M)/start-xos
361 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-profile-playbook.yml" $(LOGCMD)
Zack Williams2f56eee2017-07-17 09:59:16 -0700362 touch $@
363
Andy Bavier35d238e2017-07-24 16:47:22 -0700364
365# OpenStack targets
366$(M)/glance-images: | $(M)/prep-headnode
367 $(ANSIBLE_PB) $(PI)/glance-images-playbook.yml $(LOGCMD)
368 touch $@
369
Zack Williamsba3e2462018-01-19 11:52:31 -0700370$(M)/deploy-openstack: | $(M)/prep-headnode $(DEPLOY_OPENSTACK_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700371 $(ANSIBLE_PB) $(PI)/deploy-openstack-playbook.yml $(LOGCMD)
372 touch $@
373
Zack Williamsba3e2462018-01-19 11:52:31 -0700374$(M)/deploy-computenode: | $(M)/prep-computenode $(M)/deploy-openstack
Andy Bavier35d238e2017-07-24 16:47:22 -0700375 $(ANSIBLE_PB) $(PI)/deploy-computenode-playbook.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700376 touch $@
377
Zack Williamsba3e2462018-01-19 11:52:31 -0700378$(M)/onboard-openstack: | $(M)/deploy-computenode $(M)/glance-images $(M)/deploy-onos $(M)/onboard-profile $(ONBOARD_OPENSTACK_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700379 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-openstack-playbook.yml" $(LOGCMD)
380 touch $@
381
Andy Bavier35d238e2017-07-24 16:47:22 -0700382
383# Post-onboarding targets
384$(M)/setup-automation: | $(M)/onboard-profile $(M)/deploy-onos $(SETUP_AUTOMATION_PREREQS)
385 $(ANSIBLE_PB) $(PI)/cord-automation-playbook.yml $(LOGCMD)
386 touch $@
387
388
389# Additional CiaB targets
Andy Bavier35d238e2017-07-24 16:47:22 -0700390$(M)/setup-ciab-pcu: | $(M)/setup-automation
391 $(ANSIBLE_PB) $(MAAS)/setup-ciab-pcu.yml
392 touch $@
393
Andy Bavierb36b84e2017-08-10 14:46:32 -0700394$(M)/compute%-up: | $(M)/setup-ciab-pcu
Andy Bavier35d238e2017-07-24 16:47:22 -0700395 $(VAGRANT) up compute$* --provider $(VAGRANT_PROVIDER) $(LOGCMD)
396 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) ansible/maas-provision.yml --extra-vars='maas_user=maas vagrant_name=cord_compute$*'" $(LOGCMD)
397 touch $@
398
Andy Bavier8b391202018-02-12 09:37:16 -0700399compute1-up: | $(M)/compute1-up
400compute2-up: | $(M)/compute2-up
401compute3-up: | $(M)/compute3-up
Andy Bavier676edf02018-01-29 10:44:56 -0700402
403# Fabric targets
404fabric-refresh: | $(M)/setup-automation
405 $(ANSIBLE_PB) $(PI)/cord-refresh-fabric.yml $(LOGCMD)
406
407fabric-pingtest:
408 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) --private-key ~/.ssh/cord_rsa $(PI)/cord-fabric-pingtest.yml" $(LOGCMD)
Andy Bavierb36b84e2017-08-10 14:46:32 -0700409
Andy Bavier35d238e2017-07-24 16:47:22 -0700410
Zack Williamsce63eb02017-02-28 10:46:22 -0700411# Testing targets
Kailash Khalasi8f8e73e2018-03-19 10:42:46 -0700412venv-xosapitest:
413 bash ../test/cord-tester/src/test/setup/venv-apitests.sh || true
414
415xos-api-test: venv-xosapitest
416 bash -c "source venv-xosapitest/bin/activate && $(ANSIBLE_PB) $(PI)/xos-api-test-playbook.yml" $(LOGCMD)
417
418clean-xos-api-tests:
419 rm -rf ../test/cord-tester/src/test/cord-api/Tests/Logs/*
420 rm -rf venv-xosapitest || true
Zack Williams8766f122018-02-07 17:44:07 -0700421
422# R-CORD specific targets
Zack Williamsba3e2462018-01-19 11:52:31 -0700423pod-test: | $(TESTING_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700424 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/pod-test-playbook.yml" $(LOGCMD)
425
Zack Williams8766f122018-02-07 17:44:07 -0700426rcord-%:
427 $(ANSIBLE_PB) ../orchestration/profiles/rcord/test/rcord-$*-playbook.yml $(LOGCMD)
428
429# M-CORD specific targets
Andy Bavierfa2b7042018-01-23 15:36:57 -0800430mcord-%:
431 $(ANSIBLE_PB) ../orchestration/profiles/mcord/test/mcord-$*-playbook.yml $(LOGCMD)
Andy Bavier8b1bd362018-01-03 16:41:38 -0700432
Zack Williams8766f122018-02-07 17:44:07 -0700433# E-CORD specific targets
434ecord-%:
435 $(ANSIBLE_PB) ../orchestration/profiles/ecord/test/ecord-$*-playbook.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700436
Zack Williams32295d52017-08-28 22:49:37 -0700437
Zack Williamsce63eb02017-02-28 10:46:22 -0700438# Local Targets, bring up XOS containers without a VM
Zack Williamsce63eb02017-02-28 10:46:22 -0700439$(M)/local-cord-config:
440 $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
441 touch $@
442
443$(M)/local-docker-images: | $(M)/local-cord-config
444 $(IMAGEBUILDER) -f $(MASTER_CONFIG) -l $(BUILD)/image_logs -g $(BUILD)/ib_graph.dot -a $(BUILD)/ib_actions.yml $(LOGCMD)
445 touch $@
446
Scott Baker9a4d0a12018-03-09 07:52:02 -0800447$(M)/local-start-xos: | $(M)/local-docker-images
Zack Williamsce63eb02017-02-28 10:46:22 -0700448 $(ANSIBLE_PB) $(PI)/start-xos-playbook.yml $(LOGCMD)
449 touch $@
450
451$(M)/local-onboard-profile: | $(M)/local-start-xos
452 $(ANSIBLE_PB) $(PI)/onboard-profile-playbook.yml $(LOGCMD)
453 touch $@
454