blob: 8bab022ab0c3d739b9336a1efb12a0dfdb40a123 [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
Zack Williamse53c9ca2017-11-29 16:22:13 -070023CONFIG_CORD_PROFILE_DIR ?= $(CORD)/../cord_profile
24
Zack Williamsce63eb02017-02-28 10:46:22 -070025# Milestones/logs paths
26M ?= $(BUILD)/milestones
27LOGS ?= $(BUILD)/logs
28
Zack Williams32295d52017-08-28 22:49:37 -070029PREP_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 -070030MAAS_MS ?= $(M)/build-maas-images $(M)/maas-prime $(M)/publish-maas-images $(M)/deploy-maas
31OPENSTACK_MS ?= $(M)/glance-images $(M)/deploy-openstack $(M)/deploy-computenode $(M)/onboard-openstack
32XOS_MS ?= $(M)/docker-images $(M)/core-image $(M)/publish-docker-images $(M)/start-xos $(M)/onboard-profile
33ONOS_MS ?= $(M)/build-onos-apps $(M)/publish-onos-apps $(M)/deploy-onos $(M)/deploy-mavenrepo
Andy Bavierb36b84e2017-08-10 14:46:32 -070034POST_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 -070035LOCAL_MILESTONES ?= $(M)/local-cord-config $(M)/local-docker-images $(M)/local-core-image $(M)/local-start-xos $(M)/local-onboard-profile
Zack Williamse53c9ca2017-11-29 16:22:13 -070036ALL_MILESTONES ?= $(PREP_MS) $(MAAS_MS) $(OPENSTACK_MS) $(XOS_MS) $(ONOS_MS) $(POST_INSTALL_MS) $(LOCAL_MILESTONES)
Zack Williamsce63eb02017-02-28 10:46:22 -070037
38# Configuration files
39MASTER_CONFIG ?= $(GENCONFIG_D)/config.yml
40MAKEFILE_CONFIG ?= $(GENCONFIG_D)/config.mk
41INVENTORY ?= $(GENCONFIG_D)/inventory.ini
42PROFILE_NAME_F ?= $(GENCONFIG_D)/cord_profile
43SCENARIO_NAME_F ?= $(GENCONFIG_D)/cord_scenario
44
45CONFIG_FILES = $(MASTER_CONFIG) $(MAKEFILE_CONFIG) $(INVENTORY) $(PROFILE_NAME_F) $(SCENARIO_NAME_F)
46
47include $(MAKEFILE_CONFIG)
48
49# Set using files from genconfig
50SCENARIO = $(shell cat $(SCENARIO_NAME_F))
51PROFILE = $(shell cat $(PROFILE_NAME_F))
52
53# Host names for SSH commands
54BUILDNODE ?= head1
55HEADNODE ?= ${BUILDNODE}
56
57# Vagrant config
58VAGRANT_PROVIDER ?= libvirt
59VAGRANT_VMS ?= $(HEADNODE)
Andy Bavier35d238e2017-07-24 16:47:22 -070060VAGRANT_SWITCHES ?= leaf1
Zack Williamsce63eb02017-02-28 10:46:22 -070061VAGRANT_CWD ?= $(SCENARIOS_D)/$(SCENARIO)/
Zack Williamsce63eb02017-02-28 10:46:22 -070062
Luca Pretedcac43b2017-09-14 14:35:13 -070063# Virsh config
64VIRSH_CORDDEV_DOMAIN ?= cord_corddev
65
Zack Williamsce63eb02017-02-28 10:46:22 -070066# Ansible args, for verbosity and other runtime parameters
67ANSIBLE_ARGS ?=
Zack Williamsf87ef6e2017-10-16 22:30:00 -070068EXTRA_VARS ?= --extra-vars "@/opt/cord_profile/genconfig/config.yml"
Zack Williamsce63eb02017-02-28 10:46:22 -070069
70# Commands
71SHELL = bash -o pipefail
72VAGRANT ?= VAGRANT_CWD=$(VAGRANT_CWD) vagrant
73ANSIBLE ?= ansible -i $(INVENTORY)
74ANSIBLE_PB ?= ansible-playbook $(ANSIBLE_ARGS) -i $(INVENTORY) --extra-vars @$(MASTER_CONFIG)
Zack Williamsf87ef6e2017-10-16 22:30:00 -070075ANSIBLE_PB_LOCAL ?= ansible-playbook $(ANSIBLE_ARGS) -i $(PI)/inventory/head-localhost $(EXTRA_VARS)
76ANSIBLE_PB_MAAS ?= ansible-playbook $(ANSIBLE_ARGS) -i /etc/maas/ansible/pod-inventory $(EXTRA_VARS)
Zack Williamsce63eb02017-02-28 10:46:22 -070077IMAGEBUILDER ?= python $(BUILD)/scripts/imagebuilder.py
78LOGCMD ?= 2>&1 | tee -a $(LOGS)/$(TS)_$(@F)
79SSH_HEAD ?= ssh $(HEADNODE)
80SSH_BUILD ?= ssh $(BUILDNODE)
81
82# default target, prints help
83.DEFAULT: help
84
85help:
Zack Williams32295d52017-08-28 22:49:37 -070086 @echo "Please specify a target (config, build, ...)"
Zack Williamsce63eb02017-02-28 10:46:22 -070087
88# Config file generation
Zack Williamsd3a527c2017-09-13 12:24:57 -070089config: $(CONFIG_FILES)
Zack Williams32295d52017-08-28 22:49:37 -070090 @echo ""
91 @echo "CORD is configured with profile: '$(PROFILE)', scenario: '$(SCENARIO)'"
92 @echo "Run 'make -j4 build' to continue."
Zack Williamsce63eb02017-02-28 10:46:22 -070093
Zack Williamsce63eb02017-02-28 10:46:22 -070094$(CONFIG_FILES):
Zack Williamsd3a527c2017-09-13 12:24:57 -070095 test -e "$(PODCONFIG_PATH)" || { echo "PODCONFIG file $(PODCONFIG_PATH) doesn't exist!" ; exit 1; }
Zack Williams224bfe62017-11-20 23:02:11 -070096 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 -070097
Zack Williamsd3a527c2017-09-13 12:24:57 -070098printconfig:
Zack Williams32295d52017-08-28 22:49:37 -070099 @echo "Scenario: '$(SCENARIO)'"
100 @echo "Profile: '$(PROFILE)'"
Zack Williamsce63eb02017-02-28 10:46:22 -0700101
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700102# == BUILD TARGET == #
103# This is entirely determined by the podconfig/scenario, and should generally
104# be set to only one value - everything else should be a dependency
Zack Williamsce63eb02017-02-28 10:46:22 -0700105build: $(BUILD_TARGETS)
106
Zack Williams32295d52017-08-28 22:49:37 -0700107# Utility targets
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700108ansible-ping:
109 $(ANSIBLE) -m ping all $(LOGCMD)
110
111ansible-setup:
112 $(ANSIBLE) -m setup all $(LOGCMD)
113
Zack Williamsce63eb02017-02-28 10:46:22 -0700114clean-images:
Zack Williams9d0b6272017-09-21 16:43:39 -0700115 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 -0700116
117clean-genconfig:
118 rm -f $(CONFIG_FILES)
119
120clean-profile:
Zack Williams93ae6382017-10-04 16:31:06 -0700121 rm -rf $(CONFIG_CORD_PROFILE_DIR)/*
Zack Williamsd3a527c2017-09-13 12:24:57 -0700122 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 -0700123
Luca Pretedcac43b2017-09-14 14:35:13 -0700124clean-all: virsh-domain-destroy vagrant-destroy clean-profile clean-genconfig
Zack Williamsce63eb02017-02-28 10:46:22 -0700125 rm -f $(ALL_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 -0700141vagrant-destroy:
Zack Williams75a1df32017-11-14 14:48:45 -0700142 $(VAGRANT) destroy -f $(LOGCMD) || true
Zack Williams32295d52017-08-28 22:49:37 -0700143 rm -f $(M)/vagrant-up $(M)/vagrant-ssh-install $(VAGRANT_SSH_CONF)
Zack Williams2b26e562017-09-05 16:14:04 -0700144
Luca Pretedcac43b2017-09-14 14:35:13 -0700145virsh-domain-destroy:
146 virsh destroy ${VIRSH_CORDDEV_DOMAIN} || true
147 virsh undefine ${VIRSH_CORDDEV_DOMAIN} || true
148
Zack Williams2b26e562017-09-05 16:14:04 -0700149xos-teardown: xos-update-images
Zack Williams9d0b6272017-09-21 16:43:39 -0700150 $(ANSIBLE_PB) $(PI)/teardown-xos-playbook.yml $(LOGCMD)
Zack Williamse53c9ca2017-11-29 16:22:13 -0700151 rm -f $(M)/onboard-profile
Zack Williams2b26e562017-09-05 16:14:04 -0700152
153xos-update-images: clean-images
154 rm -f $(M)/start-xos $(M)/local-start-xos
155
Zack Williamse53c9ca2017-11-29 16:22:13 -0700156# local scenario helpers
157clean-local: local-xos-teardown clean-profile clean-genconfig clean-images
158 rm -f $(LOCAL_MILESTONES)
159
160local-ubuntu-dev-env:
161 $(ANSIBLE_PB) $(PI)/bootstrap-dev-env.yml $(LOGCMD)
162
163local-xos-teardown:
164 cd $(CONFIG_CORD_PROFILE_DIR); docker-compose -p $(PROFILE) rm -s -f || true
165 rm -f $(M)/local-onboard-profile
166
167# docs
168.PHONY: docs
169docs:
170 cd docs; make
Andy Bavier35d238e2017-07-24 16:47:22 -0700171
Zack Williamsce63eb02017-02-28 10:46:22 -0700172# == PREREQS == #
Zack Williams8845ee52017-10-04 23:13:26 -0700173VAGRANT_UP_PREREQS ?=
174COPY_CORD_PREREQS ?=
175CORD_CONFIG_PREREQS ?=
Zack Williams39c9aa92017-10-17 08:35:00 -0700176CONFIG_SSH_KEY_PREREQS ?=
Zack Williams8845ee52017-10-04 23:13:26 -0700177PREP_BUILDNODE_PREREQS ?=
178PREP_HEADNODE_PREREQS ?=
179DOCKER_IMAGES_PREREQS ?=
180START_XOS_PREREQS ?=
181BUILD_ONOS_APPS_PREREQS ?=
182DEPLOY_ONOS_PREREQS ?=
Andy Bavierafaa5302017-08-15 08:56:15 -0700183DEPLOY_MAVENREPO_PREREQS ?=
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700184DEPLOY_OPENSTACK_PREREQS ?=
Andy Bavier35d238e2017-07-24 16:47:22 -0700185SETUP_AUTOMATION_PREREQS ?=
Zack Williamsce63eb02017-02-28 10:46:22 -0700186
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700187
Zack Williamsce63eb02017-02-28 10:46:22 -0700188# == MILESTONES == #
189# empty target files are touched in the milestones dir to indicate completion
190
Andy Bavier35d238e2017-07-24 16:47:22 -0700191# Prep targets
Zack Williamsce63eb02017-02-28 10:46:22 -0700192$(M)/prereqs-check:
193 $(ANSIBLE_PB) $(PI)/prereqs-check-playbook.yml $(LOGCMD)
194 touch $@
195
Andy Bavierafaa5302017-08-15 08:56:15 -0700196$(M)/build-local-bootstrap:
197 $(ANSIBLE_PB) $(BUILD)/ansible/build-local-bootstrap.yml $(LOGCMD)
198 touch $@
199
Andy Bavierb36b84e2017-08-10 14:46:32 -0700200$(M)/ciab-ovs:
201 $(ANSIBLE_PB) $(BUILD)/ansible/ciab-ovs.yml $(LOGCMD)
202 touch $@
203
Zack Williamsce63eb02017-02-28 10:46:22 -0700204$(M)/vagrant-up: | $(VAGRANT_UP_PREREQS)
205 $(VAGRANT) up $(VAGRANT_VMS) --provider $(VAGRANT_PROVIDER) $(LOGCMD)
Zack Williams32295d52017-08-28 22:49:37 -0700206 touch $@
207
208$(M)/vagrant-ssh-install: | $(M)/vagrant-up
Andy Baviere6c255f2017-09-15 16:13:37 -0700209 $(VAGRANT) ssh-config $(VAGRANT_VMS) > /tmp/vagrant_ssh_config
210 $(ANSIBLE_PB) $(BUILD)/ansible/vagrant-ssh-install.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700211 touch $@
212
Zack Williams39c9aa92017-10-17 08:35:00 -0700213$(M)/config-ssh-key: | $(CONFIG_SSH_KEY_PREREQS)
Zack Williams2b26e562017-09-05 16:14:04 -0700214 $(ANSIBLE_PB) $(BUILD)/ansible/config-ssh-key.yml $(LOGCMD)
215 touch $@
216
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700217$(M)/copy-cord: | $(COPY_CORD_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700218 $(ANSIBLE_PB) $(PI)/copy-cord-playbook.yml $(LOGCMD)
219 touch $@
220
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700221$(M)/cord-config: | $(CORD_CONFIG_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700222 $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
223 cp -r $(GENCONFIG_D) $(CONFIG_CORD_PROFILE_DIR)/genconfig
224 touch $@
225
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700226$(M)/copy-config: | $(M)/cord-config
Zack Williamsce63eb02017-02-28 10:46:22 -0700227 $(ANSIBLE_PB) $(PI)/copy-profile-playbook.yml $(LOGCMD)
228 touch $@
229
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700230$(M)/prep-buildnode: | $(M)/cord-config $(PREP_BUILDNODE_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700231 $(ANSIBLE_PB) $(PI)/prep-buildnode-playbook.yml $(LOGCMD)
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700232 @echo Waiting 20 seconds to timeout SSH ControlPersist, and so future ansible commands gain docker group membership
233 sleep 20
Zack Williamsce63eb02017-02-28 10:46:22 -0700234 touch $@
235
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700236$(M)/prep-headnode: | $(M)/cord-config $(PREP_HEADNODE_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700237 $(ANSIBLE_PB) $(PI)/prep-headnode-playbook.yml $(LOGCMD)
238 touch $@
239
Zack Williams0a7ef162017-07-18 18:15:26 -0700240$(M)/deploy-elasticstack: | $(M)/prep-headnode
Zack Williamsce63eb02017-02-28 10:46:22 -0700241 $(ANSIBLE_PB) $(PI)/deploy-elasticstack-playbook.yml $(LOGCMD)
242 touch $@
243
244$(M)/prep-computenode: | $(M)/prep-headnode
245 $(ANSIBLE_PB) $(PI)/prep-computenode-playbook.yml $(LOGCMD)
246 touch $@
247
Andy Bavier35d238e2017-07-24 16:47:22 -0700248
249# MaaS targets
250$(M)/build-maas-images: | $(M)/prep-buildnode $(BUILD_MAAS_IMAGES_PREREQS)
Andy Bavierafaa5302017-08-15 08:56:15 -0700251 $(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 -0700252 touch $@
253
Andy Bavier21e4fe42017-09-29 10:27:12 -0700254$(M)/maas-prime: | $(M)/prep-headnode
Andy Bavier35d238e2017-07-24 16:47:22 -0700255 $(ANSIBLE_PB) $(MAAS)/prime-node.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700256 touch $@
257
Andy Bavier35d238e2017-07-24 16:47:22 -0700258$(M)/publish-maas-images: | $(M)/maas-prime $(M)/build-maas-images
Andy Bavier09410472017-08-15 14:29:35 -0700259 $(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 -0700260 touch $@
261
Andy Bavier35d238e2017-07-24 16:47:22 -0700262$(M)/deploy-maas: | $(M)/publish-maas-images $(M)/cord-config $(M)/copy-config
263 $(ANSIBLE_PB) $(MAAS)/head-node.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700264 touch $@
265
Andy Bavier35d238e2017-07-24 16:47:22 -0700266
267# ONOS targets
Zack Williams5e039f02017-11-16 09:50:09 -0700268$(M)/deploy-mavenrepo: | $(M)/docker-images $(DEPLOY_MAVENREPO_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700269 $(ANSIBLE_PB) $(PI)/deploy-mavenrepo-playbook.yml $(LOGCMD)
270 touch $@
271
Zack Williams8845ee52017-10-04 23:13:26 -0700272$(M)/deploy-onos: | $(M)/docker-images $(M)/deploy-mavenrepo $(DEPLOY_ONOS_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700273 $(ANSIBLE_PB) $(PI)/deploy-onos-playbook.yml $(LOGCMD)
274 touch $@
275
Zack Williams58e41572017-09-29 07:57:14 -0700276$(M)/onos-debug: | $(M)/onboard-profile $(M)/deploy-onos
Zack Williams32295d52017-08-28 22:49:37 -0700277 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onos-debug-playbook.yml" $(LOGCMD)
278 touch $@
279
Andy Bavier35d238e2017-07-24 16:47:22 -0700280
281# XOS targets
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700282$(M)/docker-images: | $(M)/prep-buildnode $(DOCKER_IMAGES_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700283 $(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 -0700284 touch $@
285
Andy Bavier35d238e2017-07-24 16:47:22 -0700286$(M)/core-image: | $(M)/docker-images
Zack Williamsce63eb02017-02-28 10:46:22 -0700287 $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD)
288 touch $@
289
Andy Bavier35d238e2017-07-24 16:47:22 -0700290# Requires ib_actions.yml file which is on the build host
Andy Bavier61dc81a2017-08-23 15:29:45 -0700291$(M)/publish-docker-images: | $(M)/deploy-maas $(M)/docker-images $(M)/core-image
Andy Bavier35d238e2017-07-24 16:47:22 -0700292 $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build; $(ANSIBLE_PB_LOCAL) $(PI)/publish-images-playbook.yml" $(LOGCMD)
293 touch $@
294
Zack Williams49995e62017-10-06 12:46:08 -0700295$(M)/start-xos: | $(M)/prep-headnode $(M)/cord-config $(M)/core-image $(START_XOS_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700296 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/start-xos-playbook.yml" $(LOGCMD)
297 touch $@
298
Andy Bavier35d238e2017-07-24 16:47:22 -0700299$(M)/onboard-profile: | $(M)/start-xos
300 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-profile-playbook.yml" $(LOGCMD)
Zack Williams2f56eee2017-07-17 09:59:16 -0700301 touch $@
302
Andy Bavier35d238e2017-07-24 16:47:22 -0700303
304# OpenStack targets
305$(M)/glance-images: | $(M)/prep-headnode
306 $(ANSIBLE_PB) $(PI)/glance-images-playbook.yml $(LOGCMD)
307 touch $@
308
Andy Bavier21e4fe42017-09-29 10:27:12 -0700309$(M)/deploy-openstack: | $(M)/prep-headnode $(M)/prep-computenode $(DEPLOY_OPENSTACK_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700310 $(ANSIBLE_PB) $(PI)/deploy-openstack-playbook.yml $(LOGCMD)
311 touch $@
312
313$(M)/deploy-computenode: | $(M)/deploy-openstack
314 $(ANSIBLE_PB) $(PI)/deploy-computenode-playbook.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700315 touch $@
316
317$(M)/onboard-openstack: | $(M)/deploy-computenode $(M)/glance-images $(M)/deploy-onos $(M)/onboard-profile
318 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-openstack-playbook.yml" $(LOGCMD)
319 touch $@
320
Andy Bavier35d238e2017-07-24 16:47:22 -0700321
322# Post-onboarding targets
323$(M)/setup-automation: | $(M)/onboard-profile $(M)/deploy-onos $(SETUP_AUTOMATION_PREREQS)
324 $(ANSIBLE_PB) $(PI)/cord-automation-playbook.yml $(LOGCMD)
325 touch $@
326
327
328# Additional CiaB targets
Andy Bavier35d238e2017-07-24 16:47:22 -0700329$(M)/setup-ciab-pcu: | $(M)/setup-automation
330 $(ANSIBLE_PB) $(MAAS)/setup-ciab-pcu.yml
331 touch $@
332
Andy Bavierb36b84e2017-08-10 14:46:32 -0700333$(M)/compute%-up: | $(M)/setup-ciab-pcu
Andy Bavier35d238e2017-07-24 16:47:22 -0700334 $(VAGRANT) up compute$* --provider $(VAGRANT_PROVIDER) $(LOGCMD)
335 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) ansible/maas-provision.yml --extra-vars='maas_user=maas vagrant_name=cord_compute$*'" $(LOGCMD)
336 touch $@
337
Andy Bavierb36b84e2017-08-10 14:46:32 -0700338$(M)/refresh-fabric: | $(M)/compute1-up
339 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) $(PI)/cord-refresh-fabric.yml" $(LOGCMD)
340 touch $@
341
Andy Bavier35d238e2017-07-24 16:47:22 -0700342
Zack Williamsce63eb02017-02-28 10:46:22 -0700343# Testing targets
Andy Bavier35d238e2017-07-24 16:47:22 -0700344pod-test: $(M)/setup-automation collect-diag
345 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/pod-test-playbook.yml" $(LOGCMD)
346
Andy Bavier6fb9a3e2017-10-17 10:48:41 -0700347mcord-test: $(M)/setup-automation
348 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-test-playbook.yml" $(LOGCMD)
349
Andy Bavierf6b008d2017-10-24 06:06:01 -0700350mcord-spirent-test: $(M)/setup-automation
351 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-spirent-test-playbook.yml" $(LOGCMD)
352
Andy Bavier5e625442017-11-29 13:42:37 -0700353mcord-ng40-test: $(M)/setup-automation
354 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-ng40-test-playbook.yml" $(LOGCMD)
Andy Bavier2eb3cac2017-11-17 08:52:31 -0700355
Andy Bavierb36b84e2017-08-10 14:46:32 -0700356fabric-pingtest: $(M)/refresh-fabric
357 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) $(PI)/cord-fabric-pingtest.yml" $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700358
Zack Williams32295d52017-08-28 22:49:37 -0700359
Zack Williamsce63eb02017-02-28 10:46:22 -0700360# Local Targets, bring up XOS containers without a VM
Zack Williamsce63eb02017-02-28 10:46:22 -0700361$(M)/local-cord-config:
362 $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
363 touch $@
364
365$(M)/local-docker-images: | $(M)/local-cord-config
366 $(IMAGEBUILDER) -f $(MASTER_CONFIG) -l $(BUILD)/image_logs -g $(BUILD)/ib_graph.dot -a $(BUILD)/ib_actions.yml $(LOGCMD)
367 touch $@
368
369$(M)/local-core-image: | $(M)/local-docker-images
370 $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD)
371 touch $@
372
373$(M)/local-start-xos: | $(M)/local-core-image
374 $(ANSIBLE_PB) $(PI)/start-xos-playbook.yml $(LOGCMD)
375 touch $@
376
377$(M)/local-onboard-profile: | $(M)/local-start-xos
378 $(ANSIBLE_PB) $(PI)/onboard-profile-playbook.yml $(LOGCMD)
379 touch $@
380