blob: aa6c1d3677379d91174da24b88f6435a069ddb18 [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
6# Podconfig must be specified, so an invalid default
7PODCONFIG ?= invalid
8
9# Source path
10BUILD ?= .
11CORD ?= ..
12PI ?= $(BUILD)/platform-install
13MAAS ?= $(BUILD)/maas
Zack Williams2f56eee2017-07-17 09:59:16 -070014ONOS_APPS ?= $(CORD)/onos-apps
Zack Williamsce63eb02017-02-28 10:46:22 -070015
16# Configuration paths
17PODCONFIG_D ?= $(BUILD)/podconfig
18PODCONFIG_PATH ?= $(PODCONFIG_D)/$(PODCONFIG)
19
20SCENARIOS_D ?= $(BUILD)/scenarios
21GENCONFIG_D ?= $(BUILD)/genconfig
22
23# Milestones/logs paths
24M ?= $(BUILD)/milestones
25LOGS ?= $(BUILD)/logs
26
Zack Williams32295d52017-08-28 22:49:37 -070027PREP_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
Andy Bavier35d238e2017-07-24 16:47:22 -070028MAAS_MS ?= $(M)/build-maas-images $(M)/maas-prime $(M)/publish-maas-images $(M)/deploy-maas
29OPENSTACK_MS ?= $(M)/glance-images $(M)/deploy-openstack $(M)/deploy-computenode $(M)/onboard-openstack
30XOS_MS ?= $(M)/docker-images $(M)/core-image $(M)/publish-docker-images $(M)/start-xos $(M)/onboard-profile
31ONOS_MS ?= $(M)/build-onos-apps $(M)/publish-onos-apps $(M)/deploy-onos $(M)/deploy-mavenrepo
Andy Bavierb36b84e2017-08-10 14:46:32 -070032POST_INSTALL_MS ?= $(M)/setup-automation $(M)/setup-ciab-pcu $(M)/compute1-up $(M)/compute2-up $(M)/compute3-up
Andy Bavier35d238e2017-07-24 16:47:22 -070033ALL_MILESTONES ?= $(PREP_MS) $(MAAS_MS) $(OPENSTACK_MS) $(XOS_MS) $(ONOS_MS) $(POST_INSTALL_MS)
Zack Williamsce63eb02017-02-28 10:46:22 -070034
35LOCAL_MILESTONES ?= $(M)/local-cord-config $(M)/local-docker-images $(M)/local-core-image $(M)/local-start-xos $(M)/local-onboard-profile
36
37# Configuration files
38MASTER_CONFIG ?= $(GENCONFIG_D)/config.yml
39MAKEFILE_CONFIG ?= $(GENCONFIG_D)/config.mk
40INVENTORY ?= $(GENCONFIG_D)/inventory.ini
41PROFILE_NAME_F ?= $(GENCONFIG_D)/cord_profile
42SCENARIO_NAME_F ?= $(GENCONFIG_D)/cord_scenario
43
44CONFIG_FILES = $(MASTER_CONFIG) $(MAKEFILE_CONFIG) $(INVENTORY) $(PROFILE_NAME_F) $(SCENARIO_NAME_F)
45
46include $(MAKEFILE_CONFIG)
47
48# Set using files from genconfig
49SCENARIO = $(shell cat $(SCENARIO_NAME_F))
50PROFILE = $(shell cat $(PROFILE_NAME_F))
51
52# Host names for SSH commands
53BUILDNODE ?= head1
54HEADNODE ?= ${BUILDNODE}
55
56# Vagrant config
57VAGRANT_PROVIDER ?= libvirt
58VAGRANT_VMS ?= $(HEADNODE)
Andy Bavier35d238e2017-07-24 16:47:22 -070059VAGRANT_SWITCHES ?= leaf1
Zack Williamsce63eb02017-02-28 10:46:22 -070060VAGRANT_CWD ?= $(SCENARIOS_D)/$(SCENARIO)/
Zack Williamsce63eb02017-02-28 10:46:22 -070061
Luca Pretedcac43b2017-09-14 14:35:13 -070062# Virsh config
63VIRSH_CORDDEV_DOMAIN ?= cord_corddev
64
Zack Williamsce63eb02017-02-28 10:46:22 -070065# Ansible args, for verbosity and other runtime parameters
66ANSIBLE_ARGS ?=
Zack Williamsf87ef6e2017-10-16 22:30:00 -070067EXTRA_VARS ?= --extra-vars "@/opt/cord_profile/genconfig/config.yml"
Zack Williamsce63eb02017-02-28 10:46:22 -070068
69# Commands
70SHELL = bash -o pipefail
71VAGRANT ?= VAGRANT_CWD=$(VAGRANT_CWD) vagrant
72ANSIBLE ?= ansible -i $(INVENTORY)
73ANSIBLE_PB ?= ansible-playbook $(ANSIBLE_ARGS) -i $(INVENTORY) --extra-vars @$(MASTER_CONFIG)
Zack Williamsf87ef6e2017-10-16 22:30:00 -070074ANSIBLE_PB_LOCAL ?= ansible-playbook $(ANSIBLE_ARGS) -i $(PI)/inventory/head-localhost $(EXTRA_VARS)
75ANSIBLE_PB_MAAS ?= ansible-playbook $(ANSIBLE_ARGS) -i /etc/maas/ansible/pod-inventory $(EXTRA_VARS)
Zack Williamsce63eb02017-02-28 10:46:22 -070076IMAGEBUILDER ?= python $(BUILD)/scripts/imagebuilder.py
77LOGCMD ?= 2>&1 | tee -a $(LOGS)/$(TS)_$(@F)
78SSH_HEAD ?= ssh $(HEADNODE)
79SSH_BUILD ?= ssh $(BUILDNODE)
80
81# default target, prints help
82.DEFAULT: help
83
84help:
Zack Williams32295d52017-08-28 22:49:37 -070085 @echo "Please specify a target (config, build, ...)"
Zack Williamsce63eb02017-02-28 10:46:22 -070086
87# Config file generation
Zack Williamsd3a527c2017-09-13 12:24:57 -070088config: $(CONFIG_FILES)
Zack Williams32295d52017-08-28 22:49:37 -070089 @echo ""
90 @echo "CORD is configured with profile: '$(PROFILE)', scenario: '$(SCENARIO)'"
91 @echo "Run 'make -j4 build' to continue."
Zack Williamsce63eb02017-02-28 10:46:22 -070092
Zack Williamsce63eb02017-02-28 10:46:22 -070093$(CONFIG_FILES):
Zack Williamsd3a527c2017-09-13 12:24:57 -070094 test -e "$(PODCONFIG_PATH)" || { echo "PODCONFIG file $(PODCONFIG_PATH) doesn't exist!" ; exit 1; }
Zack Williams224bfe62017-11-20 23:02:11 -070095 ansible-playbook -i 'localhost,' --extra-vars="cord_podconfig='$(PODCONFIG_PATH)' genconfig_dir='$(GENCONFIG_D)' scenarios_dir='$(SCENARIOS_D)' platform_install_dir='$(PI)'" $(BUILD)/ansible/genconfig.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -070096
Zack Williamsd3a527c2017-09-13 12:24:57 -070097printconfig:
Zack Williams32295d52017-08-28 22:49:37 -070098 @echo "Scenario: '$(SCENARIO)'"
99 @echo "Profile: '$(PROFILE)'"
Zack Williamsce63eb02017-02-28 10:46:22 -0700100
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700101# == BUILD TARGET == #
102# This is entirely determined by the podconfig/scenario, and should generally
103# be set to only one value - everything else should be a dependency
Zack Williamsce63eb02017-02-28 10:46:22 -0700104build: $(BUILD_TARGETS)
105
Zack Williams32295d52017-08-28 22:49:37 -0700106# Utility targets
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700107ansible-ping:
108 $(ANSIBLE) -m ping all $(LOGCMD)
109
110ansible-setup:
111 $(ANSIBLE) -m setup all $(LOGCMD)
112
Zack Williamsce63eb02017-02-28 10:46:22 -0700113clean-images:
Zack Williams9d0b6272017-09-21 16:43:39 -0700114 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 -0700115
116clean-genconfig:
117 rm -f $(CONFIG_FILES)
118
119clean-profile:
Zack Williams93ae6382017-10-04 16:31:06 -0700120 rm -rf $(CONFIG_CORD_PROFILE_DIR)/*
Zack Williamsd3a527c2017-09-13 12:24:57 -0700121 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 -0700122
Luca Pretedcac43b2017-09-14 14:35:13 -0700123clean-all: virsh-domain-destroy vagrant-destroy clean-profile clean-genconfig
Zack Williamsce63eb02017-02-28 10:46:22 -0700124 rm -f $(ALL_MILESTONES)
125
Zack Williams144027f2017-09-25 18:01:47 -0700126clean-local: clean-profile clean-genconfig clean-images
Zack Williamsce63eb02017-02-28 10:46:22 -0700127 rm -f $(LOCAL_MILESTONES)
128
Zack Williams32295d52017-08-28 22:49:37 -0700129clean-onos:
Zack Williams9d0b6272017-09-21 16:43:39 -0700130 $(ANSIBLE_PB) $(PI)/teardown-onos-playbook.yml $(LOGCMD)
Zack Williams32295d52017-08-28 22:49:37 -0700131 rm -f $(M)/deploy-onos $(M)/onos-debug
132
133clean-openstack:
134 $(SSH_HEAD) "/opt/cord/build/platform-install/scripts/clean_openstack.sh" $(LOGCMD)
135 rm -f $(M)/onboard-openstack
136
137collect-diag:
138 $(ANSIBLE_PB) $(PI)/collect-diag-playbook.yml $(LOGCMD)
139
140compute-node-refresh:
141 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) --private-key ~/.ssh/cord_rsa $(PI)/compute-node-refresh-playbook.yml" $(LOGCMD)
142
Zack Williams2b26e562017-09-05 16:14:04 -0700143.PHONY: docs
144docs:
145 cd docs; make
146
Andy Bavier4dc66472017-07-18 17:13:24 -0700147local-ubuntu-dev-env:
148 $(ANSIBLE_PB) $(PI)/bootstrap-dev-env.yml $(LOGCMD)
149
Zack Williams2b26e562017-09-05 16:14:04 -0700150vagrant-destroy:
Zack Williams75a1df32017-11-14 14:48:45 -0700151 $(VAGRANT) destroy -f $(LOGCMD) || true
Zack Williams32295d52017-08-28 22:49:37 -0700152 rm -f $(M)/vagrant-up $(M)/vagrant-ssh-install $(VAGRANT_SSH_CONF)
Zack Williams2b26e562017-09-05 16:14:04 -0700153
Luca Pretedcac43b2017-09-14 14:35:13 -0700154virsh-domain-destroy:
155 virsh destroy ${VIRSH_CORDDEV_DOMAIN} || true
156 virsh undefine ${VIRSH_CORDDEV_DOMAIN} || true
157
Zack Williams2b26e562017-09-05 16:14:04 -0700158xos-teardown: xos-update-images
Zack Williams9d0b6272017-09-21 16:43:39 -0700159 $(ANSIBLE_PB) $(PI)/teardown-xos-playbook.yml $(LOGCMD)
Zack Williams2b26e562017-09-05 16:14:04 -0700160 rm -f $(M)/onboard-profile $(M)/local-onboard-profile
161
162xos-update-images: clean-images
163 rm -f $(M)/start-xos $(M)/local-start-xos
164
Andy Bavier35d238e2017-07-24 16:47:22 -0700165
Zack Williamsce63eb02017-02-28 10:46:22 -0700166# == PREREQS == #
Zack Williams8845ee52017-10-04 23:13:26 -0700167VAGRANT_UP_PREREQS ?=
168COPY_CORD_PREREQS ?=
169CORD_CONFIG_PREREQS ?=
Zack Williams39c9aa92017-10-17 08:35:00 -0700170CONFIG_SSH_KEY_PREREQS ?=
Zack Williams8845ee52017-10-04 23:13:26 -0700171PREP_BUILDNODE_PREREQS ?=
172PREP_HEADNODE_PREREQS ?=
173DOCKER_IMAGES_PREREQS ?=
174START_XOS_PREREQS ?=
175BUILD_ONOS_APPS_PREREQS ?=
176DEPLOY_ONOS_PREREQS ?=
Andy Bavierafaa5302017-08-15 08:56:15 -0700177DEPLOY_MAVENREPO_PREREQS ?=
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700178DEPLOY_OPENSTACK_PREREQS ?=
Andy Bavier35d238e2017-07-24 16:47:22 -0700179SETUP_AUTOMATION_PREREQS ?=
Zack Williamsce63eb02017-02-28 10:46:22 -0700180
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700181
Zack Williamsce63eb02017-02-28 10:46:22 -0700182# == MILESTONES == #
183# empty target files are touched in the milestones dir to indicate completion
184
Andy Bavier35d238e2017-07-24 16:47:22 -0700185# Prep targets
Zack Williamsce63eb02017-02-28 10:46:22 -0700186$(M)/prereqs-check:
187 $(ANSIBLE_PB) $(PI)/prereqs-check-playbook.yml $(LOGCMD)
188 touch $@
189
Andy Bavierafaa5302017-08-15 08:56:15 -0700190$(M)/build-local-bootstrap:
191 $(ANSIBLE_PB) $(BUILD)/ansible/build-local-bootstrap.yml $(LOGCMD)
192 touch $@
193
Andy Bavierb36b84e2017-08-10 14:46:32 -0700194$(M)/ciab-ovs:
195 $(ANSIBLE_PB) $(BUILD)/ansible/ciab-ovs.yml $(LOGCMD)
196 touch $@
197
Zack Williamsce63eb02017-02-28 10:46:22 -0700198$(M)/vagrant-up: | $(VAGRANT_UP_PREREQS)
199 $(VAGRANT) up $(VAGRANT_VMS) --provider $(VAGRANT_PROVIDER) $(LOGCMD)
Zack Williams32295d52017-08-28 22:49:37 -0700200 touch $@
201
202$(M)/vagrant-ssh-install: | $(M)/vagrant-up
Andy Baviere6c255f2017-09-15 16:13:37 -0700203 $(VAGRANT) ssh-config $(VAGRANT_VMS) > /tmp/vagrant_ssh_config
204 $(ANSIBLE_PB) $(BUILD)/ansible/vagrant-ssh-install.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700205 touch $@
206
Zack Williams39c9aa92017-10-17 08:35:00 -0700207$(M)/config-ssh-key: | $(CONFIG_SSH_KEY_PREREQS)
Zack Williams2b26e562017-09-05 16:14:04 -0700208 $(ANSIBLE_PB) $(BUILD)/ansible/config-ssh-key.yml $(LOGCMD)
209 touch $@
210
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700211$(M)/copy-cord: | $(COPY_CORD_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700212 $(ANSIBLE_PB) $(PI)/copy-cord-playbook.yml $(LOGCMD)
213 touch $@
214
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700215$(M)/cord-config: | $(CORD_CONFIG_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700216 $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
217 cp -r $(GENCONFIG_D) $(CONFIG_CORD_PROFILE_DIR)/genconfig
218 touch $@
219
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700220$(M)/copy-config: | $(M)/cord-config
Zack Williamsce63eb02017-02-28 10:46:22 -0700221 $(ANSIBLE_PB) $(PI)/copy-profile-playbook.yml $(LOGCMD)
222 touch $@
223
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700224$(M)/prep-buildnode: | $(M)/cord-config $(PREP_BUILDNODE_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700225 $(ANSIBLE_PB) $(PI)/prep-buildnode-playbook.yml $(LOGCMD)
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700226 @echo Waiting 20 seconds to timeout SSH ControlPersist, and so future ansible commands gain docker group membership
227 sleep 20
Zack Williamsce63eb02017-02-28 10:46:22 -0700228 touch $@
229
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700230$(M)/prep-headnode: | $(M)/cord-config $(PREP_HEADNODE_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700231 $(ANSIBLE_PB) $(PI)/prep-headnode-playbook.yml $(LOGCMD)
232 touch $@
233
Zack Williams0a7ef162017-07-18 18:15:26 -0700234$(M)/deploy-elasticstack: | $(M)/prep-headnode
Zack Williamsce63eb02017-02-28 10:46:22 -0700235 $(ANSIBLE_PB) $(PI)/deploy-elasticstack-playbook.yml $(LOGCMD)
236 touch $@
237
238$(M)/prep-computenode: | $(M)/prep-headnode
239 $(ANSIBLE_PB) $(PI)/prep-computenode-playbook.yml $(LOGCMD)
240 touch $@
241
Andy Bavier35d238e2017-07-24 16:47:22 -0700242
243# MaaS targets
244$(M)/build-maas-images: | $(M)/prep-buildnode $(BUILD_MAAS_IMAGES_PREREQS)
Andy Bavierafaa5302017-08-15 08:56:15 -0700245 $(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 -0700246 touch $@
247
Andy Bavier21e4fe42017-09-29 10:27:12 -0700248$(M)/maas-prime: | $(M)/prep-headnode
Andy Bavier35d238e2017-07-24 16:47:22 -0700249 $(ANSIBLE_PB) $(MAAS)/prime-node.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700250 touch $@
251
Andy Bavier35d238e2017-07-24 16:47:22 -0700252$(M)/publish-maas-images: | $(M)/maas-prime $(M)/build-maas-images
Andy Bavier09410472017-08-15 14:29:35 -0700253 $(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 -0700254 touch $@
255
Andy Bavier35d238e2017-07-24 16:47:22 -0700256$(M)/deploy-maas: | $(M)/publish-maas-images $(M)/cord-config $(M)/copy-config
257 $(ANSIBLE_PB) $(MAAS)/head-node.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700258 touch $@
259
Andy Bavier35d238e2017-07-24 16:47:22 -0700260
261# ONOS targets
Zack Williams5e039f02017-11-16 09:50:09 -0700262$(M)/deploy-mavenrepo: | $(M)/docker-images $(DEPLOY_MAVENREPO_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700263 $(ANSIBLE_PB) $(PI)/deploy-mavenrepo-playbook.yml $(LOGCMD)
264 touch $@
265
Zack Williams8845ee52017-10-04 23:13:26 -0700266$(M)/deploy-onos: | $(M)/docker-images $(M)/deploy-mavenrepo $(DEPLOY_ONOS_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700267 $(ANSIBLE_PB) $(PI)/deploy-onos-playbook.yml $(LOGCMD)
268 touch $@
269
Zack Williams58e41572017-09-29 07:57:14 -0700270$(M)/onos-debug: | $(M)/onboard-profile $(M)/deploy-onos
Zack Williams32295d52017-08-28 22:49:37 -0700271 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onos-debug-playbook.yml" $(LOGCMD)
272 touch $@
273
Andy Bavier35d238e2017-07-24 16:47:22 -0700274
275# XOS targets
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700276$(M)/docker-images: | $(M)/prep-buildnode $(DOCKER_IMAGES_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700277 $(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 -0700278 touch $@
279
Andy Bavier35d238e2017-07-24 16:47:22 -0700280$(M)/core-image: | $(M)/docker-images
Zack Williamsce63eb02017-02-28 10:46:22 -0700281 $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD)
282 touch $@
283
Andy Bavier35d238e2017-07-24 16:47:22 -0700284# Requires ib_actions.yml file which is on the build host
Andy Bavier61dc81a2017-08-23 15:29:45 -0700285$(M)/publish-docker-images: | $(M)/deploy-maas $(M)/docker-images $(M)/core-image
Andy Bavier35d238e2017-07-24 16:47:22 -0700286 $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build; $(ANSIBLE_PB_LOCAL) $(PI)/publish-images-playbook.yml" $(LOGCMD)
287 touch $@
288
Zack Williams49995e62017-10-06 12:46:08 -0700289$(M)/start-xos: | $(M)/prep-headnode $(M)/cord-config $(M)/core-image $(START_XOS_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700290 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/start-xos-playbook.yml" $(LOGCMD)
291 touch $@
292
Andy Bavier35d238e2017-07-24 16:47:22 -0700293$(M)/onboard-profile: | $(M)/start-xos
294 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-profile-playbook.yml" $(LOGCMD)
Zack Williams2f56eee2017-07-17 09:59:16 -0700295 touch $@
296
Andy Bavier35d238e2017-07-24 16:47:22 -0700297
298# OpenStack targets
299$(M)/glance-images: | $(M)/prep-headnode
300 $(ANSIBLE_PB) $(PI)/glance-images-playbook.yml $(LOGCMD)
301 touch $@
302
Andy Bavier21e4fe42017-09-29 10:27:12 -0700303$(M)/deploy-openstack: | $(M)/prep-headnode $(M)/prep-computenode $(DEPLOY_OPENSTACK_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700304 $(ANSIBLE_PB) $(PI)/deploy-openstack-playbook.yml $(LOGCMD)
305 touch $@
306
307$(M)/deploy-computenode: | $(M)/deploy-openstack
308 $(ANSIBLE_PB) $(PI)/deploy-computenode-playbook.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700309 touch $@
310
311$(M)/onboard-openstack: | $(M)/deploy-computenode $(M)/glance-images $(M)/deploy-onos $(M)/onboard-profile
312 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-openstack-playbook.yml" $(LOGCMD)
313 touch $@
314
Andy Bavier35d238e2017-07-24 16:47:22 -0700315
316# Post-onboarding targets
317$(M)/setup-automation: | $(M)/onboard-profile $(M)/deploy-onos $(SETUP_AUTOMATION_PREREQS)
318 $(ANSIBLE_PB) $(PI)/cord-automation-playbook.yml $(LOGCMD)
319 touch $@
320
321
322# Additional CiaB targets
Andy Bavier35d238e2017-07-24 16:47:22 -0700323$(M)/setup-ciab-pcu: | $(M)/setup-automation
324 $(ANSIBLE_PB) $(MAAS)/setup-ciab-pcu.yml
325 touch $@
326
Andy Bavierb36b84e2017-08-10 14:46:32 -0700327$(M)/compute%-up: | $(M)/setup-ciab-pcu
Andy Bavier35d238e2017-07-24 16:47:22 -0700328 $(VAGRANT) up compute$* --provider $(VAGRANT_PROVIDER) $(LOGCMD)
329 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) ansible/maas-provision.yml --extra-vars='maas_user=maas vagrant_name=cord_compute$*'" $(LOGCMD)
330 touch $@
331
Andy Bavierb36b84e2017-08-10 14:46:32 -0700332$(M)/refresh-fabric: | $(M)/compute1-up
333 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) $(PI)/cord-refresh-fabric.yml" $(LOGCMD)
334 touch $@
335
Andy Bavier35d238e2017-07-24 16:47:22 -0700336
Zack Williamsce63eb02017-02-28 10:46:22 -0700337# Testing targets
Andy Bavier35d238e2017-07-24 16:47:22 -0700338pod-test: $(M)/setup-automation collect-diag
339 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/pod-test-playbook.yml" $(LOGCMD)
340
Andy Bavier6fb9a3e2017-10-17 10:48:41 -0700341mcord-test: $(M)/setup-automation
342 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-test-playbook.yml" $(LOGCMD)
343
Andy Bavierf6b008d2017-10-24 06:06:01 -0700344mcord-spirent-test: $(M)/setup-automation
345 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-spirent-test-playbook.yml" $(LOGCMD)
346
Andy Bavier2eb3cac2017-11-17 08:52:31 -0700347mcord-ng4t-test: $(M)/setup-automation
348 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-ng4t-test-playbook.yml" $(LOGCMD)
349
Andy Bavierb36b84e2017-08-10 14:46:32 -0700350fabric-pingtest: $(M)/refresh-fabric
351 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) $(PI)/cord-fabric-pingtest.yml" $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700352
Zack Williams32295d52017-08-28 22:49:37 -0700353
Zack Williamsce63eb02017-02-28 10:46:22 -0700354# Local Targets, bring up XOS containers without a VM
Zack Williamsce63eb02017-02-28 10:46:22 -0700355$(M)/local-cord-config:
356 $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
357 touch $@
358
359$(M)/local-docker-images: | $(M)/local-cord-config
360 $(IMAGEBUILDER) -f $(MASTER_CONFIG) -l $(BUILD)/image_logs -g $(BUILD)/ib_graph.dot -a $(BUILD)/ib_actions.yml $(LOGCMD)
361 touch $@
362
363$(M)/local-core-image: | $(M)/local-docker-images
364 $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD)
365 touch $@
366
367$(M)/local-start-xos: | $(M)/local-core-image
368 $(ANSIBLE_PB) $(PI)/start-xos-playbook.yml $(LOGCMD)
369 touch $@
370
371$(M)/local-onboard-profile: | $(M)/local-start-xos
372 $(ANSIBLE_PB) $(PI)/onboard-profile-playbook.yml $(LOGCMD)
373 touch $@
374