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