blob: 2af3a2c2863df16a8ea8d70665dc06e76ff40338 [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 Williamsa7104e32018-01-03 10:55:26 -070036KS_MS ?= $(M)/prep-kubespray $(M)/deploy-kubespray
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
39XOS_MS ?= $(M)/docker-images $(M)/core-image $(M)/publish-docker-images $(M)/start-xos $(M)/onboard-profile
40ONOS_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
Zack Williamsce63eb02017-02-28 10:46:22 -070042LOCAL_MILESTONES ?= $(M)/local-cord-config $(M)/local-docker-images $(M)/local-core-image $(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 Williamsa7104e32018-01-03 10:55:26 -070082ANSIBLE_PB_KS ?= ANSIBLE_CONFIG=../ansible.cfg ansible-playbook $(ANSIBLE_ARGS) -b -i inventory/inventory.cord --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; }
Andy Bavier3316e602017-12-20 19:36:00 -0700104 ansible-playbook -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)
114
Zack Williams32295d52017-08-28 22:49:37 -0700115# Utility targets
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700116ansible-ping:
117 $(ANSIBLE) -m ping all $(LOGCMD)
118
119ansible-setup:
120 $(ANSIBLE) -m setup all $(LOGCMD)
121
Zack Williamsce63eb02017-02-28 10:46:22 -0700122clean-images:
Zack Williams9d0b6272017-09-21 16:43:39 -0700123 rm -f $(M)/docker-images $(M)/local-docker-images $(M)/copy-cord $(M)/core-image $(M)/local-core-image $(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 -0700124
125clean-genconfig:
126 rm -f $(CONFIG_FILES)
127
128clean-profile:
Zack Williams93ae6382017-10-04 16:31:06 -0700129 rm -rf $(CONFIG_CORD_PROFILE_DIR)/*
Zack Williamsd3a527c2017-09-13 12:24:57 -0700130 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 -0700131
Luca Pretedcac43b2017-09-14 14:35:13 -0700132clean-all: virsh-domain-destroy vagrant-destroy clean-profile clean-genconfig
Zack Williamsce63eb02017-02-28 10:46:22 -0700133 rm -f $(ALL_MILESTONES)
134
Zack Williams32295d52017-08-28 22:49:37 -0700135clean-onos:
Zack Williams9d0b6272017-09-21 16:43:39 -0700136 $(ANSIBLE_PB) $(PI)/teardown-onos-playbook.yml $(LOGCMD)
Zack Williams32295d52017-08-28 22:49:37 -0700137 rm -f $(M)/deploy-onos $(M)/onos-debug
138
139clean-openstack:
140 $(SSH_HEAD) "/opt/cord/build/platform-install/scripts/clean_openstack.sh" $(LOGCMD)
141 rm -f $(M)/onboard-openstack
142
Zack Williamsa7104e32018-01-03 10:55:26 -0700143clean-kubespray:
144 rm -f $(KS_MS)
145 rm -rf $(KUBESPRAY)
146
Zack Williamsba3e2462018-01-19 11:52:31 -0700147# prereqs append the milestones dir to the front, but diag targets can be run multiple times
148$(M)/collect-diag: | collect-diag
149$(M)/collect-diag-maas: | collect-diag-maas
150
Zack Williams32295d52017-08-28 22:49:37 -0700151collect-diag:
152 $(ANSIBLE_PB) $(PI)/collect-diag-playbook.yml $(LOGCMD)
153
Zack Williamsba3e2462018-01-19 11:52:31 -0700154collect-diag-maas:
155 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) --private-key ~/.ssh/cord_rsa $(PI)/collect-diag-playbook.yml" $(LOGCMD)
156
Zack Williams32295d52017-08-28 22:49:37 -0700157compute-node-refresh:
158 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) --private-key ~/.ssh/cord_rsa $(PI)/compute-node-refresh-playbook.yml" $(LOGCMD)
159
Zack Williams2b26e562017-09-05 16:14:04 -0700160vagrant-destroy:
Zack Williams75a1df32017-11-14 14:48:45 -0700161 $(VAGRANT) destroy -f $(LOGCMD) || true
Zack Williams32295d52017-08-28 22:49:37 -0700162 rm -f $(M)/vagrant-up $(M)/vagrant-ssh-install $(VAGRANT_SSH_CONF)
Zack Williams2b26e562017-09-05 16:14:04 -0700163
Luca Pretedcac43b2017-09-14 14:35:13 -0700164virsh-domain-destroy:
165 virsh destroy ${VIRSH_CORDDEV_DOMAIN} || true
166 virsh undefine ${VIRSH_CORDDEV_DOMAIN} || true
167
Zack Williams2b26e562017-09-05 16:14:04 -0700168xos-teardown: xos-update-images
Zack Williams9d0b6272017-09-21 16:43:39 -0700169 $(ANSIBLE_PB) $(PI)/teardown-xos-playbook.yml $(LOGCMD)
Zack Williamse53c9ca2017-11-29 16:22:13 -0700170 rm -f $(M)/onboard-profile
Zack Williams2b26e562017-09-05 16:14:04 -0700171
172xos-update-images: clean-images
173 rm -f $(M)/start-xos $(M)/local-start-xos
174
Zack Williamse53c9ca2017-11-29 16:22:13 -0700175# local scenario helpers
176clean-local: local-xos-teardown clean-profile clean-genconfig clean-images
177 rm -f $(LOCAL_MILESTONES)
178
179local-ubuntu-dev-env:
180 $(ANSIBLE_PB) $(PI)/bootstrap-dev-env.yml $(LOGCMD)
181
182local-xos-teardown:
183 cd $(CONFIG_CORD_PROFILE_DIR); docker-compose -p $(PROFILE) rm -s -f || true
184 rm -f $(M)/local-onboard-profile
185
186# docs
187.PHONY: docs
188docs:
189 cd docs; make
Andy Bavier35d238e2017-07-24 16:47:22 -0700190
Zack Williamsce63eb02017-02-28 10:46:22 -0700191# == PREREQS == #
Zack Williamsba3e2462018-01-19 11:52:31 -0700192VAGRANT_UP_PREREQS ?=
193COPY_CORD_PREREQS ?=
194CORD_CONFIG_PREREQS ?=
195CONFIG_SSH_KEY_PREREQS ?=
196PREP_BUILDNODE_PREREQS ?=
197PREP_HEADNODE_PREREQS ?=
198PREP_KUBESPRAY_PREREQS ?=
199DOCKER_IMAGES_PREREQS ?=
200START_XOS_PREREQS ?=
201BUILD_ONOS_APPS_PREREQS ?=
202DEPLOY_ONOS_PREREQS ?=
203DEPLOY_MAVENREPO_PREREQS ?=
204DEPLOY_OPENSTACK_PREREQS ?=
205ONBOARD_OPENSTACK_PREREQS ?=
206SETUP_AUTOMATION_PREREQS ?=
207TESTING_PREREQS ?=
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700208
Zack Williamsce63eb02017-02-28 10:46:22 -0700209# == MILESTONES == #
210# empty target files are touched in the milestones dir to indicate completion
211
Andy Bavier35d238e2017-07-24 16:47:22 -0700212# Prep targets
Zack Williamsce63eb02017-02-28 10:46:22 -0700213$(M)/prereqs-check:
214 $(ANSIBLE_PB) $(PI)/prereqs-check-playbook.yml $(LOGCMD)
215 touch $@
216
Andy Bavierafaa5302017-08-15 08:56:15 -0700217$(M)/build-local-bootstrap:
218 $(ANSIBLE_PB) $(BUILD)/ansible/build-local-bootstrap.yml $(LOGCMD)
219 touch $@
220
Andy Bavierb36b84e2017-08-10 14:46:32 -0700221$(M)/ciab-ovs:
222 $(ANSIBLE_PB) $(BUILD)/ansible/ciab-ovs.yml $(LOGCMD)
223 touch $@
224
Zack Williamsce63eb02017-02-28 10:46:22 -0700225$(M)/vagrant-up: | $(VAGRANT_UP_PREREQS)
226 $(VAGRANT) up $(VAGRANT_VMS) --provider $(VAGRANT_PROVIDER) $(LOGCMD)
Zack Williams32295d52017-08-28 22:49:37 -0700227 touch $@
228
229$(M)/vagrant-ssh-install: | $(M)/vagrant-up
Andy Baviere6c255f2017-09-15 16:13:37 -0700230 $(VAGRANT) ssh-config $(VAGRANT_VMS) > /tmp/vagrant_ssh_config
231 $(ANSIBLE_PB) $(BUILD)/ansible/vagrant-ssh-install.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700232 touch $@
233
Zack Williams39c9aa92017-10-17 08:35:00 -0700234$(M)/config-ssh-key: | $(CONFIG_SSH_KEY_PREREQS)
Zack Williams2b26e562017-09-05 16:14:04 -0700235 $(ANSIBLE_PB) $(BUILD)/ansible/config-ssh-key.yml $(LOGCMD)
236 touch $@
237
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700238$(M)/copy-cord: | $(COPY_CORD_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700239 $(ANSIBLE_PB) $(PI)/copy-cord-playbook.yml $(LOGCMD)
240 touch $@
241
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700242$(M)/cord-config: | $(CORD_CONFIG_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700243 $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
244 cp -r $(GENCONFIG_D) $(CONFIG_CORD_PROFILE_DIR)/genconfig
245 touch $@
246
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700247$(M)/copy-config: | $(M)/cord-config
Zack Williamsce63eb02017-02-28 10:46:22 -0700248 $(ANSIBLE_PB) $(PI)/copy-profile-playbook.yml $(LOGCMD)
249 touch $@
250
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700251$(M)/prep-buildnode: | $(M)/cord-config $(PREP_BUILDNODE_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700252 $(ANSIBLE_PB) $(PI)/prep-buildnode-playbook.yml $(LOGCMD)
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700253 @echo Waiting 20 seconds to timeout SSH ControlPersist, and so future ansible commands gain docker group membership
254 sleep 20
Zack Williamsce63eb02017-02-28 10:46:22 -0700255 touch $@
256
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700257$(M)/prep-headnode: | $(M)/cord-config $(PREP_HEADNODE_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700258 $(ANSIBLE_PB) $(PI)/prep-headnode-playbook.yml $(LOGCMD)
259 touch $@
260
Zack Williams0a7ef162017-07-18 18:15:26 -0700261$(M)/deploy-elasticstack: | $(M)/prep-headnode
Zack Williamsce63eb02017-02-28 10:46:22 -0700262 $(ANSIBLE_PB) $(PI)/deploy-elasticstack-playbook.yml $(LOGCMD)
263 touch $@
264
265$(M)/prep-computenode: | $(M)/prep-headnode
266 $(ANSIBLE_PB) $(PI)/prep-computenode-playbook.yml $(LOGCMD)
267 touch $@
268
Andy Bavier35d238e2017-07-24 16:47:22 -0700269
Zack Williamsa7104e32018-01-03 10:55:26 -0700270# kubespray targets
271$(M)/prep-kubespray: | $(M)/vagrant-ssh-install $(PREP_KUBESPRAY_PREREQS)
272 $(ANSIBLE_PB) $(BUILD)/ansible/prep-kubespray.yml $(LOGCMD)
273 touch $@
274
275$(M)/deploy-kubespray: | $(M)/prep-kubespray
276 cd $(KUBESPRAY); $(ANSIBLE_PB_KS) cluster.yml $(LOGCMD)
277 touch $@
278
279
Andy Bavier35d238e2017-07-24 16:47:22 -0700280# MaaS targets
281$(M)/build-maas-images: | $(M)/prep-buildnode $(BUILD_MAAS_IMAGES_PREREQS)
Andy Bavierafaa5302017-08-15 08:56:15 -0700282 $(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 -0700283 touch $@
284
Andy Bavier21e4fe42017-09-29 10:27:12 -0700285$(M)/maas-prime: | $(M)/prep-headnode
Andy Bavier35d238e2017-07-24 16:47:22 -0700286 $(ANSIBLE_PB) $(MAAS)/prime-node.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700287 touch $@
288
Andy Bavier35d238e2017-07-24 16:47:22 -0700289$(M)/publish-maas-images: | $(M)/maas-prime $(M)/build-maas-images
Andy Bavier09410472017-08-15 14:29:35 -0700290 $(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 -0700291 touch $@
292
Andy Bavier35d238e2017-07-24 16:47:22 -0700293$(M)/deploy-maas: | $(M)/publish-maas-images $(M)/cord-config $(M)/copy-config
294 $(ANSIBLE_PB) $(MAAS)/head-node.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700295 touch $@
296
Andy Bavier35d238e2017-07-24 16:47:22 -0700297
298# ONOS targets
Zack Williams5e039f02017-11-16 09:50:09 -0700299$(M)/deploy-mavenrepo: | $(M)/docker-images $(DEPLOY_MAVENREPO_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700300 $(ANSIBLE_PB) $(PI)/deploy-mavenrepo-playbook.yml $(LOGCMD)
301 touch $@
302
Zack Williams8845ee52017-10-04 23:13:26 -0700303$(M)/deploy-onos: | $(M)/docker-images $(M)/deploy-mavenrepo $(DEPLOY_ONOS_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700304 $(ANSIBLE_PB) $(PI)/deploy-onos-playbook.yml $(LOGCMD)
305 touch $@
306
Zack Williams58e41572017-09-29 07:57:14 -0700307$(M)/onos-debug: | $(M)/onboard-profile $(M)/deploy-onos
Zack Williams32295d52017-08-28 22:49:37 -0700308 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onos-debug-playbook.yml" $(LOGCMD)
309 touch $@
310
Andy Bavier35d238e2017-07-24 16:47:22 -0700311
312# XOS targets
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700313$(M)/docker-images: | $(M)/prep-buildnode $(DOCKER_IMAGES_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700314 $(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 -0700315 touch $@
316
Andy Bavier35d238e2017-07-24 16:47:22 -0700317$(M)/core-image: | $(M)/docker-images
Zack Williamsce63eb02017-02-28 10:46:22 -0700318 $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD)
319 touch $@
320
Andy Bavier35d238e2017-07-24 16:47:22 -0700321# Requires ib_actions.yml file which is on the build host
Andy Bavier61dc81a2017-08-23 15:29:45 -0700322$(M)/publish-docker-images: | $(M)/deploy-maas $(M)/docker-images $(M)/core-image
Andy Bavier35d238e2017-07-24 16:47:22 -0700323 $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build; $(ANSIBLE_PB_LOCAL) $(PI)/publish-images-playbook.yml" $(LOGCMD)
324 touch $@
325
Zack Williams49995e62017-10-06 12:46:08 -0700326$(M)/start-xos: | $(M)/prep-headnode $(M)/cord-config $(M)/core-image $(START_XOS_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700327 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/start-xos-playbook.yml" $(LOGCMD)
328 touch $@
329
Andy Bavier35d238e2017-07-24 16:47:22 -0700330$(M)/onboard-profile: | $(M)/start-xos
331 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-profile-playbook.yml" $(LOGCMD)
Zack Williams2f56eee2017-07-17 09:59:16 -0700332 touch $@
333
Andy Bavier35d238e2017-07-24 16:47:22 -0700334
335# OpenStack targets
336$(M)/glance-images: | $(M)/prep-headnode
337 $(ANSIBLE_PB) $(PI)/glance-images-playbook.yml $(LOGCMD)
338 touch $@
339
Zack Williamsba3e2462018-01-19 11:52:31 -0700340$(M)/deploy-openstack: | $(M)/prep-headnode $(DEPLOY_OPENSTACK_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700341 $(ANSIBLE_PB) $(PI)/deploy-openstack-playbook.yml $(LOGCMD)
342 touch $@
343
Zack Williamsba3e2462018-01-19 11:52:31 -0700344$(M)/deploy-computenode: | $(M)/prep-computenode $(M)/deploy-openstack
Andy Bavier35d238e2017-07-24 16:47:22 -0700345 $(ANSIBLE_PB) $(PI)/deploy-computenode-playbook.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700346 touch $@
347
Zack Williamsba3e2462018-01-19 11:52:31 -0700348$(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 -0700349 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-openstack-playbook.yml" $(LOGCMD)
350 touch $@
351
Andy Bavier35d238e2017-07-24 16:47:22 -0700352
353# Post-onboarding targets
354$(M)/setup-automation: | $(M)/onboard-profile $(M)/deploy-onos $(SETUP_AUTOMATION_PREREQS)
355 $(ANSIBLE_PB) $(PI)/cord-automation-playbook.yml $(LOGCMD)
356 touch $@
357
358
359# Additional CiaB targets
Andy Bavier35d238e2017-07-24 16:47:22 -0700360$(M)/setup-ciab-pcu: | $(M)/setup-automation
361 $(ANSIBLE_PB) $(MAAS)/setup-ciab-pcu.yml
362 touch $@
363
Andy Bavierb36b84e2017-08-10 14:46:32 -0700364$(M)/compute%-up: | $(M)/setup-ciab-pcu
Andy Bavier35d238e2017-07-24 16:47:22 -0700365 $(VAGRANT) up compute$* --provider $(VAGRANT_PROVIDER) $(LOGCMD)
366 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) ansible/maas-provision.yml --extra-vars='maas_user=maas vagrant_name=cord_compute$*'" $(LOGCMD)
367 touch $@
368
Andy Bavierb36b84e2017-08-10 14:46:32 -0700369$(M)/refresh-fabric: | $(M)/compute1-up
370 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) $(PI)/cord-refresh-fabric.yml" $(LOGCMD)
371 touch $@
372
Andy Bavier35d238e2017-07-24 16:47:22 -0700373
Zack Williamsce63eb02017-02-28 10:46:22 -0700374# Testing targets
Zack Williamsba3e2462018-01-19 11:52:31 -0700375pod-test: | $(TESTING_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700376 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/pod-test-playbook.yml" $(LOGCMD)
377
Zack Williamsba3e2462018-01-19 11:52:31 -0700378mcord-ng40-test: | $(TESTING_PREREQS)
Andy Bavier5e625442017-11-29 13:42:37 -0700379 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-ng40-test-playbook.yml" $(LOGCMD)
Andy Bavier2eb3cac2017-11-17 08:52:31 -0700380
Zack Williamsba3e2462018-01-19 11:52:31 -0700381mcord-cavium-test: | $(TESTING_PREREQS)
Andy Bavier8b1bd362018-01-03 16:41:38 -0700382 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-cavium-test-playbook.yml" $(LOGCMD)
383
Andy Bavierb36b84e2017-08-10 14:46:32 -0700384fabric-pingtest: $(M)/refresh-fabric
385 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) $(PI)/cord-fabric-pingtest.yml" $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700386
Zack Williams32295d52017-08-28 22:49:37 -0700387
Zack Williamsce63eb02017-02-28 10:46:22 -0700388# Local Targets, bring up XOS containers without a VM
Zack Williamsce63eb02017-02-28 10:46:22 -0700389$(M)/local-cord-config:
390 $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
391 touch $@
392
393$(M)/local-docker-images: | $(M)/local-cord-config
394 $(IMAGEBUILDER) -f $(MASTER_CONFIG) -l $(BUILD)/image_logs -g $(BUILD)/ib_graph.dot -a $(BUILD)/ib_actions.yml $(LOGCMD)
395 touch $@
396
397$(M)/local-core-image: | $(M)/local-docker-images
398 $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD)
399 touch $@
400
401$(M)/local-start-xos: | $(M)/local-core-image
402 $(ANSIBLE_PB) $(PI)/start-xos-playbook.yml $(LOGCMD)
403 touch $@
404
405$(M)/local-onboard-profile: | $(M)/local-start-xos
406 $(ANSIBLE_PB) $(PI)/onboard-profile-playbook.yml $(LOGCMD)
407 touch $@
408