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