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 | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 61 | VAGRANT_SSH_CONF ?= $(GENCONFIG_D)/vagrant.ssh_config |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 62 | |
Luca Prete | dcac43b | 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 ?= |
| 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) |
| 74 | ANSIBLE_PB_LOCAL ?= ansible-playbook $(ANSIBLE_ARGS) -i $(PI)/inventory/head-localhost --extra-vars "@/opt/cord_profile/genconfig/config.yml" |
| 75 | ANSIBLE_PB_MAAS ?= ansible-playbook $(ANSIBLE_ARGS) -i /etc/maas/ansible/pod-inventory --extra-vars "@/opt/cord_profile/genconfig/config.yml" |
| 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 | |
| 101 | # Primary Targets |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 102 | build: $(BUILD_TARGETS) |
| 103 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 104 | |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 105 | # Utility targets |
Zack Williams | a5fcefd | 2017-07-27 22:06:33 -0700 | [diff] [blame] | 106 | ansible-ping: |
| 107 | $(ANSIBLE) -m ping all $(LOGCMD) |
| 108 | |
| 109 | ansible-setup: |
| 110 | $(ANSIBLE) -m setup all $(LOGCMD) |
| 111 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 112 | clean-images: |
Andy Bavier | 218bed3 | 2017-09-01 13:23:20 -0700 | [diff] [blame] | 113 | rm -f $(M)/docker-images $(M)/local-docker-images $(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] | 114 | |
| 115 | clean-genconfig: |
| 116 | rm -f $(CONFIG_FILES) |
| 117 | |
| 118 | clean-profile: |
| 119 | rm -rf $(CONFIG_CORD_PROFILE_DIR) |
Zack Williams | d3a527c | 2017-09-13 12:24:57 -0700 | [diff] [blame] | 120 | 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] | 121 | |
Luca Prete | dcac43b | 2017-09-14 14:35:13 -0700 | [diff] [blame] | 122 | clean-all: virsh-domain-destroy vagrant-destroy clean-profile clean-genconfig |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 123 | rm -f $(ALL_MILESTONES) |
| 124 | |
| 125 | clean-local: clean-profile clean-genconfig |
| 126 | rm -f $(LOCAL_MILESTONES) |
| 127 | |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 128 | clean-onos: |
| 129 | $(ANSIBLE_PB) $(PI)/teardown-onos.yml $(LOGCMD) |
| 130 | rm -f $(M)/deploy-onos $(M)/onos-debug |
| 131 | |
| 132 | clean-openstack: |
| 133 | $(SSH_HEAD) "/opt/cord/build/platform-install/scripts/clean_openstack.sh" $(LOGCMD) |
| 134 | rm -f $(M)/onboard-openstack |
| 135 | |
| 136 | collect-diag: |
| 137 | $(ANSIBLE_PB) $(PI)/collect-diag-playbook.yml $(LOGCMD) |
| 138 | |
| 139 | compute-node-refresh: |
| 140 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) --private-key ~/.ssh/cord_rsa $(PI)/compute-node-refresh-playbook.yml" $(LOGCMD) |
| 141 | |
Zack Williams | 2b26e56 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 142 | .PHONY: docs |
| 143 | docs: |
| 144 | cd docs; make |
| 145 | |
Andy Bavier | 4dc6647 | 2017-07-18 17:13:24 -0700 | [diff] [blame] | 146 | local-ubuntu-dev-env: |
| 147 | $(ANSIBLE_PB) $(PI)/bootstrap-dev-env.yml $(LOGCMD) |
| 148 | |
Zack Williams | 2b26e56 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 149 | vagrant-destroy: |
gopinath | 1fc1bc7 | 2017-09-06 11:53:01 -0700 | [diff] [blame] | 150 | $(VAGRANT) destroy -f $(LOGCMD) |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 151 | rm -f $(M)/vagrant-up $(M)/vagrant-ssh-install $(VAGRANT_SSH_CONF) |
Zack Williams | 2b26e56 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 152 | |
Luca Prete | dcac43b | 2017-09-14 14:35:13 -0700 | [diff] [blame] | 153 | virsh-domain-destroy: |
| 154 | virsh destroy ${VIRSH_CORDDEV_DOMAIN} || true |
| 155 | virsh undefine ${VIRSH_CORDDEV_DOMAIN} || true |
| 156 | |
Zack Williams | 2b26e56 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 157 | xos-teardown: xos-update-images |
| 158 | $(ANSIBLE_PB) $(PI)/teardown-playbook.yml $(LOGCMD) |
| 159 | rm -f $(M)/onboard-profile $(M)/local-onboard-profile |
| 160 | |
| 161 | xos-update-images: clean-images |
| 162 | rm -f $(M)/start-xos $(M)/local-start-xos |
| 163 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 164 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 165 | # == PREREQS == # |
| 166 | VAGRANT_UP_PREREQS ?= |
Zack Williams | 2b26e56 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 167 | COPY_CORD_PREREQS ?= |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 168 | CORD_CONFIG_PREREQS ?= |
| 169 | COPY_CONFIG_PREREQS ?= |
| 170 | PREP_BUILDNODE_PREREQS ?= |
| 171 | PREP_HEADNODE_PREREQS ?= |
Zack Williams | a5fcefd | 2017-07-27 22:06:33 -0700 | [diff] [blame] | 172 | DOCKER_IMAGES_PREREQS ?= |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 173 | START_XOS_PREREQS ?= |
| 174 | DEPLOY_ONOS_PREREQS ?= |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 175 | DEPLOY_OPENSTACK_PREREQS ?= |
Andy Bavier | afaa530 | 2017-08-15 08:56:15 -0700 | [diff] [blame] | 176 | DEPLOY_MAVENREPO_PREREQS ?= |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 177 | SETUP_AUTOMATION_PREREQS ?= |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 178 | |
| 179 | # == MILESTONES == # |
| 180 | # empty target files are touched in the milestones dir to indicate completion |
| 181 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 182 | # Prep targets |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 183 | $(M)/prereqs-check: |
| 184 | $(ANSIBLE_PB) $(PI)/prereqs-check-playbook.yml $(LOGCMD) |
| 185 | touch $@ |
| 186 | |
Andy Bavier | afaa530 | 2017-08-15 08:56:15 -0700 | [diff] [blame] | 187 | $(M)/build-local-bootstrap: |
| 188 | $(ANSIBLE_PB) $(BUILD)/ansible/build-local-bootstrap.yml $(LOGCMD) |
| 189 | touch $@ |
| 190 | |
Andy Bavier | b36b84e | 2017-08-10 14:46:32 -0700 | [diff] [blame] | 191 | $(M)/ciab-ovs: |
| 192 | $(ANSIBLE_PB) $(BUILD)/ansible/ciab-ovs.yml $(LOGCMD) |
| 193 | touch $@ |
| 194 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 195 | $(M)/vagrant-up: | $(VAGRANT_UP_PREREQS) |
| 196 | $(VAGRANT) up $(VAGRANT_VMS) --provider $(VAGRANT_PROVIDER) $(LOGCMD) |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 197 | touch $@ |
| 198 | |
| 199 | $(M)/vagrant-ssh-install: | $(M)/vagrant-up |
| 200 | $(VAGRANT) ssh-config $(VAGRANT_VMS) > $(VAGRANT_SSH_CONF) $(LOGCMD) |
| 201 | $(BUILD)/scripts/vagrant-ssh-install.sh "$(VAGRANT_SSH_CONF)" "Include $(abspath $(GENCONFIG_D))/*.ssh_config" $(LOGCMD) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 202 | touch $@ |
| 203 | |
Zack Williams | 2b26e56 | 2017-09-05 16:14:04 -0700 | [diff] [blame] | 204 | $(M)/config-ssh-key: | $(M)/vagrant-up |
| 205 | $(ANSIBLE_PB) $(BUILD)/ansible/config-ssh-key.yml $(LOGCMD) |
| 206 | touch $@ |
| 207 | |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 208 | $(M)/copy-cord: | $(M)/vagrant-ssh-install $(COPY_CORD_PREREQS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 209 | $(ANSIBLE_PB) $(PI)/copy-cord-playbook.yml $(LOGCMD) |
| 210 | touch $@ |
| 211 | |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 212 | $(M)/cord-config: | $(M)/vagrant-ssh-install $(CORD_CONFIG_PREREQS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 213 | $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD) |
| 214 | cp -r $(GENCONFIG_D) $(CONFIG_CORD_PROFILE_DIR)/genconfig |
| 215 | touch $@ |
| 216 | |
| 217 | $(M)/copy-config: | $(COPY_CONFIG_PREREQS) |
| 218 | $(ANSIBLE_PB) $(PI)/copy-profile-playbook.yml $(LOGCMD) |
| 219 | touch $@ |
| 220 | |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 221 | $(M)/prep-buildnode: | $(M)/vagrant-ssh-install $(M)/cord-config $(PREP_BUILDNODE_PREREQS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 222 | $(ANSIBLE_PB) $(PI)/prep-buildnode-playbook.yml $(LOGCMD) |
Zack Williams | a5fcefd | 2017-07-27 22:06:33 -0700 | [diff] [blame] | 223 | @echo Waiting 20 seconds to timeout SSH ControlPersist, and so future ansible commands gain docker group membership |
| 224 | sleep 20 |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 225 | touch $@ |
| 226 | |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 227 | $(M)/prep-headnode: | $(M)/vagrant-ssh-install $(M)/cord-config $(PREP_HEADNODE_PREREQS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 228 | $(ANSIBLE_PB) $(PI)/prep-headnode-playbook.yml $(LOGCMD) |
| 229 | touch $@ |
| 230 | |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 231 | $(M)/deploy-elasticstack: | $(M)/prep-headnode |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 232 | $(ANSIBLE_PB) $(PI)/deploy-elasticstack-playbook.yml $(LOGCMD) |
| 233 | touch $@ |
| 234 | |
| 235 | $(M)/prep-computenode: | $(M)/prep-headnode |
| 236 | $(ANSIBLE_PB) $(PI)/prep-computenode-playbook.yml $(LOGCMD) |
| 237 | touch $@ |
| 238 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 239 | |
| 240 | # MaaS targets |
| 241 | $(M)/build-maas-images: | $(M)/prep-buildnode $(BUILD_MAAS_IMAGES_PREREQS) |
Andy Bavier | afaa530 | 2017-08-15 08:56:15 -0700 | [diff] [blame] | 242 | $(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] | 243 | touch $@ |
| 244 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 245 | $(M)/maas-prime: | $(M)/deploy-elasticstack |
| 246 | $(ANSIBLE_PB) $(MAAS)/prime-node.yml $(LOGCMD) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 247 | touch $@ |
| 248 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 249 | $(M)/publish-maas-images: | $(M)/maas-prime $(M)/build-maas-images |
Andy Bavier | 0941047 | 2017-08-15 14:29:35 -0700 | [diff] [blame] | 250 | $(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] | 251 | touch $@ |
| 252 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 253 | $(M)/deploy-maas: | $(M)/publish-maas-images $(M)/cord-config $(M)/copy-config |
| 254 | $(ANSIBLE_PB) $(MAAS)/head-node.yml $(LOGCMD) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 255 | touch $@ |
| 256 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 257 | |
| 258 | # ONOS targets |
| 259 | $(M)/build-onos-apps: | $(M)/prep-buildnode $(BUILD_ONOS_APPS_PREREQS) |
Andy Bavier | afaa530 | 2017-08-15 08:56:15 -0700 | [diff] [blame] | 260 | $(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] | 261 | touch $@ |
| 262 | |
Andy Bavier | 61dc81a | 2017-08-23 15:29:45 -0700 | [diff] [blame] | 263 | $(M)/publish-onos-apps: | $(M)/deploy-maas $(M)/build-onos-apps |
Andy Bavier | afaa530 | 2017-08-15 08:56:15 -0700 | [diff] [blame] | 264 | $(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] | 265 | touch $@ |
| 266 | |
Andy Bavier | afaa530 | 2017-08-15 08:56:15 -0700 | [diff] [blame] | 267 | $(M)/deploy-mavenrepo: | $(M)/publish-onos-apps $(DEPLOY_MAVENREPO_PREREQS) |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 268 | $(ANSIBLE_PB) $(PI)/deploy-mavenrepo-playbook.yml $(LOGCMD) |
| 269 | touch $@ |
| 270 | |
| 271 | $(M)/deploy-onos: | $(M)/docker-images $(DEPLOY_ONOS_PREREQS) |
| 272 | $(ANSIBLE_PB) $(PI)/deploy-onos-playbook.yml $(LOGCMD) |
| 273 | touch $@ |
| 274 | |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 275 | $(M)/onos-debug: | $(M)/onboard-profile |
| 276 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onos-debug-playbook.yml" $(LOGCMD) |
| 277 | touch $@ |
| 278 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 279 | |
| 280 | # XOS targets |
Zack Williams | a5fcefd | 2017-07-27 22:06:33 -0700 | [diff] [blame] | 281 | $(M)/docker-images: | $(M)/prep-buildnode $(DOCKER_IMAGES_PREREQS) |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 282 | $(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] | 283 | touch $@ |
| 284 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 285 | $(M)/core-image: | $(M)/docker-images |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 286 | $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD) |
| 287 | touch $@ |
| 288 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 289 | # Requires ib_actions.yml file which is on the build host |
Andy Bavier | 61dc81a | 2017-08-23 15:29:45 -0700 | [diff] [blame] | 290 | $(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] | 291 | $(SSH_BUILD) "cd $(BUILD_CORD_DIR)/build; $(ANSIBLE_PB_LOCAL) $(PI)/publish-images-playbook.yml" $(LOGCMD) |
| 292 | touch $@ |
| 293 | |
Zack Williams | 0a7ef16 | 2017-07-18 18:15:26 -0700 | [diff] [blame] | 294 | $(M)/start-xos: | $(M)/prep-headnode $(M)/core-image $(START_XOS_PREREQS) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 295 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/start-xos-playbook.yml" $(LOGCMD) |
| 296 | touch $@ |
| 297 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 298 | $(M)/onboard-profile: | $(M)/start-xos |
| 299 | $(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] | 300 | touch $@ |
| 301 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 302 | |
| 303 | # OpenStack targets |
| 304 | $(M)/glance-images: | $(M)/prep-headnode |
| 305 | $(ANSIBLE_PB) $(PI)/glance-images-playbook.yml $(LOGCMD) |
| 306 | touch $@ |
| 307 | |
| 308 | $(M)/deploy-openstack: | $(M)/deploy-elasticstack $(M)/prep-headnode $(M)/prep-computenode $(DEPLOY_OPENSTACK_PREREQS) |
| 309 | $(ANSIBLE_PB) $(PI)/deploy-openstack-playbook.yml $(LOGCMD) |
| 310 | touch $@ |
| 311 | |
| 312 | $(M)/deploy-computenode: | $(M)/deploy-openstack |
| 313 | $(ANSIBLE_PB) $(PI)/deploy-computenode-playbook.yml $(LOGCMD) |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 314 | touch $@ |
| 315 | |
| 316 | $(M)/onboard-openstack: | $(M)/deploy-computenode $(M)/glance-images $(M)/deploy-onos $(M)/onboard-profile |
| 317 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/onboard-openstack-playbook.yml" $(LOGCMD) |
| 318 | touch $@ |
| 319 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 320 | |
| 321 | # Post-onboarding targets |
| 322 | $(M)/setup-automation: | $(M)/onboard-profile $(M)/deploy-onos $(SETUP_AUTOMATION_PREREQS) |
| 323 | $(ANSIBLE_PB) $(PI)/cord-automation-playbook.yml $(LOGCMD) |
| 324 | touch $@ |
| 325 | |
| 326 | |
| 327 | # Additional CiaB targets |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 328 | $(M)/setup-ciab-pcu: | $(M)/setup-automation |
| 329 | $(ANSIBLE_PB) $(MAAS)/setup-ciab-pcu.yml |
| 330 | touch $@ |
| 331 | |
Andy Bavier | b36b84e | 2017-08-10 14:46:32 -0700 | [diff] [blame] | 332 | $(M)/compute%-up: | $(M)/setup-ciab-pcu |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 333 | $(VAGRANT) up compute$* --provider $(VAGRANT_PROVIDER) $(LOGCMD) |
| 334 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) ansible/maas-provision.yml --extra-vars='maas_user=maas vagrant_name=cord_compute$*'" $(LOGCMD) |
| 335 | touch $@ |
| 336 | |
Andy Bavier | b36b84e | 2017-08-10 14:46:32 -0700 | [diff] [blame] | 337 | $(M)/refresh-fabric: | $(M)/compute1-up |
| 338 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_MAAS) $(PI)/cord-refresh-fabric.yml" $(LOGCMD) |
| 339 | touch $@ |
| 340 | |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 341 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 342 | # Testing targets |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 343 | pod-test: $(M)/setup-automation collect-diag |
| 344 | $(SSH_HEAD) "cd /opt/cord/build; $(ANSIBLE_PB_LOCAL) $(PI)/pod-test-playbook.yml" $(LOGCMD) |
| 345 | |
Andy Bavier | b36b84e | 2017-08-10 14:46:32 -0700 | [diff] [blame] | 346 | fabric-pingtest: $(M)/refresh-fabric |
| 347 | $(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] | 348 | |
Zack Williams | 32295d5 | 2017-08-28 22:49:37 -0700 | [diff] [blame] | 349 | |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 350 | # Local Targets, bring up XOS containers without a VM |
Zack Williams | ce63eb0 | 2017-02-28 10:46:22 -0700 | [diff] [blame] | 351 | $(M)/local-cord-config: |
| 352 | $(ANSIBLE_PB) $(PI)/cord-config-playbook.yml $(LOGCMD) |
| 353 | touch $@ |
| 354 | |
| 355 | $(M)/local-docker-images: | $(M)/local-cord-config |
| 356 | $(IMAGEBUILDER) -f $(MASTER_CONFIG) -l $(BUILD)/image_logs -g $(BUILD)/ib_graph.dot -a $(BUILD)/ib_actions.yml $(LOGCMD) |
| 357 | touch $@ |
| 358 | |
| 359 | $(M)/local-core-image: | $(M)/local-docker-images |
| 360 | $(ANSIBLE_PB) $(PI)/build-core-image-playbook.yml $(LOGCMD) |
| 361 | touch $@ |
| 362 | |
| 363 | $(M)/local-start-xos: | $(M)/local-core-image |
| 364 | $(ANSIBLE_PB) $(PI)/start-xos-playbook.yml $(LOGCMD) |
| 365 | touch $@ |
| 366 | |
| 367 | $(M)/local-onboard-profile: | $(M)/local-start-xos |
| 368 | $(ANSIBLE_PB) $(PI)/onboard-profile-playbook.yml $(LOGCMD) |
| 369 | touch $@ |
| 370 | |