blob: c86725ec2524e35932e272714e4426bad2b8bc55 [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
Andy Bavier3316e602017-12-20 19:36:00 -070017USECASE := $(shell echo $(PODCONFIG) | awk -F '-' '{ print $$1}')
18PROFILE_D ?= $(CORD)/orchestration/profiles/$(USECASE)
19
20PODCONFIG_D ?= $(PROFILE_D)/podconfig
Zack Williamsce63eb02017-02-28 10:46:22 -070021PODCONFIG_PATH ?= $(PODCONFIG_D)/$(PODCONFIG)
22
23SCENARIOS_D ?= $(BUILD)/scenarios
24GENCONFIG_D ?= $(BUILD)/genconfig
25
Andy Bavier3316e602017-12-20 19:36:00 -070026
Zack Williamse53c9ca2017-11-29 16:22:13 -070027CONFIG_CORD_PROFILE_DIR ?= $(CORD)/../cord_profile
28
Zack Williamsce63eb02017-02-28 10:46:22 -070029# Milestones/logs paths
30M ?= $(BUILD)/milestones
31LOGS ?= $(BUILD)/logs
32
Zack Williams32295d52017-08-28 22:49:37 -070033PREP_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 -070034MAAS_MS ?= $(M)/build-maas-images $(M)/maas-prime $(M)/publish-maas-images $(M)/deploy-maas
35OPENSTACK_MS ?= $(M)/glance-images $(M)/deploy-openstack $(M)/deploy-computenode $(M)/onboard-openstack
36XOS_MS ?= $(M)/docker-images $(M)/core-image $(M)/publish-docker-images $(M)/start-xos $(M)/onboard-profile
37ONOS_MS ?= $(M)/build-onos-apps $(M)/publish-onos-apps $(M)/deploy-onos $(M)/deploy-mavenrepo
Andy Bavierb36b84e2017-08-10 14:46:32 -070038POST_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 -070039LOCAL_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 -070040ALL_MILESTONES ?= $(PREP_MS) $(MAAS_MS) $(OPENSTACK_MS) $(XOS_MS) $(ONOS_MS) $(POST_INSTALL_MS) $(LOCAL_MILESTONES)
Zack Williamsce63eb02017-02-28 10:46:22 -070041
42# Configuration files
43MASTER_CONFIG ?= $(GENCONFIG_D)/config.yml
44MAKEFILE_CONFIG ?= $(GENCONFIG_D)/config.mk
45INVENTORY ?= $(GENCONFIG_D)/inventory.ini
46PROFILE_NAME_F ?= $(GENCONFIG_D)/cord_profile
47SCENARIO_NAME_F ?= $(GENCONFIG_D)/cord_scenario
48
49CONFIG_FILES = $(MASTER_CONFIG) $(MAKEFILE_CONFIG) $(INVENTORY) $(PROFILE_NAME_F) $(SCENARIO_NAME_F)
50
51include $(MAKEFILE_CONFIG)
52
53# Set using files from genconfig
54SCENARIO = $(shell cat $(SCENARIO_NAME_F))
55PROFILE = $(shell cat $(PROFILE_NAME_F))
56
57# Host names for SSH commands
58BUILDNODE ?= head1
59HEADNODE ?= ${BUILDNODE}
60
61# Vagrant config
62VAGRANT_PROVIDER ?= libvirt
63VAGRANT_VMS ?= $(HEADNODE)
Andy Bavier35d238e2017-07-24 16:47:22 -070064VAGRANT_SWITCHES ?= leaf1
Zack Williamsce63eb02017-02-28 10:46:22 -070065VAGRANT_CWD ?= $(SCENARIOS_D)/$(SCENARIO)/
Zack Williamsce63eb02017-02-28 10:46:22 -070066
Luca Pretedcac43b2017-09-14 14:35:13 -070067# Virsh config
68VIRSH_CORDDEV_DOMAIN ?= cord_corddev
69
Zack Williamsce63eb02017-02-28 10:46:22 -070070# Ansible args, for verbosity and other runtime parameters
71ANSIBLE_ARGS ?=
Zack Williamsf87ef6e2017-10-16 22:30:00 -070072EXTRA_VARS ?= --extra-vars "@/opt/cord_profile/genconfig/config.yml"
Zack Williamsce63eb02017-02-28 10:46:22 -070073
74# Commands
75SHELL = bash -o pipefail
76VAGRANT ?= VAGRANT_CWD=$(VAGRANT_CWD) vagrant
77ANSIBLE ?= ansible -i $(INVENTORY)
78ANSIBLE_PB ?= ansible-playbook $(ANSIBLE_ARGS) -i $(INVENTORY) --extra-vars @$(MASTER_CONFIG)
Zack Williamsf87ef6e2017-10-16 22:30:00 -070079ANSIBLE_PB_LOCAL ?= ansible-playbook $(ANSIBLE_ARGS) -i $(PI)/inventory/head-localhost $(EXTRA_VARS)
80ANSIBLE_PB_MAAS ?= ansible-playbook $(ANSIBLE_ARGS) -i /etc/maas/ansible/pod-inventory $(EXTRA_VARS)
Zack Williamsce63eb02017-02-28 10:46:22 -070081IMAGEBUILDER ?= python $(BUILD)/scripts/imagebuilder.py
82LOGCMD ?= 2>&1 | tee -a $(LOGS)/$(TS)_$(@F)
83SSH_HEAD ?= ssh $(HEADNODE)
84SSH_BUILD ?= ssh $(BUILDNODE)
85
86# default target, prints help
87.DEFAULT: help
88
89help:
Zack Williams32295d52017-08-28 22:49:37 -070090 @echo "Please specify a target (config, build, ...)"
Zack Williamsce63eb02017-02-28 10:46:22 -070091
92# Config file generation
Zack Williamsd3a527c2017-09-13 12:24:57 -070093config: $(CONFIG_FILES)
Zack Williams32295d52017-08-28 22:49:37 -070094 @echo ""
95 @echo "CORD is configured with profile: '$(PROFILE)', scenario: '$(SCENARIO)'"
96 @echo "Run 'make -j4 build' to continue."
Zack Williamsce63eb02017-02-28 10:46:22 -070097
Zack Williamsce63eb02017-02-28 10:46:22 -070098$(CONFIG_FILES):
Zack Williamsd3a527c2017-09-13 12:24:57 -070099 test -e "$(PODCONFIG_PATH)" || { echo "PODCONFIG file $(PODCONFIG_PATH) doesn't exist!" ; exit 1; }
Andy Bavier3316e602017-12-20 19:36:00 -0700100 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 -0700101
Zack Williamsd3a527c2017-09-13 12:24:57 -0700102printconfig:
Zack Williams32295d52017-08-28 22:49:37 -0700103 @echo "Scenario: '$(SCENARIO)'"
104 @echo "Profile: '$(PROFILE)'"
Zack Williamsce63eb02017-02-28 10:46:22 -0700105
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700106# == BUILD TARGET == #
107# This is entirely determined by the podconfig/scenario, and should generally
108# be set to only one value - everything else should be a dependency
Zack Williamsce63eb02017-02-28 10:46:22 -0700109build: $(BUILD_TARGETS)
110
Zack Williams32295d52017-08-28 22:49:37 -0700111# Utility targets
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700112ansible-ping:
113 $(ANSIBLE) -m ping all $(LOGCMD)
114
115ansible-setup:
116 $(ANSIBLE) -m setup all $(LOGCMD)
117
Zack Williamsce63eb02017-02-28 10:46:22 -0700118clean-images:
Zack Williams9d0b6272017-09-21 16:43:39 -0700119 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 -0700120
121clean-genconfig:
122 rm -f $(CONFIG_FILES)
123
124clean-profile:
Zack Williams93ae6382017-10-04 16:31:06 -0700125 rm -rf $(CONFIG_CORD_PROFILE_DIR)/*
Zack Williamsd3a527c2017-09-13 12:24:57 -0700126 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 -0700127
Luca Pretedcac43b2017-09-14 14:35:13 -0700128clean-all: virsh-domain-destroy vagrant-destroy clean-profile clean-genconfig
Zack Williamsce63eb02017-02-28 10:46:22 -0700129 rm -f $(ALL_MILESTONES)
130
Zack Williams32295d52017-08-28 22:49:37 -0700131clean-onos:
Zack Williams9d0b6272017-09-21 16:43:39 -0700132 $(ANSIBLE_PB) $(PI)/teardown-onos-playbook.yml $(LOGCMD)
Zack Williams32295d52017-08-28 22:49:37 -0700133 rm -f $(M)/deploy-onos $(M)/onos-debug
134
135clean-openstack:
136 $(SSH_HEAD) "/opt/cord/build/platform-install/scripts/clean_openstack.sh" $(LOGCMD)
137 rm -f $(M)/onboard-openstack
138
139collect-diag:
140 $(ANSIBLE_PB) $(PI)/collect-diag-playbook.yml $(LOGCMD)
141
142compute-node-refresh:
143 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) --private-key ~/.ssh/cord_rsa $(PI)/compute-node-refresh-playbook.yml" $(LOGCMD)
144
Zack Williams2b26e562017-09-05 16:14:04 -0700145vagrant-destroy:
Zack Williams75a1df32017-11-14 14:48:45 -0700146 $(VAGRANT) destroy -f $(LOGCMD) || true
Zack Williams32295d52017-08-28 22:49:37 -0700147 rm -f $(M)/vagrant-up $(M)/vagrant-ssh-install $(VAGRANT_SSH_CONF)
Zack Williams2b26e562017-09-05 16:14:04 -0700148
Luca Pretedcac43b2017-09-14 14:35:13 -0700149virsh-domain-destroy:
150 virsh destroy ${VIRSH_CORDDEV_DOMAIN} || true
151 virsh undefine ${VIRSH_CORDDEV_DOMAIN} || true
152
Zack Williams2b26e562017-09-05 16:14:04 -0700153xos-teardown: xos-update-images
Zack Williams9d0b6272017-09-21 16:43:39 -0700154 $(ANSIBLE_PB) $(PI)/teardown-xos-playbook.yml $(LOGCMD)
Zack Williamse53c9ca2017-11-29 16:22:13 -0700155 rm -f $(M)/onboard-profile
Zack Williams2b26e562017-09-05 16:14:04 -0700156
157xos-update-images: clean-images
158 rm -f $(M)/start-xos $(M)/local-start-xos
159
Zack Williamse53c9ca2017-11-29 16:22:13 -0700160# local scenario helpers
161clean-local: local-xos-teardown clean-profile clean-genconfig clean-images
162 rm -f $(LOCAL_MILESTONES)
163
164local-ubuntu-dev-env:
165 $(ANSIBLE_PB) $(PI)/bootstrap-dev-env.yml $(LOGCMD)
166
167local-xos-teardown:
168 cd $(CONFIG_CORD_PROFILE_DIR); docker-compose -p $(PROFILE) rm -s -f || true
169 rm -f $(M)/local-onboard-profile
170
171# docs
172.PHONY: docs
173docs:
174 cd docs; make
Andy Bavier35d238e2017-07-24 16:47:22 -0700175
Zack Williamsce63eb02017-02-28 10:46:22 -0700176# == PREREQS == #
Zack Williams8845ee52017-10-04 23:13:26 -0700177VAGRANT_UP_PREREQS ?=
178COPY_CORD_PREREQS ?=
179CORD_CONFIG_PREREQS ?=
Zack Williams39c9aa92017-10-17 08:35:00 -0700180CONFIG_SSH_KEY_PREREQS ?=
Zack Williams8845ee52017-10-04 23:13:26 -0700181PREP_BUILDNODE_PREREQS ?=
182PREP_HEADNODE_PREREQS ?=
183DOCKER_IMAGES_PREREQS ?=
184START_XOS_PREREQS ?=
185BUILD_ONOS_APPS_PREREQS ?=
186DEPLOY_ONOS_PREREQS ?=
Andy Bavierafaa5302017-08-15 08:56:15 -0700187DEPLOY_MAVENREPO_PREREQS ?=
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700188DEPLOY_OPENSTACK_PREREQS ?=
Andy Bavier35d238e2017-07-24 16:47:22 -0700189SETUP_AUTOMATION_PREREQS ?=
Zack Williamsce63eb02017-02-28 10:46:22 -0700190
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700191
Zack Williamsce63eb02017-02-28 10:46:22 -0700192# == MILESTONES == #
193# empty target files are touched in the milestones dir to indicate completion
194
Andy Bavier35d238e2017-07-24 16:47:22 -0700195# Prep targets
Zack Williamsce63eb02017-02-28 10:46:22 -0700196$(M)/prereqs-check:
197 $(ANSIBLE_PB) $(PI)/prereqs-check-playbook.yml $(LOGCMD)
198 touch $@
199
Andy Bavierafaa5302017-08-15 08:56:15 -0700200$(M)/build-local-bootstrap:
201 $(ANSIBLE_PB) $(BUILD)/ansible/build-local-bootstrap.yml $(LOGCMD)
202 touch $@
203
Andy Bavierb36b84e2017-08-10 14:46:32 -0700204$(M)/ciab-ovs:
205 $(ANSIBLE_PB) $(BUILD)/ansible/ciab-ovs.yml $(LOGCMD)
206 touch $@
207
Zack Williamsce63eb02017-02-28 10:46:22 -0700208$(M)/vagrant-up: | $(VAGRANT_UP_PREREQS)
209 $(VAGRANT) up $(VAGRANT_VMS) --provider $(VAGRANT_PROVIDER) $(LOGCMD)
Zack Williams32295d52017-08-28 22:49:37 -0700210 touch $@
211
212$(M)/vagrant-ssh-install: | $(M)/vagrant-up
Andy Baviere6c255f2017-09-15 16:13:37 -0700213 $(VAGRANT) ssh-config $(VAGRANT_VMS) > /tmp/vagrant_ssh_config
214 $(ANSIBLE_PB) $(BUILD)/ansible/vagrant-ssh-install.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700215 touch $@
216
Zack Williams39c9aa92017-10-17 08:35:00 -0700217$(M)/config-ssh-key: | $(CONFIG_SSH_KEY_PREREQS)
Zack Williams2b26e562017-09-05 16:14:04 -0700218 $(ANSIBLE_PB) $(BUILD)/ansible/config-ssh-key.yml $(LOGCMD)
219 touch $@
220
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700221$(M)/copy-cord: | $(COPY_CORD_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700222 $(ANSIBLE_PB) $(PI)/copy-cord-playbook.yml $(LOGCMD)
223 touch $@
224
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700225$(M)/cord-config: | $(CORD_CONFIG_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700226 $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
227 cp -r $(GENCONFIG_D) $(CONFIG_CORD_PROFILE_DIR)/genconfig
228 touch $@
229
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700230$(M)/copy-config: | $(M)/cord-config
Zack Williamsce63eb02017-02-28 10:46:22 -0700231 $(ANSIBLE_PB) $(PI)/copy-profile-playbook.yml $(LOGCMD)
232 touch $@
233
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700234$(M)/prep-buildnode: | $(M)/cord-config $(PREP_BUILDNODE_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700235 $(ANSIBLE_PB) $(PI)/prep-buildnode-playbook.yml $(LOGCMD)
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700236 @echo Waiting 20 seconds to timeout SSH ControlPersist, and so future ansible commands gain docker group membership
237 sleep 20
Zack Williamsce63eb02017-02-28 10:46:22 -0700238 touch $@
239
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700240$(M)/prep-headnode: | $(M)/cord-config $(PREP_HEADNODE_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700241 $(ANSIBLE_PB) $(PI)/prep-headnode-playbook.yml $(LOGCMD)
242 touch $@
243
Zack Williams0a7ef162017-07-18 18:15:26 -0700244$(M)/deploy-elasticstack: | $(M)/prep-headnode
Zack Williamsce63eb02017-02-28 10:46:22 -0700245 $(ANSIBLE_PB) $(PI)/deploy-elasticstack-playbook.yml $(LOGCMD)
246 touch $@
247
248$(M)/prep-computenode: | $(M)/prep-headnode
249 $(ANSIBLE_PB) $(PI)/prep-computenode-playbook.yml $(LOGCMD)
250 touch $@
251
Andy Bavier35d238e2017-07-24 16:47:22 -0700252
253# MaaS targets
254$(M)/build-maas-images: | $(M)/prep-buildnode $(BUILD_MAAS_IMAGES_PREREQS)
Andy Bavierafaa5302017-08-15 08:56:15 -0700255 $(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 -0700256 touch $@
257
Andy Bavier21e4fe42017-09-29 10:27:12 -0700258$(M)/maas-prime: | $(M)/prep-headnode
Andy Bavier35d238e2017-07-24 16:47:22 -0700259 $(ANSIBLE_PB) $(MAAS)/prime-node.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700260 touch $@
261
Andy Bavier35d238e2017-07-24 16:47:22 -0700262$(M)/publish-maas-images: | $(M)/maas-prime $(M)/build-maas-images
Andy Bavier09410472017-08-15 14:29:35 -0700263 $(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 -0700264 touch $@
265
Andy Bavier35d238e2017-07-24 16:47:22 -0700266$(M)/deploy-maas: | $(M)/publish-maas-images $(M)/cord-config $(M)/copy-config
267 $(ANSIBLE_PB) $(MAAS)/head-node.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700268 touch $@
269
Andy Bavier35d238e2017-07-24 16:47:22 -0700270
271# ONOS targets
Zack Williams5e039f02017-11-16 09:50:09 -0700272$(M)/deploy-mavenrepo: | $(M)/docker-images $(DEPLOY_MAVENREPO_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700273 $(ANSIBLE_PB) $(PI)/deploy-mavenrepo-playbook.yml $(LOGCMD)
274 touch $@
275
Zack Williams8845ee52017-10-04 23:13:26 -0700276$(M)/deploy-onos: | $(M)/docker-images $(M)/deploy-mavenrepo $(DEPLOY_ONOS_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700277 $(ANSIBLE_PB) $(PI)/deploy-onos-playbook.yml $(LOGCMD)
278 touch $@
279
Zack Williams58e41572017-09-29 07:57:14 -0700280$(M)/onos-debug: | $(M)/onboard-profile $(M)/deploy-onos
Zack Williams32295d52017-08-28 22:49:37 -0700281 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onos-debug-playbook.yml" $(LOGCMD)
282 touch $@
283
Andy Bavier35d238e2017-07-24 16:47:22 -0700284
285# XOS targets
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700286$(M)/docker-images: | $(M)/prep-buildnode $(DOCKER_IMAGES_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700287 $(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 -0700288 touch $@
289
Andy Bavier35d238e2017-07-24 16:47:22 -0700290$(M)/core-image: | $(M)/docker-images
Zack Williamsce63eb02017-02-28 10:46:22 -0700291 $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD)
292 touch $@
293
Andy Bavier35d238e2017-07-24 16:47:22 -0700294# Requires ib_actions.yml file which is on the build host
Andy Bavier61dc81a2017-08-23 15:29:45 -0700295$(M)/publish-docker-images: | $(M)/deploy-maas $(M)/docker-images $(M)/core-image
Andy Bavier35d238e2017-07-24 16:47:22 -0700296 $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build; $(ANSIBLE_PB_LOCAL) $(PI)/publish-images-playbook.yml" $(LOGCMD)
297 touch $@
298
Zack Williams49995e62017-10-06 12:46:08 -0700299$(M)/start-xos: | $(M)/prep-headnode $(M)/cord-config $(M)/core-image $(START_XOS_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700300 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/start-xos-playbook.yml" $(LOGCMD)
301 touch $@
302
Andy Bavier35d238e2017-07-24 16:47:22 -0700303$(M)/onboard-profile: | $(M)/start-xos
304 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-profile-playbook.yml" $(LOGCMD)
Zack Williams2f56eee2017-07-17 09:59:16 -0700305 touch $@
306
Andy Bavier35d238e2017-07-24 16:47:22 -0700307
308# OpenStack targets
309$(M)/glance-images: | $(M)/prep-headnode
310 $(ANSIBLE_PB) $(PI)/glance-images-playbook.yml $(LOGCMD)
311 touch $@
312
Andy Bavier21e4fe42017-09-29 10:27:12 -0700313$(M)/deploy-openstack: | $(M)/prep-headnode $(M)/prep-computenode $(DEPLOY_OPENSTACK_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700314 $(ANSIBLE_PB) $(PI)/deploy-openstack-playbook.yml $(LOGCMD)
315 touch $@
316
317$(M)/deploy-computenode: | $(M)/deploy-openstack
318 $(ANSIBLE_PB) $(PI)/deploy-computenode-playbook.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700319 touch $@
320
321$(M)/onboard-openstack: | $(M)/deploy-computenode $(M)/glance-images $(M)/deploy-onos $(M)/onboard-profile
322 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-openstack-playbook.yml" $(LOGCMD)
323 touch $@
324
Andy Bavier35d238e2017-07-24 16:47:22 -0700325
326# Post-onboarding targets
327$(M)/setup-automation: | $(M)/onboard-profile $(M)/deploy-onos $(SETUP_AUTOMATION_PREREQS)
328 $(ANSIBLE_PB) $(PI)/cord-automation-playbook.yml $(LOGCMD)
329 touch $@
330
331
332# Additional CiaB targets
Andy Bavier35d238e2017-07-24 16:47:22 -0700333$(M)/setup-ciab-pcu: | $(M)/setup-automation
334 $(ANSIBLE_PB) $(MAAS)/setup-ciab-pcu.yml
335 touch $@
336
Andy Bavierb36b84e2017-08-10 14:46:32 -0700337$(M)/compute%-up: | $(M)/setup-ciab-pcu
Andy Bavier35d238e2017-07-24 16:47:22 -0700338 $(VAGRANT) up compute$* --provider $(VAGRANT_PROVIDER) $(LOGCMD)
339 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) ansible/maas-provision.yml --extra-vars='maas_user=maas vagrant_name=cord_compute$*'" $(LOGCMD)
340 touch $@
341
Andy Bavierb36b84e2017-08-10 14:46:32 -0700342$(M)/refresh-fabric: | $(M)/compute1-up
343 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) $(PI)/cord-refresh-fabric.yml" $(LOGCMD)
344 touch $@
345
Andy Bavier35d238e2017-07-24 16:47:22 -0700346
Zack Williamsce63eb02017-02-28 10:46:22 -0700347# Testing targets
Andy Bavier35d238e2017-07-24 16:47:22 -0700348pod-test: $(M)/setup-automation collect-diag
349 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/pod-test-playbook.yml" $(LOGCMD)
350
Andy Bavier5e625442017-11-29 13:42:37 -0700351mcord-ng40-test: $(M)/setup-automation
352 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-ng40-test-playbook.yml" $(LOGCMD)
Andy Bavier2eb3cac2017-11-17 08:52:31 -0700353
Andy Bavier8b1bd362018-01-03 16:41:38 -0700354mcord-cavium-test: $(M)/setup-automation
355 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-cavium-test-playbook.yml" $(LOGCMD)
356
Andy Bavierb36b84e2017-08-10 14:46:32 -0700357fabric-pingtest: $(M)/refresh-fabric
358 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) $(PI)/cord-fabric-pingtest.yml" $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700359
Zack Williams32295d52017-08-28 22:49:37 -0700360
Zack Williamsce63eb02017-02-28 10:46:22 -0700361# Local Targets, bring up XOS containers without a VM
Zack Williamsce63eb02017-02-28 10:46:22 -0700362$(M)/local-cord-config:
363 $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
364 touch $@
365
366$(M)/local-docker-images: | $(M)/local-cord-config
367 $(IMAGEBUILDER) -f $(MASTER_CONFIG) -l $(BUILD)/image_logs -g $(BUILD)/ib_graph.dot -a $(BUILD)/ib_actions.yml $(LOGCMD)
368 touch $@
369
370$(M)/local-core-image: | $(M)/local-docker-images
371 $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD)
372 touch $@
373
374$(M)/local-start-xos: | $(M)/local-core-image
375 $(ANSIBLE_PB) $(PI)/start-xos-playbook.yml $(LOGCMD)
376 touch $@
377
378$(M)/local-onboard-profile: | $(M)/local-start-xos
379 $(ANSIBLE_PB) $(PI)/onboard-profile-playbook.yml $(LOGCMD)
380 touch $@
381