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 |
| 17 | PODCONFIG_D ?= $(BUILD)/podconfig |
| 18 | PODCONFIG_PATH ?= $(PODCONFIG_D)/$(PODCONFIG) |
| 19 | |
| 20 | SCENARIOS_D ?= $(BUILD)/scenarios |
| 21 | GENCONFIG_D ?= $(BUILD)/genconfig |
| 22 | |
Zack Williams | ade8096 | 2017-11-29 16:22:13 -0700 | [diff] [blame] | 23 | CONFIG_CORD_PROFILE_DIR ?= $(CORD)/../cord_profile |
| 24 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 25 | # Milestones/logs paths |
| 26 | M ?= $(BUILD)/milestones |
| 27 | LOGS ?= $(BUILD)/logs |
| 28 | |
Zack Williams | a57ea8c | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 29 | 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] | 30 | MAAS_MS ?= $(M)/build-maas-images $(M)/maas-prime $(M)/publish-maas-images $(M)/deploy-maas |
| 31 | OPENSTACK_MS ?= $(M)/glance-images $(M)/deploy-openstack $(M)/deploy-computenode $(M)/onboard-openstack |
| 32 | XOS_MS ?= $(M)/docker-images $(M)/core-image $(M)/publish-docker-images $(M)/start-xos $(M)/onboard-profile |
| 33 | 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] | 34 | 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] | 35 | LOCAL_MILESTONES ?= $(M)/local-cord-config $(M)/local-docker-images $(M)/local-core-image $(M)/local-start-xos $(M)/local-onboard-profile |
Zack Williams | ade8096 | 2017-11-29 16:22:13 -0700 | [diff] [blame] | 36 | 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] | 37 | |
| 38 | # Configuration files |
| 39 | MASTER_CONFIG ?= $(GENCONFIG_D)/config.yml |
| 40 | MAKEFILE_CONFIG ?= $(GENCONFIG_D)/config.mk |
| 41 | INVENTORY ?= $(GENCONFIG_D)/inventory.ini |
| 42 | PROFILE_NAME_F ?= $(GENCONFIG_D)/cord_profile |
| 43 | SCENARIO_NAME_F ?= $(GENCONFIG_D)/cord_scenario |
| 44 | |
| 45 | CONFIG_FILES = $(MASTER_CONFIG) $(MAKEFILE_CONFIG) $(INVENTORY) $(PROFILE_NAME_F) $(SCENARIO_NAME_F) |
| 46 | |
| 47 | include $(MAKEFILE_CONFIG) |
| 48 | |
| 49 | # Set using files from genconfig |
| 50 | SCENARIO = $(shell cat $(SCENARIO_NAME_F)) |
| 51 | PROFILE = $(shell cat $(PROFILE_NAME_F)) |
| 52 | |
| 53 | # Host names for SSH commands |
| 54 | BUILDNODE ?= head1 |
| 55 | HEADNODE ?= ${BUILDNODE} |
| 56 | |
| 57 | # Vagrant config |
| 58 | VAGRANT_PROVIDER ?= libvirt |
| 59 | VAGRANT_VMS ?= $(HEADNODE) |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 60 | VAGRANT_SWITCHES ?= leaf1 |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 61 | VAGRANT_CWD ?= $(SCENARIOS_D)/$(SCENARIO)/ |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 62 | |
Luca Prete | 7849a98 | 2017-09-14 14:35:13 -0700 | [diff] [blame] | 63 | # Virsh config |
| 64 | VIRSH_CORDDEV_DOMAIN ?= cord_corddev |
| 65 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 66 | # Ansible args, for verbosity and other runtime parameters |
| 67 | ANSIBLE_ARGS ?= |
Zack Williams | 63dd02f | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 68 | EXTRA_VARS ?= --extra-vars "@/opt/cord_profile/genconfig/config.yml" |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 69 | |
| 70 | # Commands |
| 71 | SHELL = bash -o pipefail |
| 72 | VAGRANT ?= VAGRANT_CWD=$(VAGRANT_CWD) vagrant |
| 73 | ANSIBLE ?= ansible -i $(INVENTORY) |
| 74 | ANSIBLE_PB ?= ansible-playbook $(ANSIBLE_ARGS) -i $(INVENTORY) --extra-vars @$(MASTER_CONFIG) |
Zack Williams | 63dd02f | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 75 | ANSIBLE_PB_LOCAL ?= ansible-playbook $(ANSIBLE_ARGS) -i $(PI)/inventory/head-localhost $(EXTRA_VARS) |
| 76 | 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] | 77 | IMAGEBUILDER ?= python $(BUILD)/scripts/imagebuilder.py |
| 78 | LOGCMD ?= 2>&1 | tee -a $(LOGS)/$(TS)_$(@F) |
| 79 | SSH_HEAD ?= ssh $(HEADNODE) |
| 80 | SSH_BUILD ?= ssh $(BUILDNODE) |
| 81 | |
| 82 | # default target, prints help |
| 83 | .DEFAULT: help |
| 84 | |
| 85 | help: |
Zack Williams | a57ea8c | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 86 | @echo "Please specify a target (config, build, ...)" |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 87 | |
| 88 | # Config file generation |
Zack Williams | 9fe0933 | 2017-09-13 12:24:57 -0700 | [diff] [blame] | 89 | config: $(CONFIG_FILES) |
Zack Williams | a57ea8c | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 90 | @echo "" |
| 91 | @echo "CORD is configured with profile: '$(PROFILE)', scenario: '$(SCENARIO)'" |
| 92 | @echo "Run 'make -j4 build' to continue." |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 93 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 94 | $(CONFIG_FILES): |
Zack Williams | 9fe0933 | 2017-09-13 12:24:57 -0700 | [diff] [blame] | 95 | test -e "$(PODCONFIG_PATH)" || { echo "PODCONFIG file $(PODCONFIG_PATH) doesn't exist!" ; exit 1; } |
Zack Williams | 89bac2d | 2017-11-20 23:02:11 -0700 | [diff] [blame] | 96 | 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 Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 97 | |
Zack Williams | 9fe0933 | 2017-09-13 12:24:57 -0700 | [diff] [blame] | 98 | printconfig: |
Zack Williams | a57ea8c | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 99 | @echo "Scenario: '$(SCENARIO)'" |
| 100 | @echo "Profile: '$(PROFILE)'" |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 101 | |
Zack Williams | 63dd02f | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 102 | # == 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 Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 105 | build: $(BUILD_TARGETS) |
| 106 | |
Zack Williams | a57ea8c | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 107 | # Utility targets |
Zack Williams | a5fcefd | 2017-07-27 22:06:33 -0700 | [diff] [blame] | 108 | ansible-ping: |
| 109 | $(ANSIBLE) -m ping all $(LOGCMD) |
| 110 | |
| 111 | ansible-setup: |
| 112 | $(ANSIBLE) -m setup all $(LOGCMD) |
| 113 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 114 | clean-images: |
Zack Williams | 09922ff | 2017-09-21 16:43:39 -0700 | [diff] [blame] | 115 | 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] | 116 | |
| 117 | clean-genconfig: |
| 118 | rm -f $(CONFIG_FILES) |
| 119 | |
| 120 | clean-profile: |
Zack Williams | f2e9a10 | 2017-10-04 16:31:06 -0700 | [diff] [blame] | 121 | rm -rf $(CONFIG_CORD_PROFILE_DIR)/* |
Zack Williams | 9fe0933 | 2017-09-13 12:24:57 -0700 | [diff] [blame] | 122 | 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] | 123 | |
Luca Prete | 7849a98 | 2017-09-14 14:35:13 -0700 | [diff] [blame] | 124 | clean-all: virsh-domain-destroy vagrant-destroy clean-profile clean-genconfig |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 125 | rm -f $(ALL_MILESTONES) |
| 126 | |
Zack Williams | a57ea8c | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 127 | clean-onos: |
Zack Williams | 09922ff | 2017-09-21 16:43:39 -0700 | [diff] [blame] | 128 | $(ANSIBLE_PB) $(PI)/teardown-onos-playbook.yml $(LOGCMD) |
Zack Williams | a57ea8c | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 129 | rm -f $(M)/deploy-onos $(M)/onos-debug |
| 130 | |
| 131 | clean-openstack: |
| 132 | $(SSH_HEAD) "/opt/cord/build/platform-install/scripts/clean_openstack.sh" $(LOGCMD) |
| 133 | rm -f $(M)/onboard-openstack |
| 134 | |
| 135 | collect-diag: |
| 136 | $(ANSIBLE_PB) $(PI)/collect-diag-playbook.yml $(LOGCMD) |
| 137 | |
| 138 | compute-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 Williams | 9c4ef85 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 141 | vagrant-destroy: |
gopinath | c12a7e6 | 2017-09-06 11:53:01 -0700 | [diff] [blame] | 142 | $(VAGRANT) destroy -f $(LOGCMD) |
Zack Williams | a57ea8c | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 143 | rm -f $(M)/vagrant-up $(M)/vagrant-ssh-install $(VAGRANT_SSH_CONF) |
Zack Williams | 9c4ef85 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 144 | |
Luca Prete | 7849a98 | 2017-09-14 14:35:13 -0700 | [diff] [blame] | 145 | virsh-domain-destroy: |
| 146 | virsh destroy ${VIRSH_CORDDEV_DOMAIN} || true |
| 147 | virsh undefine ${VIRSH_CORDDEV_DOMAIN} || true |
| 148 | |
Zack Williams | 9c4ef85 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 149 | xos-teardown: xos-update-images |
Zack Williams | 09922ff | 2017-09-21 16:43:39 -0700 | [diff] [blame] | 150 | $(ANSIBLE_PB) $(PI)/teardown-xos-playbook.yml $(LOGCMD) |
Zack Williams | ade8096 | 2017-11-29 16:22:13 -0700 | [diff] [blame] | 151 | rm -f $(M)/onboard-profile |
Zack Williams | 9c4ef85 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 152 | |
| 153 | xos-update-images: clean-images |
| 154 | rm -f $(M)/start-xos $(M)/local-start-xos |
| 155 | |
Zack Williams | ade8096 | 2017-11-29 16:22:13 -0700 | [diff] [blame] | 156 | # local scenario helpers |
| 157 | clean-local: local-xos-teardown clean-profile clean-genconfig clean-images |
| 158 | rm -f $(LOCAL_MILESTONES) |
| 159 | |
| 160 | local-ubuntu-dev-env: |
| 161 | $(ANSIBLE_PB) $(PI)/bootstrap-dev-env.yml $(LOGCMD) |
| 162 | |
| 163 | local-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 |
| 169 | docs: |
| 170 | cd docs; make |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 171 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 172 | # == PREREQS == # |
Zack Williams | ca31922 | 2017-10-04 23:13:26 -0700 | [diff] [blame] | 173 | VAGRANT_UP_PREREQS ?= |
| 174 | COPY_CORD_PREREQS ?= |
| 175 | CORD_CONFIG_PREREQS ?= |
Zack Williams | a138bf7 | 2017-10-17 08:35:00 -0700 | [diff] [blame] | 176 | CONFIG_SSH_KEY_PREREQS ?= |
Zack Williams | ca31922 | 2017-10-04 23:13:26 -0700 | [diff] [blame] | 177 | PREP_BUILDNODE_PREREQS ?= |
| 178 | PREP_HEADNODE_PREREQS ?= |
| 179 | DOCKER_IMAGES_PREREQS ?= |
| 180 | START_XOS_PREREQS ?= |
| 181 | BUILD_ONOS_APPS_PREREQS ?= |
| 182 | DEPLOY_ONOS_PREREQS ?= |
Andy Bavier | afaa530 | 2017-08-15 08:56:15 -0700 | [diff] [blame] | 183 | DEPLOY_MAVENREPO_PREREQS ?= |
Zack Williams | 63dd02f | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 184 | DEPLOY_OPENSTACK_PREREQS ?= |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 185 | SETUP_AUTOMATION_PREREQS ?= |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 186 | |
Zack Williams | 63dd02f | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 187 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 188 | # == MILESTONES == # |
| 189 | # empty target files are touched in the milestones dir to indicate completion |
| 190 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 191 | # Prep targets |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 192 | $(M)/prereqs-check: |
| 193 | $(ANSIBLE_PB) $(PI)/prereqs-check-playbook.yml $(LOGCMD) |
| 194 | touch $@ |
| 195 | |
Andy Bavier | afaa530 | 2017-08-15 08:56:15 -0700 | [diff] [blame] | 196 | $(M)/build-local-bootstrap: |
| 197 | $(ANSIBLE_PB) $(BUILD)/ansible/build-local-bootstrap.yml $(LOGCMD) |
| 198 | touch $@ |
| 199 | |
Andy Bavier | b36b84e | 2017-08-10 14:46:32 -0700 | [diff] [blame] | 200 | $(M)/ciab-ovs: |
| 201 | $(ANSIBLE_PB) $(BUILD)/ansible/ciab-ovs.yml $(LOGCMD) |
| 202 | touch $@ |
| 203 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 204 | $(M)/vagrant-up: | $(VAGRANT_UP_PREREQS) |
| 205 | $(VAGRANT) up $(VAGRANT_VMS) --provider $(VAGRANT_PROVIDER) $(LOGCMD) |
Zack Williams | a57ea8c | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 206 | touch $@ |
| 207 | |
| 208 | $(M)/vagrant-ssh-install: | $(M)/vagrant-up |
Andy Bavier | fd40a12 | 2017-09-15 16:13:37 -0700 | [diff] [blame] | 209 | $(VAGRANT) ssh-config $(VAGRANT_VMS) > /tmp/vagrant_ssh_config |
| 210 | $(ANSIBLE_PB) $(BUILD)/ansible/vagrant-ssh-install.yml $(LOGCMD) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 211 | touch $@ |
| 212 | |
Zack Williams | a138bf7 | 2017-10-17 08:35:00 -0700 | [diff] [blame] | 213 | $(M)/config-ssh-key: | $(CONFIG_SSH_KEY_PREREQS) |
Zack Williams | 9c4ef85 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 214 | $(ANSIBLE_PB) $(BUILD)/ansible/config-ssh-key.yml $(LOGCMD) |
| 215 | touch $@ |
| 216 | |
Zack Williams | 63dd02f | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 217 | $(M)/copy-cord: | $(COPY_CORD_PREREQS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 218 | $(ANSIBLE_PB) $(PI)/copy-cord-playbook.yml $(LOGCMD) |
| 219 | touch $@ |
| 220 | |
Zack Williams | 63dd02f | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 221 | $(M)/cord-config: | $(CORD_CONFIG_PREREQS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 222 | $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD) |
| 223 | cp -r $(GENCONFIG_D) $(CONFIG_CORD_PROFILE_DIR)/genconfig |
| 224 | touch $@ |
| 225 | |
Zack Williams | 63dd02f | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 226 | $(M)/copy-config: | $(M)/cord-config |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 227 | $(ANSIBLE_PB) $(PI)/copy-profile-playbook.yml $(LOGCMD) |
| 228 | touch $@ |
| 229 | |
Zack Williams | 63dd02f | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 230 | $(M)/prep-buildnode: | $(M)/cord-config $(PREP_BUILDNODE_PREREQS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 231 | $(ANSIBLE_PB) $(PI)/prep-buildnode-playbook.yml $(LOGCMD) |
Zack Williams | a5fcefd | 2017-07-27 22:06:33 -0700 | [diff] [blame] | 232 | @echo Waiting 20 seconds to timeout SSH ControlPersist, and so future ansible commands gain docker group membership |
| 233 | sleep 20 |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 234 | touch $@ |
| 235 | |
Zack Williams | 63dd02f | 2017-10-16 22:30:00 -0700 | [diff] [blame] | 236 | $(M)/prep-headnode: | $(M)/cord-config $(PREP_HEADNODE_PREREQS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 237 | $(ANSIBLE_PB) $(PI)/prep-headnode-playbook.yml $(LOGCMD) |
| 238 | touch $@ |
| 239 | |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 240 | $(M)/deploy-elasticstack: | $(M)/prep-headnode |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 241 | $(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 Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 248 | |
| 249 | # MaaS targets |
| 250 | $(M)/build-maas-images: | $(M)/prep-buildnode $(BUILD_MAAS_IMAGES_PREREQS) |
Andy Bavier | afaa530 | 2017-08-15 08:56:15 -0700 | [diff] [blame] | 251 | $(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] | 252 | touch $@ |
| 253 | |
Andy Bavier | 8708921 | 2017-09-29 10:27:12 -0700 | [diff] [blame] | 254 | $(M)/maas-prime: | $(M)/prep-headnode |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 255 | $(ANSIBLE_PB) $(MAAS)/prime-node.yml $(LOGCMD) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 256 | touch $@ |
| 257 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 258 | $(M)/publish-maas-images: | $(M)/maas-prime $(M)/build-maas-images |
Andy Bavier | 0941047 | 2017-08-15 14:29:35 -0700 | [diff] [blame] | 259 | $(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] | 260 | touch $@ |
| 261 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 262 | $(M)/deploy-maas: | $(M)/publish-maas-images $(M)/cord-config $(M)/copy-config |
| 263 | $(ANSIBLE_PB) $(MAAS)/head-node.yml $(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 | |
| 267 | # ONOS targets |
Zack Williams | 0367753 | 2017-11-16 09:50:09 -0700 | [diff] [blame] | 268 | $(M)/deploy-mavenrepo: | $(M)/docker-images $(DEPLOY_MAVENREPO_PREREQS) |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 269 | $(ANSIBLE_PB) $(PI)/deploy-mavenrepo-playbook.yml $(LOGCMD) |
| 270 | touch $@ |
| 271 | |
Zack Williams | ca31922 | 2017-10-04 23:13:26 -0700 | [diff] [blame] | 272 | $(M)/deploy-onos: | $(M)/docker-images $(M)/deploy-mavenrepo $(DEPLOY_ONOS_PREREQS) |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 273 | $(ANSIBLE_PB) $(PI)/deploy-onos-playbook.yml $(LOGCMD) |
| 274 | touch $@ |
| 275 | |
Zack Williams | 7f3cfd4 | 2017-09-29 07:57:14 -0700 | [diff] [blame] | 276 | $(M)/onos-debug: | $(M)/onboard-profile $(M)/deploy-onos |
Zack Williams | a57ea8c | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 277 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onos-debug-playbook.yml" $(LOGCMD) |
| 278 | touch $@ |
| 279 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 280 | |
| 281 | # XOS targets |
Zack Williams | a5fcefd | 2017-07-27 22:06:33 -0700 | [diff] [blame] | 282 | $(M)/docker-images: | $(M)/prep-buildnode $(DOCKER_IMAGES_PREREQS) |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 283 | $(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] | 284 | touch $@ |
| 285 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 286 | $(M)/core-image: | $(M)/docker-images |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 287 | $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD) |
| 288 | touch $@ |
| 289 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 290 | # Requires ib_actions.yml file which is on the build host |
Andy Bavier | 61dc81a | 2017-08-23 15:29:45 -0700 | [diff] [blame] | 291 | $(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] | 292 | $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build; $(ANSIBLE_PB_LOCAL) $(PI)/publish-images-playbook.yml" $(LOGCMD) |
| 293 | touch $@ |
| 294 | |
Zack Williams | b495b71 | 2017-10-06 12:46:08 -0700 | [diff] [blame] | 295 | $(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] | 296 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/start-xos-playbook.yml" $(LOGCMD) |
| 297 | touch $@ |
| 298 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 299 | $(M)/onboard-profile: | $(M)/start-xos |
| 300 | $(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] | 301 | touch $@ |
| 302 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 303 | |
| 304 | # OpenStack targets |
| 305 | $(M)/glance-images: | $(M)/prep-headnode |
| 306 | $(ANSIBLE_PB) $(PI)/glance-images-playbook.yml $(LOGCMD) |
| 307 | touch $@ |
| 308 | |
Andy Bavier | 8708921 | 2017-09-29 10:27:12 -0700 | [diff] [blame] | 309 | $(M)/deploy-openstack: | $(M)/prep-headnode $(M)/prep-computenode $(DEPLOY_OPENSTACK_PREREQS) |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 310 | $(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 Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 315 | 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 Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 321 | |
| 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 Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 329 | $(M)/setup-ciab-pcu: | $(M)/setup-automation |
| 330 | $(ANSIBLE_PB) $(MAAS)/setup-ciab-pcu.yml |
| 331 | touch $@ |
| 332 | |
Andy Bavier | b36b84e | 2017-08-10 14:46:32 -0700 | [diff] [blame] | 333 | $(M)/compute%-up: | $(M)/setup-ciab-pcu |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 334 | $(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 Bavier | b36b84e | 2017-08-10 14:46:32 -0700 | [diff] [blame] | 338 | $(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 Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 342 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 343 | # Testing targets |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 344 | pod-test: $(M)/setup-automation collect-diag |
| 345 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/pod-test-playbook.yml" $(LOGCMD) |
| 346 | |
Andy Bavier | 1b17e6a | 2017-10-17 10:48:41 -0700 | [diff] [blame] | 347 | mcord-test: $(M)/setup-automation |
| 348 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-test-playbook.yml" $(LOGCMD) |
| 349 | |
Andy Bavier | bb747fa | 2017-10-24 06:06:01 -0700 | [diff] [blame] | 350 | mcord-spirent-test: $(M)/setup-automation |
| 351 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-spirent-test-playbook.yml" $(LOGCMD) |
| 352 | |
Andy Bavier | 27ee4c8 | 2017-11-29 13:42:37 -0700 | [diff] [blame] | 353 | mcord-ng40-test: $(M)/setup-automation |
| 354 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/mcord-ng40-test-playbook.yml" $(LOGCMD) |
Andy Bavier | 97990f4 | 2017-11-17 08:52:31 -0700 | [diff] [blame] | 355 | |
Andy Bavier | b36b84e | 2017-08-10 14:46:32 -0700 | [diff] [blame] | 356 | fabric-pingtest: $(M)/refresh-fabric |
| 357 | $(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] | 358 | |
Zack Williams | a57ea8c | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 359 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 360 | # Local Targets, bring up XOS containers without a VM |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 361 | $(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 | |