blob: d03c110a477775656aeea609805d1653331d1ca4 [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 ?=
67
68# Commands
69SHELL = bash -o pipefail
70VAGRANT ?= VAGRANT_CWD=$(VAGRANT_CWD) vagrant
71ANSIBLE ?= ansible -i $(INVENTORY)
72ANSIBLE_PB ?= ansible-playbook $(ANSIBLE_ARGS) -i $(INVENTORY) --extra-vars @$(MASTER_CONFIG)
73ANSIBLE_PB_LOCAL ?= ansible-playbook $(ANSIBLE_ARGS) -i $(PI)/inventory/head-localhost --extra-vars "@/opt/cord_profile/genconfig/config.yml"
74ANSIBLE_PB_MAAS ?= ansible-playbook $(ANSIBLE_ARGS) -i /etc/maas/ansible/pod-inventory --extra-vars "@/opt/cord_profile/genconfig/config.yml"
75IMAGEBUILDER ?= python $(BUILD)/scripts/imagebuilder.py
76LOGCMD ?= 2>&1 | tee -a $(LOGS)/$(TS)_$(@F)
77SSH_HEAD ?= ssh $(HEADNODE)
78SSH_BUILD ?= ssh $(BUILDNODE)
79
80# default target, prints help
81.DEFAULT: help
82
83help:
Zack Williams32295d52017-08-28 22:49:37 -070084 @echo "Please specify a target (config, build, ...)"
Zack Williamsce63eb02017-02-28 10:46:22 -070085
86# Config file generation
Zack Williamsd3a527c2017-09-13 12:24:57 -070087config: $(CONFIG_FILES)
Zack Williams32295d52017-08-28 22:49:37 -070088 @echo ""
89 @echo "CORD is configured with profile: '$(PROFILE)', scenario: '$(SCENARIO)'"
90 @echo "Run 'make -j4 build' to continue."
Zack Williamsce63eb02017-02-28 10:46:22 -070091
Zack Williamsce63eb02017-02-28 10:46:22 -070092$(CONFIG_FILES):
Zack Williamsd3a527c2017-09-13 12:24:57 -070093 test -e "$(PODCONFIG_PATH)" || { echo "PODCONFIG file $(PODCONFIG_PATH) doesn't exist!" ; exit 1; }
Zack Williamsce63eb02017-02-28 10:46:22 -070094 ansible-playbook -i 'localhost,' --extra-vars="cord_podconfig='$(PODCONFIG_PATH)' genconfig_dir='$(GENCONFIG_D)' scenarios_dir='$(SCENARIOS_D)'" $(BUILD)/ansible/genconfig.yml $(LOGCMD)
95
Zack Williamsd3a527c2017-09-13 12:24:57 -070096printconfig:
Zack Williams32295d52017-08-28 22:49:37 -070097 @echo "Scenario: '$(SCENARIO)'"
98 @echo "Profile: '$(PROFILE)'"
Zack Williamsce63eb02017-02-28 10:46:22 -070099
100# Primary Targets
Zack Williamsce63eb02017-02-28 10:46:22 -0700101build: $(BUILD_TARGETS)
102
Zack Williamsce63eb02017-02-28 10:46:22 -0700103
Zack Williams32295d52017-08-28 22:49:37 -0700104# Utility targets
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700105ansible-ping:
106 $(ANSIBLE) -m ping all $(LOGCMD)
107
108ansible-setup:
109 $(ANSIBLE) -m setup all $(LOGCMD)
110
Zack Williamsce63eb02017-02-28 10:46:22 -0700111clean-images:
Zack Williams9d0b6272017-09-21 16:43:39 -0700112 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 -0700113
114clean-genconfig:
115 rm -f $(CONFIG_FILES)
116
117clean-profile:
Zack Williams93ae6382017-10-04 16:31:06 -0700118 rm -rf $(CONFIG_CORD_PROFILE_DIR)/*
Zack Williamsd3a527c2017-09-13 12:24:57 -0700119 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 -0700120
Luca Pretedcac43b2017-09-14 14:35:13 -0700121clean-all: virsh-domain-destroy vagrant-destroy clean-profile clean-genconfig
Zack Williamsce63eb02017-02-28 10:46:22 -0700122 rm -f $(ALL_MILESTONES)
123
Zack Williams144027f2017-09-25 18:01:47 -0700124clean-local: clean-profile clean-genconfig clean-images
Zack Williamsce63eb02017-02-28 10:46:22 -0700125 rm -f $(LOCAL_MILESTONES)
126
Zack Williams32295d52017-08-28 22:49:37 -0700127clean-onos:
Zack Williams9d0b6272017-09-21 16:43:39 -0700128 $(ANSIBLE_PB) $(PI)/teardown-onos-playbook.yml $(LOGCMD)
Zack Williams32295d52017-08-28 22:49:37 -0700129 rm -f $(M)/deploy-onos $(M)/onos-debug
130
131clean-openstack:
132 $(SSH_HEAD) "/opt/cord/build/platform-install/scripts/clean_openstack.sh" $(LOGCMD)
133 rm -f $(M)/onboard-openstack
134
135collect-diag:
136 $(ANSIBLE_PB) $(PI)/collect-diag-playbook.yml $(LOGCMD)
137
138compute-node-refresh:
139 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) --private-key ~/.ssh/cord_rsa $(PI)/compute-node-refresh-playbook.yml" $(LOGCMD)
140
Zack Williams2b26e562017-09-05 16:14:04 -0700141.PHONY: docs
142docs:
143 cd docs; make
144
Andy Bavier4dc66472017-07-18 17:13:24 -0700145local-ubuntu-dev-env:
146 $(ANSIBLE_PB) $(PI)/bootstrap-dev-env.yml $(LOGCMD)
147
Zack Williams2b26e562017-09-05 16:14:04 -0700148vagrant-destroy:
gopinath1fc1bc72017-09-06 11:53:01 -0700149 $(VAGRANT) destroy -f $(LOGCMD)
Zack Williams32295d52017-08-28 22:49:37 -0700150 rm -f $(M)/vagrant-up $(M)/vagrant-ssh-install $(VAGRANT_SSH_CONF)
Zack Williams2b26e562017-09-05 16:14:04 -0700151
Luca Pretedcac43b2017-09-14 14:35:13 -0700152virsh-domain-destroy:
153 virsh destroy ${VIRSH_CORDDEV_DOMAIN} || true
154 virsh undefine ${VIRSH_CORDDEV_DOMAIN} || true
155
Zack Williams2b26e562017-09-05 16:14:04 -0700156xos-teardown: xos-update-images
Zack Williams9d0b6272017-09-21 16:43:39 -0700157 $(ANSIBLE_PB) $(PI)/teardown-xos-playbook.yml $(LOGCMD)
Zack Williams2b26e562017-09-05 16:14:04 -0700158 rm -f $(M)/onboard-profile $(M)/local-onboard-profile
159
160xos-update-images: clean-images
161 rm -f $(M)/start-xos $(M)/local-start-xos
162
Andy Bavier35d238e2017-07-24 16:47:22 -0700163
Zack Williamsce63eb02017-02-28 10:46:22 -0700164# == PREREQS == #
Zack Williams8845ee52017-10-04 23:13:26 -0700165VAGRANT_UP_PREREQS ?=
166COPY_CORD_PREREQS ?=
167CORD_CONFIG_PREREQS ?=
168COPY_CONFIG_PREREQS ?=
169PREP_BUILDNODE_PREREQS ?=
170PREP_HEADNODE_PREREQS ?=
171DOCKER_IMAGES_PREREQS ?=
172START_XOS_PREREQS ?=
173BUILD_ONOS_APPS_PREREQS ?=
174DEPLOY_ONOS_PREREQS ?=
Andy Bavier35d238e2017-07-24 16:47:22 -0700175DEPLOY_OPENSTACK_PREREQS ?=
Andy Bavierafaa5302017-08-15 08:56:15 -0700176DEPLOY_MAVENREPO_PREREQS ?=
Andy Bavier35d238e2017-07-24 16:47:22 -0700177SETUP_AUTOMATION_PREREQS ?=
Zack Williamsce63eb02017-02-28 10:46:22 -0700178
179# == MILESTONES == #
180# empty target files are touched in the milestones dir to indicate completion
181
Andy Bavier35d238e2017-07-24 16:47:22 -0700182# Prep targets
Zack Williamsce63eb02017-02-28 10:46:22 -0700183$(M)/prereqs-check:
184 $(ANSIBLE_PB) $(PI)/prereqs-check-playbook.yml $(LOGCMD)
185 touch $@
186
Andy Bavierafaa5302017-08-15 08:56:15 -0700187$(M)/build-local-bootstrap:
188 $(ANSIBLE_PB) $(BUILD)/ansible/build-local-bootstrap.yml $(LOGCMD)
189 touch $@
190
Andy Bavierb36b84e2017-08-10 14:46:32 -0700191$(M)/ciab-ovs:
192 $(ANSIBLE_PB) $(BUILD)/ansible/ciab-ovs.yml $(LOGCMD)
193 touch $@
194
Zack Williamsce63eb02017-02-28 10:46:22 -0700195$(M)/vagrant-up: | $(VAGRANT_UP_PREREQS)
196 $(VAGRANT) up $(VAGRANT_VMS) --provider $(VAGRANT_PROVIDER) $(LOGCMD)
Zack Williams32295d52017-08-28 22:49:37 -0700197 touch $@
198
199$(M)/vagrant-ssh-install: | $(M)/vagrant-up
Andy Baviere6c255f2017-09-15 16:13:37 -0700200 $(VAGRANT) ssh-config $(VAGRANT_VMS) > /tmp/vagrant_ssh_config
201 $(ANSIBLE_PB) $(BUILD)/ansible/vagrant-ssh-install.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700202 touch $@
203
Zack Williams2b26e562017-09-05 16:14:04 -0700204$(M)/config-ssh-key: | $(M)/vagrant-up
205 $(ANSIBLE_PB) $(BUILD)/ansible/config-ssh-key.yml $(LOGCMD)
206 touch $@
207
Zack Williams32295d52017-08-28 22:49:37 -0700208$(M)/copy-cord: | $(M)/vagrant-ssh-install $(COPY_CORD_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700209 $(ANSIBLE_PB) $(PI)/copy-cord-playbook.yml $(LOGCMD)
210 touch $@
211
Zack Williams32295d52017-08-28 22:49:37 -0700212$(M)/cord-config: | $(M)/vagrant-ssh-install $(CORD_CONFIG_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700213 $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
214 cp -r $(GENCONFIG_D) $(CONFIG_CORD_PROFILE_DIR)/genconfig
215 touch $@
216
217$(M)/copy-config: | $(COPY_CONFIG_PREREQS)
218 $(ANSIBLE_PB) $(PI)/copy-profile-playbook.yml $(LOGCMD)
219 touch $@
220
Zack Williams32295d52017-08-28 22:49:37 -0700221$(M)/prep-buildnode: | $(M)/vagrant-ssh-install $(M)/cord-config $(PREP_BUILDNODE_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700222 $(ANSIBLE_PB) $(PI)/prep-buildnode-playbook.yml $(LOGCMD)
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700223 @echo Waiting 20 seconds to timeout SSH ControlPersist, and so future ansible commands gain docker group membership
224 sleep 20
Zack Williamsce63eb02017-02-28 10:46:22 -0700225 touch $@
226
Zack Williams32295d52017-08-28 22:49:37 -0700227$(M)/prep-headnode: | $(M)/vagrant-ssh-install $(M)/cord-config $(PREP_HEADNODE_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700228 $(ANSIBLE_PB) $(PI)/prep-headnode-playbook.yml $(LOGCMD)
229 touch $@
230
Zack Williams0a7ef162017-07-18 18:15:26 -0700231$(M)/deploy-elasticstack: | $(M)/prep-headnode
Zack Williamsce63eb02017-02-28 10:46:22 -0700232 $(ANSIBLE_PB) $(PI)/deploy-elasticstack-playbook.yml $(LOGCMD)
233 touch $@
234
235$(M)/prep-computenode: | $(M)/prep-headnode
236 $(ANSIBLE_PB) $(PI)/prep-computenode-playbook.yml $(LOGCMD)
237 touch $@
238
Andy Bavier35d238e2017-07-24 16:47:22 -0700239
240# MaaS targets
241$(M)/build-maas-images: | $(M)/prep-buildnode $(BUILD_MAAS_IMAGES_PREREQS)
Andy Bavierafaa5302017-08-15 08:56:15 -0700242 $(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 -0700243 touch $@
244
Andy Bavier21e4fe42017-09-29 10:27:12 -0700245$(M)/maas-prime: | $(M)/prep-headnode
Andy Bavier35d238e2017-07-24 16:47:22 -0700246 $(ANSIBLE_PB) $(MAAS)/prime-node.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700247 touch $@
248
Andy Bavier35d238e2017-07-24 16:47:22 -0700249$(M)/publish-maas-images: | $(M)/maas-prime $(M)/build-maas-images
Andy Bavier09410472017-08-15 14:29:35 -0700250 $(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 -0700251 touch $@
252
Andy Bavier35d238e2017-07-24 16:47:22 -0700253$(M)/deploy-maas: | $(M)/publish-maas-images $(M)/cord-config $(M)/copy-config
254 $(ANSIBLE_PB) $(MAAS)/head-node.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700255 touch $@
256
Andy Bavier35d238e2017-07-24 16:47:22 -0700257
258# ONOS targets
259$(M)/build-onos-apps: | $(M)/prep-buildnode $(BUILD_ONOS_APPS_PREREQS)
Andy Bavierafaa5302017-08-15 08:56:15 -0700260 $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/onos-apps; make MAKE_CONFIG=../build/$(MAKEFILE_CONFIG) build" $(LOGCMD)
Andy Bavier35d238e2017-07-24 16:47:22 -0700261 touch $@
262
Zack Williams8845ee52017-10-04 23:13:26 -0700263$(M)/publish-onos-apps: | $(M)/build-onos-apps
Andy Bavierafaa5302017-08-15 08:56:15 -0700264 $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/onos-apps; make MAKE_CONFIG=../build/$(MAKEFILE_CONFIG) publish" $(LOGCMD)
Andy Bavier35d238e2017-07-24 16:47:22 -0700265 touch $@
266
Zack Williams8845ee52017-10-04 23:13:26 -0700267$(M)/deploy-mavenrepo: | $(M)/build-onos-apps $(DEPLOY_MAVENREPO_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700268 $(ANSIBLE_PB) $(PI)/deploy-mavenrepo-playbook.yml $(LOGCMD)
269 touch $@
270
Zack Williams8845ee52017-10-04 23:13:26 -0700271$(M)/deploy-onos: | $(M)/docker-images $(M)/deploy-mavenrepo $(DEPLOY_ONOS_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700272 $(ANSIBLE_PB) $(PI)/deploy-onos-playbook.yml $(LOGCMD)
273 touch $@
274
Zack Williams58e41572017-09-29 07:57:14 -0700275$(M)/onos-debug: | $(M)/onboard-profile $(M)/deploy-onos
Zack Williams32295d52017-08-28 22:49:37 -0700276 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onos-debug-playbook.yml" $(LOGCMD)
277 touch $@
278
Andy Bavier35d238e2017-07-24 16:47:22 -0700279
280# XOS targets
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700281$(M)/docker-images: | $(M)/prep-buildnode $(DOCKER_IMAGES_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700282 $(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 -0700283 touch $@
284
Andy Bavier35d238e2017-07-24 16:47:22 -0700285$(M)/core-image: | $(M)/docker-images
Zack Williamsce63eb02017-02-28 10:46:22 -0700286 $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD)
287 touch $@
288
Andy Bavier35d238e2017-07-24 16:47:22 -0700289# Requires ib_actions.yml file which is on the build host
Andy Bavier61dc81a2017-08-23 15:29:45 -0700290$(M)/publish-docker-images: | $(M)/deploy-maas $(M)/docker-images $(M)/core-image
Andy Bavier35d238e2017-07-24 16:47:22 -0700291 $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build; $(ANSIBLE_PB_LOCAL) $(PI)/publish-images-playbook.yml" $(LOGCMD)
292 touch $@
293
Zack Williams0a7ef162017-07-18 18:15:26 -0700294$(M)/start-xos: | $(M)/prep-headnode $(M)/core-image $(START_XOS_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700295 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/start-xos-playbook.yml" $(LOGCMD)
296 touch $@
297
Andy Bavier35d238e2017-07-24 16:47:22 -0700298$(M)/onboard-profile: | $(M)/start-xos
299 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-profile-playbook.yml" $(LOGCMD)
Zack Williams2f56eee2017-07-17 09:59:16 -0700300 touch $@
301
Andy Bavier35d238e2017-07-24 16:47:22 -0700302
303# OpenStack targets
304$(M)/glance-images: | $(M)/prep-headnode
305 $(ANSIBLE_PB) $(PI)/glance-images-playbook.yml $(LOGCMD)
306 touch $@
307
Andy Bavier21e4fe42017-09-29 10:27:12 -0700308$(M)/deploy-openstack: | $(M)/prep-headnode $(M)/prep-computenode $(DEPLOY_OPENSTACK_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700309 $(ANSIBLE_PB) $(PI)/deploy-openstack-playbook.yml $(LOGCMD)
310 touch $@
311
312$(M)/deploy-computenode: | $(M)/deploy-openstack
313 $(ANSIBLE_PB) $(PI)/deploy-computenode-playbook.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700314 touch $@
315
316$(M)/onboard-openstack: | $(M)/deploy-computenode $(M)/glance-images $(M)/deploy-onos $(M)/onboard-profile
317 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-openstack-playbook.yml" $(LOGCMD)
318 touch $@
319
Andy Bavier35d238e2017-07-24 16:47:22 -0700320
321# Post-onboarding targets
322$(M)/setup-automation: | $(M)/onboard-profile $(M)/deploy-onos $(SETUP_AUTOMATION_PREREQS)
323 $(ANSIBLE_PB) $(PI)/cord-automation-playbook.yml $(LOGCMD)
324 touch $@
325
326
327# Additional CiaB targets
Andy Bavier35d238e2017-07-24 16:47:22 -0700328$(M)/setup-ciab-pcu: | $(M)/setup-automation
329 $(ANSIBLE_PB) $(MAAS)/setup-ciab-pcu.yml
330 touch $@
331
Andy Bavierb36b84e2017-08-10 14:46:32 -0700332$(M)/compute%-up: | $(M)/setup-ciab-pcu
Andy Bavier35d238e2017-07-24 16:47:22 -0700333 $(VAGRANT) up compute$* --provider $(VAGRANT_PROVIDER) $(LOGCMD)
334 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) ansible/maas-provision.yml --extra-vars='maas_user=maas vagrant_name=cord_compute$*'" $(LOGCMD)
335 touch $@
336
Andy Bavierb36b84e2017-08-10 14:46:32 -0700337$(M)/refresh-fabric: | $(M)/compute1-up
338 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) $(PI)/cord-refresh-fabric.yml" $(LOGCMD)
339 touch $@
340
Andy Bavier35d238e2017-07-24 16:47:22 -0700341
Zack Williamsce63eb02017-02-28 10:46:22 -0700342# Testing targets
Andy Bavier35d238e2017-07-24 16:47:22 -0700343pod-test: $(M)/setup-automation collect-diag
344 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/pod-test-playbook.yml" $(LOGCMD)
345
Andy Bavierb36b84e2017-08-10 14:46:32 -0700346fabric-pingtest: $(M)/refresh-fabric
347 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) $(PI)/cord-fabric-pingtest.yml" $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700348
Zack Williams32295d52017-08-28 22:49:37 -0700349
Zack Williamsce63eb02017-02-28 10:46:22 -0700350# Local Targets, bring up XOS containers without a VM
Zack Williamsce63eb02017-02-28 10:46:22 -0700351$(M)/local-cord-config:
352 $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
353 touch $@
354
355$(M)/local-docker-images: | $(M)/local-cord-config
356 $(IMAGEBUILDER) -f $(MASTER_CONFIG) -l $(BUILD)/image_logs -g $(BUILD)/ib_graph.dot -a $(BUILD)/ib_actions.yml $(LOGCMD)
357 touch $@
358
359$(M)/local-core-image: | $(M)/local-docker-images
360 $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD)
361 touch $@
362
363$(M)/local-start-xos: | $(M)/local-core-image
364 $(ANSIBLE_PB) $(PI)/start-xos-playbook.yml $(LOGCMD)
365 touch $@
366
367$(M)/local-onboard-profile: | $(M)/local-start-xos
368 $(ANSIBLE_PB) $(PI)/onboard-profile-playbook.yml $(LOGCMD)
369 touch $@
370