Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 1 | # CORD Master Makefile |
| 2 | |
| 3 | # Timestamp for log files |
| 4 | TS := $(shell date +'%Y%m%dT%H%M%SZ') |
| 5 | |
| 6 | # Podconfig must be specified, so an invalid default |
| 7 | PODCONFIG ?= invalid |
| 8 | |
| 9 | # Source path |
| 10 | BUILD ?= . |
| 11 | CORD ?= .. |
| 12 | PI ?= $(BUILD)/platform-install |
| 13 | MAAS ?= $(BUILD)/maas |
Zack Williams | 2f56eee | 2017-07-17 09:59:16 -0700 | [diff] [blame] | 14 | ONOS_APPS ?= $(CORD)/onos-apps |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 15 | |
| 16 | # Configuration paths |
Andy Bavier | 3316e60 | 2017-12-20 19:36:00 -0700 | [diff] [blame^] | 17 | USECASE := $(shell echo $(PODCONFIG) | awk -F '-' '{ print $$1}') |
| 18 | PROFILE_D ?= $(CORD)/orchestration/profiles/$(USECASE) |
| 19 | |
| 20 | PODCONFIG_D ?= $(PROFILE_D)/podconfig |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 21 | PODCONFIG_PATH ?= $(PODCONFIG_D)/$(PODCONFIG) |
| 22 | |
| 23 | SCENARIOS_D ?= $(BUILD)/scenarios |
| 24 | GENCONFIG_D ?= $(BUILD)/genconfig |
| 25 | |
Andy Bavier | 3316e60 | 2017-12-20 19:36:00 -0700 | [diff] [blame^] | 26 | |
Zack Williams | e53c9ca | 2017-11-29 16:22:13 -0700 | [diff] [blame] | 27 | CONFIG_CORD_PROFILE_DIR ?= $(CORD)/../cord_profile |
| 28 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 29 | # Milestones/logs paths |
| 30 | M ?= $(BUILD)/milestones |
| 31 | LOGS ?= $(BUILD)/logs |
| 32 | |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 33 | PREP_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 Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 34 | MAAS_MS ?= $(M)/build-maas-images $(M)/maas-prime $(M)/publish-maas-images $(M)/deploy-maas |
| 35 | OPENSTACK_MS ?= $(M)/glance-images $(M)/deploy-openstack $(M)/deploy-computenode $(M)/onboard-openstack |
| 36 | XOS_MS ?= $(M)/docker-images $(M)/core-image $(M)/publish-docker-images $(M)/start-xos $(M)/onboard-profile |
| 37 | ONOS_MS ?= $(M)/build-onos-apps $(M)/publish-onos-apps $(M)/deploy-onos $(M)/deploy-mavenrepo |
Andy Bavier | b36b84e | 2017-08-10 14:46:32 -0700 | [diff] [blame] | 38 | POST_INSTALL_MS ?= $(M)/setup-automation $(M)/setup-ciab-pcu $(M)/compute1-up $(M)/compute2-up $(M)/compute3-up |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 39 | LOCAL_MILESTONES ?= $(M)/local-cord-config $(M)/local-docker-images $(M)/local-core-image $(M)/local-start-xos $(M)/local-onboard-profile |
Zack Williams | e53c9ca | 2017-11-29 16:22:13 -0700 | [diff] [blame] | 40 | ALL_MILESTONES ?= $(PREP_MS) $(MAAS_MS) $(OPENSTACK_MS) $(XOS_MS) $(ONOS_MS) $(POST_INSTALL_MS) $(LOCAL_MILESTONES) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 41 | |
| 42 | # Configuration files |
| 43 | MASTER_CONFIG ?= $(GENCONFIG_D)/config.yml |
| 44 | MAKEFILE_CONFIG ?= $(GENCONFIG_D)/config.mk |
| 45 | INVENTORY ?= $(GENCONFIG_D)/inventory.ini |
| 46 | PROFILE_NAME_F ?= $(GENCONFIG_D)/cord_profile |
| 47 | SCENARIO_NAME_F ?= $(GENCONFIG_D)/cord_scenario |
| 48 | |
| 49 | CONFIG_FILES = $(MASTER_CONFIG) $(MAKEFILE_CONFIG) $(INVENTORY) $(PROFILE_NAME_F) $(SCENARIO_NAME_F) |
| 50 | |
| 51 | include $(MAKEFILE_CONFIG) |
| 52 | |
| 53 | # Set using files from genconfig |
| 54 | SCENARIO = $(shell cat $(SCENARIO_NAME_F)) |
| 55 | PROFILE = $(shell cat $(PROFILE_NAME_F)) |
| 56 | |
| 57 | # Host names for SSH commands |
| 58 | BUILDNODE ?= head1 |
| 59 | HEADNODE ?= ${BUILDNODE} |
| 60 | |
| 61 | # Vagrant config |
| 62 | VAGRANT_PROVIDER ?= libvirt |
| 63 | VAGRANT_VMS ?= $(HEADNODE) |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 64 | VAGRANT_SWITCHES ?= leaf1 |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 65 | VAGRANT_CWD ?= $(SCENARIOS_D)/$(SCENARIO)/ |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 66 | |
Luca Prete | dcac43b | 2017-09-14 14:35:13 -0700 | [diff] [blame] | 67 | # Virsh config |
| 68 | VIRSH_CORDDEV_DOMAIN ?= cord_corddev |
| 69 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 70 | # Ansible args, for verbosity and other runtime parameters |
| 71 | ANSIBLE_ARGS ?= |
Zack Williams | f87ef6e | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 72 | EXTRA_VARS ?= --extra-vars "@/opt/cord_profile/genconfig/config.yml" |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 73 | |
| 74 | # Commands |
| 75 | SHELL = bash -o pipefail |
| 76 | VAGRANT ?= VAGRANT_CWD=$(VAGRANT_CWD) vagrant |
| 77 | ANSIBLE ?= ansible -i $(INVENTORY) |
| 78 | ANSIBLE_PB ?= ansible-playbook $(ANSIBLE_ARGS) -i $(INVENTORY) --extra-vars @$(MASTER_CONFIG) |
Zack Williams | f87ef6e | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 79 | ANSIBLE_PB_LOCAL ?= ansible-playbook $(ANSIBLE_ARGS) -i $(PI)/inventory/head-localhost $(EXTRA_VARS) |
| 80 | ANSIBLE_PB_MAAS ?= ansible-playbook $(ANSIBLE_ARGS) -i /etc/maas/ansible/pod-inventory $(EXTRA_VARS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 81 | IMAGEBUILDER ?= python $(BUILD)/scripts/imagebuilder.py |
| 82 | LOGCMD ?= 2>&1 | tee -a $(LOGS)/$(TS)_$(@F) |
| 83 | SSH_HEAD ?= ssh $(HEADNODE) |
| 84 | SSH_BUILD ?= ssh $(BUILDNODE) |
| 85 | |
| 86 | # default target, prints help |
| 87 | .DEFAULT: help |
| 88 | |
| 89 | help: |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 90 | @echo "Please specify a target (config, build, ...)" |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 91 | |
| 92 | # Config file generation |
Zack Williams | d3a527c | 2017-09-13 12:24:57 -0700 | [diff] [blame] | 93 | config: $(CONFIG_FILES) |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 94 | @echo "" |
| 95 | @echo "CORD is configured with profile: '$(PROFILE)', scenario: '$(SCENARIO)'" |
| 96 | @echo "Run 'make -j4 build' to continue." |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 97 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 98 | $(CONFIG_FILES): |
Zack Williams | d3a527c | 2017-09-13 12:24:57 -0700 | [diff] [blame] | 99 | test -e "$(PODCONFIG_PATH)" || { echo "PODCONFIG file $(PODCONFIG_PATH) doesn't exist!" ; exit 1; } |
Andy Bavier | 3316e60 | 2017-12-20 19:36:00 -0700 | [diff] [blame^] | 100 | 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 Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 101 | |
Zack Williams | d3a527c | 2017-09-13 12:24:57 -0700 | [diff] [blame] | 102 | printconfig: |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 103 | @echo "Scenario: '$(SCENARIO)'" |
| 104 | @echo "Profile: '$(PROFILE)'" |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 105 | |
Zack Williams | f87ef6e | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 106 | # == 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 Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 109 | build: $(BUILD_TARGETS) |
| 110 | |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 111 | # Utility targets |
Zack Williams | a5fcefd | 2017-07-27 22:06:33 -0700 | [diff] [blame] | 112 | ansible-ping: |
| 113 | $(ANSIBLE) -m ping all $(LOGCMD) |
| 114 | |
| 115 | ansible-setup: |
| 116 | $(ANSIBLE) -m setup all $(LOGCMD) |
| 117 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 118 | clean-images: |
Zack Williams | 9d0b627 | 2017-09-21 16:43:39 -0700 | [diff] [blame] | 119 | 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 Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 120 | |
| 121 | clean-genconfig: |
| 122 | rm -f $(CONFIG_FILES) |
| 123 | |
| 124 | clean-profile: |
Zack Williams | 93ae638 | 2017-10-04 16:31:06 -0700 | [diff] [blame] | 125 | rm -rf $(CONFIG_CORD_PROFILE_DIR)/* |
Zack Williams | d3a527c | 2017-09-13 12:24:57 -0700 | [diff] [blame] | 126 | rm -f $(M)/cord-config $(M)/copy-config $(M)/onboard-profile $(M)/local-onboard-profile $(M)/onboard-openstack $(M)/refresh-fabric |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 127 | |
Luca Prete | dcac43b | 2017-09-14 14:35:13 -0700 | [diff] [blame] | 128 | clean-all: virsh-domain-destroy vagrant-destroy clean-profile clean-genconfig |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 129 | rm -f $(ALL_MILESTONES) |
| 130 | |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 131 | clean-onos: |
Zack Williams | 9d0b627 | 2017-09-21 16:43:39 -0700 | [diff] [blame] | 132 | $(ANSIBLE_PB) $(PI)/teardown-onos-playbook.yml $(LOGCMD) |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 133 | rm -f $(M)/deploy-onos $(M)/onos-debug |
| 134 | |
| 135 | clean-openstack: |
| 136 | $(SSH_HEAD) "/opt/cord/build/platform-install/scripts/clean_openstack.sh" $(LOGCMD) |
| 137 | rm -f $(M)/onboard-openstack |
| 138 | |
| 139 | collect-diag: |
| 140 | $(ANSIBLE_PB) $(PI)/collect-diag-playbook.yml $(LOGCMD) |
| 141 | |
| 142 | compute-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 Williams | 2b26e56 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 145 | vagrant-destroy: |
Zack Williams | 75a1df3 | 2017-11-14 14:48:45 -0700 | [diff] [blame] | 146 | $(VAGRANT) destroy -f $(LOGCMD) || true |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 147 | rm -f $(M)/vagrant-up $(M)/vagrant-ssh-install $(VAGRANT_SSH_CONF) |
Zack Williams | 2b26e56 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 148 | |
Luca Prete | dcac43b | 2017-09-14 14:35:13 -0700 | [diff] [blame] | 149 | virsh-domain-destroy: |
| 150 | virsh destroy ${VIRSH_CORDDEV_DOMAIN} || true |
| 151 | virsh undefine ${VIRSH_CORDDEV_DOMAIN} || true |
| 152 | |
Zack Williams | 2b26e56 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 153 | xos-teardown: xos-update-images |
Zack Williams | 9d0b627 | 2017-09-21 16:43:39 -0700 | [diff] [blame] | 154 | $(ANSIBLE_PB) $(PI)/teardown-xos-playbook.yml $(LOGCMD) |
Zack Williams | e53c9ca | 2017-11-29 16:22:13 -0700 | [diff] [blame] | 155 | rm -f $(M)/onboard-profile |
Zack Williams | 2b26e56 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 156 | |
| 157 | xos-update-images: clean-images |
| 158 | rm -f $(M)/start-xos $(M)/local-start-xos |
| 159 | |
Zack Williams | e53c9ca | 2017-11-29 16:22:13 -0700 | [diff] [blame] | 160 | # local scenario helpers |
| 161 | clean-local: local-xos-teardown clean-profile clean-genconfig clean-images |
| 162 | rm -f $(LOCAL_MILESTONES) |
| 163 | |
| 164 | local-ubuntu-dev-env: |
| 165 | $(ANSIBLE_PB) $(PI)/bootstrap-dev-env.yml $(LOGCMD) |
| 166 | |
| 167 | local-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 |
| 173 | docs: |
| 174 | cd docs; make |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 175 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 176 | # == PREREQS == # |
Zack Williams | 8845ee5 | 2017-10-04 23:13:26 -0700 | [diff] [blame] | 177 | VAGRANT_UP_PREREQS ?= |
| 178 | COPY_CORD_PREREQS ?= |
| 179 | CORD_CONFIG_PREREQS ?= |
Zack Williams | 39c9aa9 | 2017-10-17 08:35:00 -0700 | [diff] [blame] | 180 | CONFIG_SSH_KEY_PREREQS ?= |
Zack Williams | 8845ee5 | 2017-10-04 23:13:26 -0700 | [diff] [blame] | 181 | PREP_BUILDNODE_PREREQS ?= |
| 182 | PREP_HEADNODE_PREREQS ?= |
| 183 | DOCKER_IMAGES_PREREQS ?= |
| 184 | START_XOS_PREREQS ?= |
| 185 | BUILD_ONOS_APPS_PREREQS ?= |
| 186 | DEPLOY_ONOS_PREREQS ?= |
Andy Bavier | afaa530 | 2017-08-15 08:56:15 -0700 | [diff] [blame] | 187 | DEPLOY_MAVENREPO_PREREQS ?= |
Zack Williams | f87ef6e | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 188 | DEPLOY_OPENSTACK_PREREQS ?= |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 189 | SETUP_AUTOMATION_PREREQS ?= |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 190 | |
Zack Williams | f87ef6e | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 191 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 192 | # == MILESTONES == # |
| 193 | # empty target files are touched in the milestones dir to indicate completion |
| 194 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 195 | # Prep targets |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 196 | $(M)/prereqs-check: |
| 197 | $(ANSIBLE_PB) $(PI)/prereqs-check-playbook.yml $(LOGCMD) |
| 198 | touch $@ |
| 199 | |
Andy Bavier | afaa530 | 2017-08-15 08:56:15 -0700 | [diff] [blame] | 200 | $(M)/build-local-bootstrap: |
| 201 | $(ANSIBLE_PB) $(BUILD)/ansible/build-local-bootstrap.yml $(LOGCMD) |
| 202 | touch $@ |
| 203 | |
Andy Bavier | b36b84e | 2017-08-10 14:46:32 -0700 | [diff] [blame] | 204 | $(M)/ciab-ovs: |
| 205 | $(ANSIBLE_PB) $(BUILD)/ansible/ciab-ovs.yml $(LOGCMD) |
| 206 | touch $@ |
| 207 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 208 | $(M)/vagrant-up: | $(VAGRANT_UP_PREREQS) |
| 209 | $(VAGRANT) up $(VAGRANT_VMS) --provider $(VAGRANT_PROVIDER) $(LOGCMD) |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 210 | touch $@ |
| 211 | |
| 212 | $(M)/vagrant-ssh-install: | $(M)/vagrant-up |
Andy Bavier | e6c255f | 2017-09-15 16:13:37 -0700 | [diff] [blame] | 213 | $(VAGRANT) ssh-config $(VAGRANT_VMS) > /tmp/vagrant_ssh_config |
| 214 | $(ANSIBLE_PB) $(BUILD)/ansible/vagrant-ssh-install.yml $(LOGCMD) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 215 | touch $@ |
| 216 | |
Zack Williams | 39c9aa9 | 2017-10-17 08:35:00 -0700 | [diff] [blame] | 217 | $(M)/config-ssh-key: | $(CONFIG_SSH_KEY_PREREQS) |
Zack Williams | 2b26e56 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 218 | $(ANSIBLE_PB) $(BUILD)/ansible/config-ssh-key.yml $(LOGCMD) |
| 219 | touch $@ |
| 220 | |
Zack Williams | f87ef6e | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 221 | $(M)/copy-cord: | $(COPY_CORD_PREREQS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 222 | $(ANSIBLE_PB) $(PI)/copy-cord-playbook.yml $(LOGCMD) |
| 223 | touch $@ |
| 224 | |
Zack Williams | f87ef6e | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 225 | $(M)/cord-config: | $(CORD_CONFIG_PREREQS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 226 | $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD) |
| 227 | cp -r $(GENCONFIG_D) $(CONFIG_CORD_PROFILE_DIR)/genconfig |
| 228 | touch $@ |
| 229 | |
Zack Williams | f87ef6e | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 230 | $(M)/copy-config: | $(M)/cord-config |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 231 | $(ANSIBLE_PB) $(PI)/copy-profile-playbook.yml $(LOGCMD) |
| 232 | touch $@ |
| 233 | |
Zack Williams | f87ef6e | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 234 | $(M)/prep-buildnode: | $(M)/cord-config $(PREP_BUILDNODE_PREREQS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 235 | $(ANSIBLE_PB) $(PI)/prep-buildnode-playbook.yml $(LOGCMD) |
Zack Williams | a5fcefd | 2017-07-27 22:06:33 -0700 | [diff] [blame] | 236 | @echo Waiting 20 seconds to timeout SSH ControlPersist, and so future ansible commands gain docker group membership |
| 237 | sleep 20 |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 238 | touch $@ |
| 239 | |
Zack Williams | f87ef6e | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 240 | $(M)/prep-headnode: | $(M)/cord-config $(PREP_HEADNODE_PREREQS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 241 | $(ANSIBLE_PB) $(PI)/prep-headnode-playbook.yml $(LOGCMD) |
| 242 | touch $@ |
| 243 | |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 244 | $(M)/deploy-elasticstack: | $(M)/prep-headnode |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 245 | $(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 Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 252 | |
| 253 | # MaaS targets |
| 254 | $(M)/build-maas-images: | $(M)/prep-buildnode $(BUILD_MAAS_IMAGES_PREREQS) |
Andy Bavier | afaa530 | 2017-08-15 08:56:15 -0700 | [diff] [blame] | 255 | $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build/maas; rm -f consul.image; make MAKE_CONFIG=../$(MAKEFILE_CONFIG) build" $(LOGCMD) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 256 | touch $@ |
| 257 | |
Andy Bavier | 21e4fe4 | 2017-09-29 10:27:12 -0700 | [diff] [blame] | 258 | $(M)/maas-prime: | $(M)/prep-headnode |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 259 | $(ANSIBLE_PB) $(MAAS)/prime-node.yml $(LOGCMD) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 260 | touch $@ |
| 261 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 262 | $(M)/publish-maas-images: | $(M)/maas-prime $(M)/build-maas-images |
Andy Bavier | 0941047 | 2017-08-15 14:29:35 -0700 | [diff] [blame] | 263 | $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build/maas; rm -f consul.publish; make MAKE_CONFIG=../$(MAKEFILE_CONFIG) publish" $(LOGCMD) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 264 | touch $@ |
| 265 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 266 | $(M)/deploy-maas: | $(M)/publish-maas-images $(M)/cord-config $(M)/copy-config |
| 267 | $(ANSIBLE_PB) $(MAAS)/head-node.yml $(LOGCMD) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 268 | touch $@ |
| 269 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 270 | |
| 271 | # ONOS targets |
Zack Williams | 5e039f0 | 2017-11-16 09:50:09 -0700 | [diff] [blame] | 272 | $(M)/deploy-mavenrepo: | $(M)/docker-images $(DEPLOY_MAVENREPO_PREREQS) |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 273 | $(ANSIBLE_PB) $(PI)/deploy-mavenrepo-playbook.yml $(LOGCMD) |
| 274 | touch $@ |
| 275 | |
Zack Williams | 8845ee5 | 2017-10-04 23:13:26 -0700 | [diff] [blame] | 276 | $(M)/deploy-onos: | $(M)/docker-images $(M)/deploy-mavenrepo $(DEPLOY_ONOS_PREREQS) |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 277 | $(ANSIBLE_PB) $(PI)/deploy-onos-playbook.yml $(LOGCMD) |
| 278 | touch $@ |
| 279 | |
Zack Williams | 58e4157 | 2017-09-29 07:57:14 -0700 | [diff] [blame] | 280 | $(M)/onos-debug: | $(M)/onboard-profile $(M)/deploy-onos |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 281 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onos-debug-playbook.yml" $(LOGCMD) |
| 282 | touch $@ |
| 283 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 284 | |
| 285 | # XOS targets |
Zack Williams | a5fcefd | 2017-07-27 22:06:33 -0700 | [diff] [blame] | 286 | $(M)/docker-images: | $(M)/prep-buildnode $(DOCKER_IMAGES_PREREQS) |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 287 | $(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 Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 288 | touch $@ |
| 289 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 290 | $(M)/core-image: | $(M)/docker-images |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 291 | $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD) |
| 292 | touch $@ |
| 293 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 294 | # Requires ib_actions.yml file which is on the build host |
Andy Bavier | 61dc81a | 2017-08-23 15:29:45 -0700 | [diff] [blame] | 295 | $(M)/publish-docker-images: | $(M)/deploy-maas $(M)/docker-images $(M)/core-image |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 296 | $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build; $(ANSIBLE_PB_LOCAL) $(PI)/publish-images-playbook.yml" $(LOGCMD) |
| 297 | touch $@ |
| 298 | |
Zack Williams | 49995e6 | 2017-10-06 12:46:08 -0700 | [diff] [blame] | 299 | $(M)/start-xos: | $(M)/prep-headnode $(M)/cord-config $(M)/core-image $(START_XOS_PREREQS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 300 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/start-xos-playbook.yml" $(LOGCMD) |
| 301 | touch $@ |
| 302 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 303 | $(M)/onboard-profile: | $(M)/start-xos |
| 304 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-profile-playbook.yml" $(LOGCMD) |
Zack Williams | 2f56eee | 2017-07-17 09:59:16 -0700 | [diff] [blame] | 305 | touch $@ |
| 306 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 307 | |
| 308 | # OpenStack targets |
| 309 | $(M)/glance-images: | $(M)/prep-headnode |
| 310 | $(ANSIBLE_PB) $(PI)/glance-images-playbook.yml $(LOGCMD) |
| 311 | touch $@ |
| 312 | |
Andy Bavier | 21e4fe4 | 2017-09-29 10:27:12 -0700 | [diff] [blame] | 313 | $(M)/deploy-openstack: | $(M)/prep-headnode $(M)/prep-computenode $(DEPLOY_OPENSTACK_PREREQS) |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 314 | $(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 Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 319 | 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 Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 325 | |
| 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 Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 333 | $(M)/setup-ciab-pcu: | $(M)/setup-automation |
| 334 | $(ANSIBLE_PB) $(MAAS)/setup-ciab-pcu.yml |
| 335 | touch $@ |
| 336 | |
Andy Bavier | b36b84e | 2017-08-10 14:46:32 -0700 | [diff] [blame] | 337 | $(M)/compute%-up: | $(M)/setup-ciab-pcu |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 338 | $(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 Bavier | b36b84e | 2017-08-10 14:46:32 -0700 | [diff] [blame] | 342 | $(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 Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 346 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 347 | # Testing targets |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 348 | pod-test: $(M)/setup-automation collect-diag |
| 349 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/pod-test-playbook.yml" $(LOGCMD) |
| 350 | |
Andy Bavier | 6fb9a3e | 2017-10-17 10:48:41 -0700 | [diff] [blame] | 351 | mcord-test: $(M)/setup-automation |
| 352 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-test-playbook.yml" $(LOGCMD) |
| 353 | |
Andy Bavier | f6b008d | 2017-10-24 06:06:01 -0700 | [diff] [blame] | 354 | mcord-spirent-test: $(M)/setup-automation |
| 355 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-spirent-test-playbook.yml" $(LOGCMD) |
| 356 | |
Andy Bavier | 5e62544 | 2017-11-29 13:42:37 -0700 | [diff] [blame] | 357 | mcord-ng40-test: $(M)/setup-automation |
| 358 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-ng40-test-playbook.yml" $(LOGCMD) |
Andy Bavier | 2eb3cac | 2017-11-17 08:52:31 -0700 | [diff] [blame] | 359 | |
Andy Bavier | b36b84e | 2017-08-10 14:46:32 -0700 | [diff] [blame] | 360 | fabric-pingtest: $(M)/refresh-fabric |
| 361 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) $(PI)/cord-fabric-pingtest.yml" $(LOGCMD) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 362 | |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 363 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 364 | # Local Targets, bring up XOS containers without a VM |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 365 | $(M)/local-cord-config: |
| 366 | $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD) |
| 367 | touch $@ |
| 368 | |
| 369 | $(M)/local-docker-images: | $(M)/local-cord-config |
| 370 | $(IMAGEBUILDER) -f $(MASTER_CONFIG) -l $(BUILD)/image_logs -g $(BUILD)/ib_graph.dot -a $(BUILD)/ib_actions.yml $(LOGCMD) |
| 371 | touch $@ |
| 372 | |
| 373 | $(M)/local-core-image: | $(M)/local-docker-images |
| 374 | $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD) |
| 375 | touch $@ |
| 376 | |
| 377 | $(M)/local-start-xos: | $(M)/local-core-image |
| 378 | $(ANSIBLE_PB) $(PI)/start-xos-playbook.yml $(LOGCMD) |
| 379 | touch $@ |
| 380 | |
| 381 | $(M)/local-onboard-profile: | $(M)/local-start-xos |
| 382 | $(ANSIBLE_PB) $(PI)/onboard-profile-playbook.yml $(LOGCMD) |
| 383 | touch $@ |
| 384 | |