blob: c3c3038aaa7a834f0fefde191ee03f98158f5a9c [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
10MAAS ?= $(BUILD)/maas
Zack Williams2f56eee2017-07-17 09:59:16 -070011ONOS_APPS ?= $(CORD)/onos-apps
Zack Williamsce63eb02017-02-28 10:46:22 -070012
13# Configuration paths
Andy Bavier4775df22018-01-05 10:52:30 -070014ifdef PODCONFIG_PATH
15 USECASE := $(shell grep cord_profile: $(PODCONFIG_PATH) | awk '{print $$2}')
16else ifdef PODCONFIG
17 USECASE := $(shell echo $(PODCONFIG) | awk -F '-' '{print $$1}')
18else
19 USECASE = invalid
20endif
21
Andy Bavier3316e602017-12-20 19:36:00 -070022PROFILE_D ?= $(CORD)/orchestration/profiles/$(USECASE)
23
24PODCONFIG_D ?= $(PROFILE_D)/podconfig
Zack Williamsce63eb02017-02-28 10:46:22 -070025PODCONFIG_PATH ?= $(PODCONFIG_D)/$(PODCONFIG)
26
27SCENARIOS_D ?= $(BUILD)/scenarios
28GENCONFIG_D ?= $(BUILD)/genconfig
29
Andy Bavier3316e602017-12-20 19:36:00 -070030
Zack Williamse53c9ca2017-11-29 16:22:13 -070031CONFIG_CORD_PROFILE_DIR ?= $(CORD)/../cord_profile
32
Zack Williamsce63eb02017-02-28 10:46:22 -070033# Milestones/logs paths
34M ?= $(BUILD)/milestones
35LOGS ?= $(BUILD)/logs
36
Zack Williams32295d52017-08-28 22:49:37 -070037PREP_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 -070038MAAS_MS ?= $(M)/build-maas-images $(M)/maas-prime $(M)/publish-maas-images $(M)/deploy-maas
39OPENSTACK_MS ?= $(M)/glance-images $(M)/deploy-openstack $(M)/deploy-computenode $(M)/onboard-openstack
40XOS_MS ?= $(M)/docker-images $(M)/core-image $(M)/publish-docker-images $(M)/start-xos $(M)/onboard-profile
41ONOS_MS ?= $(M)/build-onos-apps $(M)/publish-onos-apps $(M)/deploy-onos $(M)/deploy-mavenrepo
Andy Bavierb36b84e2017-08-10 14:46:32 -070042POST_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 -070043LOCAL_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 -070044ALL_MILESTONES ?= $(PREP_MS) $(MAAS_MS) $(OPENSTACK_MS) $(XOS_MS) $(ONOS_MS) $(POST_INSTALL_MS) $(LOCAL_MILESTONES)
Zack Williamsce63eb02017-02-28 10:46:22 -070045
46# Configuration files
47MASTER_CONFIG ?= $(GENCONFIG_D)/config.yml
48MAKEFILE_CONFIG ?= $(GENCONFIG_D)/config.mk
49INVENTORY ?= $(GENCONFIG_D)/inventory.ini
50PROFILE_NAME_F ?= $(GENCONFIG_D)/cord_profile
51SCENARIO_NAME_F ?= $(GENCONFIG_D)/cord_scenario
52
53CONFIG_FILES = $(MASTER_CONFIG) $(MAKEFILE_CONFIG) $(INVENTORY) $(PROFILE_NAME_F) $(SCENARIO_NAME_F)
54
55include $(MAKEFILE_CONFIG)
56
57# Set using files from genconfig
58SCENARIO = $(shell cat $(SCENARIO_NAME_F))
59PROFILE = $(shell cat $(PROFILE_NAME_F))
60
61# Host names for SSH commands
62BUILDNODE ?= head1
63HEADNODE ?= ${BUILDNODE}
64
65# Vagrant config
66VAGRANT_PROVIDER ?= libvirt
67VAGRANT_VMS ?= $(HEADNODE)
Andy Bavier35d238e2017-07-24 16:47:22 -070068VAGRANT_SWITCHES ?= leaf1
Zack Williamsce63eb02017-02-28 10:46:22 -070069VAGRANT_CWD ?= $(SCENARIOS_D)/$(SCENARIO)/
Zack Williamsce63eb02017-02-28 10:46:22 -070070
Luca Pretedcac43b2017-09-14 14:35:13 -070071# Virsh config
72VIRSH_CORDDEV_DOMAIN ?= cord_corddev
73
Zack Williamsce63eb02017-02-28 10:46:22 -070074# Ansible args, for verbosity and other runtime parameters
75ANSIBLE_ARGS ?=
Zack Williamsf87ef6e2017-10-16 22:30:00 -070076EXTRA_VARS ?= --extra-vars "@/opt/cord_profile/genconfig/config.yml"
Zack Williamsce63eb02017-02-28 10:46:22 -070077
78# Commands
79SHELL = bash -o pipefail
80VAGRANT ?= VAGRANT_CWD=$(VAGRANT_CWD) vagrant
81ANSIBLE ?= ansible -i $(INVENTORY)
82ANSIBLE_PB ?= ansible-playbook $(ANSIBLE_ARGS) -i $(INVENTORY) --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
86LOGCMD ?= 2>&1 | tee -a $(LOGS)/$(TS)_$(@F)
87SSH_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
143collect-diag:
144 $(ANSIBLE_PB) $(PI)/collect-diag-playbook.yml $(LOGCMD)
145
146compute-node-refresh:
147 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) --private-key ~/.ssh/cord_rsa $(PI)/compute-node-refresh-playbook.yml" $(LOGCMD)
148
Zack Williams2b26e562017-09-05 16:14:04 -0700149vagrant-destroy:
Zack Williams75a1df32017-11-14 14:48:45 -0700150 $(VAGRANT) destroy -f $(LOGCMD) || true
Zack Williams32295d52017-08-28 22:49:37 -0700151 rm -f $(M)/vagrant-up $(M)/vagrant-ssh-install $(VAGRANT_SSH_CONF)
Zack Williams2b26e562017-09-05 16:14:04 -0700152
Luca Pretedcac43b2017-09-14 14:35:13 -0700153virsh-domain-destroy:
154 virsh destroy ${VIRSH_CORDDEV_DOMAIN} || true
155 virsh undefine ${VIRSH_CORDDEV_DOMAIN} || true
156
Zack Williams2b26e562017-09-05 16:14:04 -0700157xos-teardown: xos-update-images
Zack Williams9d0b6272017-09-21 16:43:39 -0700158 $(ANSIBLE_PB) $(PI)/teardown-xos-playbook.yml $(LOGCMD)
Zack Williamse53c9ca2017-11-29 16:22:13 -0700159 rm -f $(M)/onboard-profile
Zack Williams2b26e562017-09-05 16:14:04 -0700160
161xos-update-images: clean-images
162 rm -f $(M)/start-xos $(M)/local-start-xos
163
Zack Williamse53c9ca2017-11-29 16:22:13 -0700164# local scenario helpers
165clean-local: local-xos-teardown clean-profile clean-genconfig clean-images
166 rm -f $(LOCAL_MILESTONES)
167
168local-ubuntu-dev-env:
169 $(ANSIBLE_PB) $(PI)/bootstrap-dev-env.yml $(LOGCMD)
170
171local-xos-teardown:
172 cd $(CONFIG_CORD_PROFILE_DIR); docker-compose -p $(PROFILE) rm -s -f || true
173 rm -f $(M)/local-onboard-profile
174
175# docs
176.PHONY: docs
177docs:
178 cd docs; make
Andy Bavier35d238e2017-07-24 16:47:22 -0700179
Zack Williamsce63eb02017-02-28 10:46:22 -0700180# == PREREQS == #
Zack Williams8845ee52017-10-04 23:13:26 -0700181VAGRANT_UP_PREREQS ?=
182COPY_CORD_PREREQS ?=
183CORD_CONFIG_PREREQS ?=
Zack Williams39c9aa92017-10-17 08:35:00 -0700184CONFIG_SSH_KEY_PREREQS ?=
Zack Williams8845ee52017-10-04 23:13:26 -0700185PREP_BUILDNODE_PREREQS ?=
186PREP_HEADNODE_PREREQS ?=
187DOCKER_IMAGES_PREREQS ?=
188START_XOS_PREREQS ?=
189BUILD_ONOS_APPS_PREREQS ?=
190DEPLOY_ONOS_PREREQS ?=
Andy Bavierafaa5302017-08-15 08:56:15 -0700191DEPLOY_MAVENREPO_PREREQS ?=
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700192DEPLOY_OPENSTACK_PREREQS ?=
Andy Bavier35d238e2017-07-24 16:47:22 -0700193SETUP_AUTOMATION_PREREQS ?=
Zack Williamsce63eb02017-02-28 10:46:22 -0700194
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700195
Zack Williamsce63eb02017-02-28 10:46:22 -0700196# == MILESTONES == #
197# empty target files are touched in the milestones dir to indicate completion
198
Andy Bavier35d238e2017-07-24 16:47:22 -0700199# Prep targets
Zack Williamsce63eb02017-02-28 10:46:22 -0700200$(M)/prereqs-check:
201 $(ANSIBLE_PB) $(PI)/prereqs-check-playbook.yml $(LOGCMD)
202 touch $@
203
Andy Bavierafaa5302017-08-15 08:56:15 -0700204$(M)/build-local-bootstrap:
205 $(ANSIBLE_PB) $(BUILD)/ansible/build-local-bootstrap.yml $(LOGCMD)
206 touch $@
207
Andy Bavierb36b84e2017-08-10 14:46:32 -0700208$(M)/ciab-ovs:
209 $(ANSIBLE_PB) $(BUILD)/ansible/ciab-ovs.yml $(LOGCMD)
210 touch $@
211
Zack Williamsce63eb02017-02-28 10:46:22 -0700212$(M)/vagrant-up: | $(VAGRANT_UP_PREREQS)
213 $(VAGRANT) up $(VAGRANT_VMS) --provider $(VAGRANT_PROVIDER) $(LOGCMD)
Zack Williams32295d52017-08-28 22:49:37 -0700214 touch $@
215
216$(M)/vagrant-ssh-install: | $(M)/vagrant-up
Andy Baviere6c255f2017-09-15 16:13:37 -0700217 $(VAGRANT) ssh-config $(VAGRANT_VMS) > /tmp/vagrant_ssh_config
218 $(ANSIBLE_PB) $(BUILD)/ansible/vagrant-ssh-install.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700219 touch $@
220
Zack Williams39c9aa92017-10-17 08:35:00 -0700221$(M)/config-ssh-key: | $(CONFIG_SSH_KEY_PREREQS)
Zack Williams2b26e562017-09-05 16:14:04 -0700222 $(ANSIBLE_PB) $(BUILD)/ansible/config-ssh-key.yml $(LOGCMD)
223 touch $@
224
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700225$(M)/copy-cord: | $(COPY_CORD_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700226 $(ANSIBLE_PB) $(PI)/copy-cord-playbook.yml $(LOGCMD)
227 touch $@
228
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700229$(M)/cord-config: | $(CORD_CONFIG_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700230 $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
231 cp -r $(GENCONFIG_D) $(CONFIG_CORD_PROFILE_DIR)/genconfig
232 touch $@
233
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700234$(M)/copy-config: | $(M)/cord-config
Zack Williamsce63eb02017-02-28 10:46:22 -0700235 $(ANSIBLE_PB) $(PI)/copy-profile-playbook.yml $(LOGCMD)
236 touch $@
237
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700238$(M)/prep-buildnode: | $(M)/cord-config $(PREP_BUILDNODE_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700239 $(ANSIBLE_PB) $(PI)/prep-buildnode-playbook.yml $(LOGCMD)
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700240 @echo Waiting 20 seconds to timeout SSH ControlPersist, and so future ansible commands gain docker group membership
241 sleep 20
Zack Williamsce63eb02017-02-28 10:46:22 -0700242 touch $@
243
Zack Williamsf87ef6e2017-10-16 22:30:00 -0700244$(M)/prep-headnode: | $(M)/cord-config $(PREP_HEADNODE_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700245 $(ANSIBLE_PB) $(PI)/prep-headnode-playbook.yml $(LOGCMD)
246 touch $@
247
Zack Williams0a7ef162017-07-18 18:15:26 -0700248$(M)/deploy-elasticstack: | $(M)/prep-headnode
Zack Williamsce63eb02017-02-28 10:46:22 -0700249 $(ANSIBLE_PB) $(PI)/deploy-elasticstack-playbook.yml $(LOGCMD)
250 touch $@
251
252$(M)/prep-computenode: | $(M)/prep-headnode
253 $(ANSIBLE_PB) $(PI)/prep-computenode-playbook.yml $(LOGCMD)
254 touch $@
255
Andy Bavier35d238e2017-07-24 16:47:22 -0700256
257# MaaS targets
258$(M)/build-maas-images: | $(M)/prep-buildnode $(BUILD_MAAS_IMAGES_PREREQS)
Andy Bavierafaa5302017-08-15 08:56:15 -0700259 $(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 -0700260 touch $@
261
Andy Bavier21e4fe42017-09-29 10:27:12 -0700262$(M)/maas-prime: | $(M)/prep-headnode
Andy Bavier35d238e2017-07-24 16:47:22 -0700263 $(ANSIBLE_PB) $(MAAS)/prime-node.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700264 touch $@
265
Andy Bavier35d238e2017-07-24 16:47:22 -0700266$(M)/publish-maas-images: | $(M)/maas-prime $(M)/build-maas-images
Andy Bavier09410472017-08-15 14:29:35 -0700267 $(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 -0700268 touch $@
269
Andy Bavier35d238e2017-07-24 16:47:22 -0700270$(M)/deploy-maas: | $(M)/publish-maas-images $(M)/cord-config $(M)/copy-config
271 $(ANSIBLE_PB) $(MAAS)/head-node.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700272 touch $@
273
Andy Bavier35d238e2017-07-24 16:47:22 -0700274
275# ONOS targets
Zack Williams5e039f02017-11-16 09:50:09 -0700276$(M)/deploy-mavenrepo: | $(M)/docker-images $(DEPLOY_MAVENREPO_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700277 $(ANSIBLE_PB) $(PI)/deploy-mavenrepo-playbook.yml $(LOGCMD)
278 touch $@
279
Zack Williams8845ee52017-10-04 23:13:26 -0700280$(M)/deploy-onos: | $(M)/docker-images $(M)/deploy-mavenrepo $(DEPLOY_ONOS_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700281 $(ANSIBLE_PB) $(PI)/deploy-onos-playbook.yml $(LOGCMD)
282 touch $@
283
Zack Williams58e41572017-09-29 07:57:14 -0700284$(M)/onos-debug: | $(M)/onboard-profile $(M)/deploy-onos
Zack Williams32295d52017-08-28 22:49:37 -0700285 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onos-debug-playbook.yml" $(LOGCMD)
286 touch $@
287
Andy Bavier35d238e2017-07-24 16:47:22 -0700288
289# XOS targets
Zack Williamsa5fcefd2017-07-27 22:06:33 -0700290$(M)/docker-images: | $(M)/prep-buildnode $(DOCKER_IMAGES_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700291 $(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 -0700292 touch $@
293
Andy Bavier35d238e2017-07-24 16:47:22 -0700294$(M)/core-image: | $(M)/docker-images
Zack Williamsce63eb02017-02-28 10:46:22 -0700295 $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD)
296 touch $@
297
Andy Bavier35d238e2017-07-24 16:47:22 -0700298# Requires ib_actions.yml file which is on the build host
Andy Bavier61dc81a2017-08-23 15:29:45 -0700299$(M)/publish-docker-images: | $(M)/deploy-maas $(M)/docker-images $(M)/core-image
Andy Bavier35d238e2017-07-24 16:47:22 -0700300 $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build; $(ANSIBLE_PB_LOCAL) $(PI)/publish-images-playbook.yml" $(LOGCMD)
301 touch $@
302
Zack Williams49995e62017-10-06 12:46:08 -0700303$(M)/start-xos: | $(M)/prep-headnode $(M)/cord-config $(M)/core-image $(START_XOS_PREREQS)
Zack Williamsce63eb02017-02-28 10:46:22 -0700304 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/start-xos-playbook.yml" $(LOGCMD)
305 touch $@
306
Andy Bavier35d238e2017-07-24 16:47:22 -0700307$(M)/onboard-profile: | $(M)/start-xos
308 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-profile-playbook.yml" $(LOGCMD)
Zack Williams2f56eee2017-07-17 09:59:16 -0700309 touch $@
310
Andy Bavier35d238e2017-07-24 16:47:22 -0700311
312# OpenStack targets
313$(M)/glance-images: | $(M)/prep-headnode
314 $(ANSIBLE_PB) $(PI)/glance-images-playbook.yml $(LOGCMD)
315 touch $@
316
Andy Bavier21e4fe42017-09-29 10:27:12 -0700317$(M)/deploy-openstack: | $(M)/prep-headnode $(M)/prep-computenode $(DEPLOY_OPENSTACK_PREREQS)
Andy Bavier35d238e2017-07-24 16:47:22 -0700318 $(ANSIBLE_PB) $(PI)/deploy-openstack-playbook.yml $(LOGCMD)
319 touch $@
320
321$(M)/deploy-computenode: | $(M)/deploy-openstack
322 $(ANSIBLE_PB) $(PI)/deploy-computenode-playbook.yml $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700323 touch $@
324
325$(M)/onboard-openstack: | $(M)/deploy-computenode $(M)/glance-images $(M)/deploy-onos $(M)/onboard-profile
326 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-openstack-playbook.yml" $(LOGCMD)
327 touch $@
328
Andy Bavier35d238e2017-07-24 16:47:22 -0700329
330# Post-onboarding targets
331$(M)/setup-automation: | $(M)/onboard-profile $(M)/deploy-onos $(SETUP_AUTOMATION_PREREQS)
332 $(ANSIBLE_PB) $(PI)/cord-automation-playbook.yml $(LOGCMD)
333 touch $@
334
335
336# Additional CiaB targets
Andy Bavier35d238e2017-07-24 16:47:22 -0700337$(M)/setup-ciab-pcu: | $(M)/setup-automation
338 $(ANSIBLE_PB) $(MAAS)/setup-ciab-pcu.yml
339 touch $@
340
Andy Bavierb36b84e2017-08-10 14:46:32 -0700341$(M)/compute%-up: | $(M)/setup-ciab-pcu
Andy Bavier35d238e2017-07-24 16:47:22 -0700342 $(VAGRANT) up compute$* --provider $(VAGRANT_PROVIDER) $(LOGCMD)
343 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) ansible/maas-provision.yml --extra-vars='maas_user=maas vagrant_name=cord_compute$*'" $(LOGCMD)
344 touch $@
345
Andy Bavierb36b84e2017-08-10 14:46:32 -0700346$(M)/refresh-fabric: | $(M)/compute1-up
347 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) $(PI)/cord-refresh-fabric.yml" $(LOGCMD)
348 touch $@
349
Andy Bavier35d238e2017-07-24 16:47:22 -0700350
Zack Williamsce63eb02017-02-28 10:46:22 -0700351# Testing targets
Andy Bavier35d238e2017-07-24 16:47:22 -0700352pod-test: $(M)/setup-automation collect-diag
353 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/pod-test-playbook.yml" $(LOGCMD)
354
Andy Bavier5e625442017-11-29 13:42:37 -0700355mcord-ng40-test: $(M)/setup-automation
356 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-ng40-test-playbook.yml" $(LOGCMD)
Andy Bavier2eb3cac2017-11-17 08:52:31 -0700357
Andy Bavier8b1bd362018-01-03 16:41:38 -0700358mcord-cavium-test: $(M)/setup-automation
359 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-cavium-test-playbook.yml" $(LOGCMD)
360
Andy Bavierb36b84e2017-08-10 14:46:32 -0700361fabric-pingtest: $(M)/refresh-fabric
362 $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) $(PI)/cord-fabric-pingtest.yml" $(LOGCMD)
Zack Williamsce63eb02017-02-28 10:46:22 -0700363
Zack Williams32295d52017-08-28 22:49:37 -0700364
Zack Williamsce63eb02017-02-28 10:46:22 -0700365# Local Targets, bring up XOS containers without a VM
Zack Williamsce63eb02017-02-28 10:46:22 -0700366$(M)/local-cord-config:
367 $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD)
368 touch $@
369
370$(M)/local-docker-images: | $(M)/local-cord-config
371 $(IMAGEBUILDER) -f $(MASTER_CONFIG) -l $(BUILD)/image_logs -g $(BUILD)/ib_graph.dot -a $(BUILD)/ib_actions.yml $(LOGCMD)
372 touch $@
373
374$(M)/local-core-image: | $(M)/local-docker-images
375 $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD)
376 touch $@
377
378$(M)/local-start-xos: | $(M)/local-core-image
379 $(ANSIBLE_PB) $(PI)/start-xos-playbook.yml $(LOGCMD)
380 touch $@
381
382$(M)/local-onboard-profile: | $(M)/local-start-xos
383 $(ANSIBLE_PB) $(PI)/onboard-profile-playbook.yml $(LOGCMD)
384 touch $@
385