upgrade: Enable possibility to use predefined requirements archive for upgrade module

* add posibility to pass http_link for tar file, which contain
all needed pips archives for upgrade-module

* add posibility to save artifact, which contain upgrade/deps files from
upgrade-module build process.

Change-Id: Idfc98971fbf72617cb73224f58f94cc484cc6e4e
Closes-Bug: #1475257
This commit is contained in:
alexz 2015-07-16 13:01:12 +03:00 committed by Aleksey Zvyagintsev
parent fa08b52fbd
commit 5bdbc96765
2 changed files with 43 additions and 0 deletions

View File

@ -244,3 +244,22 @@ PRODUCTION?=docker
# Copy local /etc/ssl certs inside SANDBOX, which used for build deb mirror and packages.
# This option should be enabled, in case you have to pass https repos for Ubuntu.
SANDBOX_COPY_CERTS?=0
# Development option only:
# Please dont change them if you dont know what they do ##
# If not empty, will try save "build/upgrade/deps" pip cache from upgrade module only,
# to file $(ARTS_DIR)/$(SAVE_UPGRADE_PIP_ART)
# Example:
# SAVE_UPGRADE_PIP_ART?=fuel-dev.art_pip_from_upg_module.tar.gz
SAVE_UPGRADE_PIP_ART?=
# If not empty, will try to download this archive and use like pip cache
# for creating upgrade module.
# Example:
# USE_UPGRADE_PIP_ART_HTTP_LINK?=http://127.0.0.1/files/deps.pip.tar.gz
# Content example:
# deps.pip.tar.gz:\
# \argparse-1.2.1.tar.gz
# \docker-py-0.3.2.tar.gz
USE_UPGRADE_PIP_ART_HTTP_LINK?=

View File

@ -2,6 +2,7 @@
.DELETE_ON_ERROR: $(UPGRADE_TARBALL_PATH).lrz
.DELETE_ON_ERROR: $(BUILD_DIR)/upgrade/common-part.tar
.DELETE_ON_ERROR: $(BUILD_DIR)/upgrade/openstack-part.tar
.DELETE_ON_ERROR: $(BUILD_DIR)/upgrade/$(SAVE_UPGRADE_PIP_ART)
all: upgrade-lrzip openstack-yaml
@ -40,10 +41,28 @@ $(BUILD_DIR)/upgrade/deps.done: \
mkdir -p $(BUILD_DIR)/upgrade/deps
virtualenv $(BUILD_DIR)/upgrade/venv
# Requires virtualenv, pip, python-dev packages
ifeq ($(USE_UPGRADE_PIP_ART_HTTP_LINK),)
echo "Using mirror pip-install approach"
$(BUILD_DIR)/upgrade/venv/bin/pip install -r $(BUILD_DIR)/repos/nailgun/fuel_upgrade_system/fuel_upgrade/requirements.txt --download $(BUILD_DIR)/upgrade/deps --no-use-wheel
else
echo "Using artifact from $(USE_UPGRADE_PIP_ART_HTTP_LINK) for pip-install"
wget -v --no-check-certificate $(USE_UPGRADE_PIP_ART_HTTP_LINK) -O $(BUILD_DIR)/upgrade/deps.tar.gz.tmp
mv $(BUILD_DIR)/upgrade/deps.tar.gz.tmp $(BUILD_DIR)/upgrade/deps.tar.gz
mkdir -p $(BUILD_DIR)/upgrade/deps/
tar xvf $(BUILD_DIR)/upgrade/deps.tar.gz --strip-components=1 -C $(BUILD_DIR)/upgrade/deps/
endif
cd $(BUILD_DIR)/repos/nailgun/fuel_upgrade_system/fuel_upgrade && $(BUILD_DIR)/upgrade/venv/bin/python setup.py sdist --dist-dir $(BUILD_DIR)/upgrade/deps
$(ACTION.TOUCH)
# Save pip artifact, if needed
$(BUILD_DIR)/upgrade/$(SAVE_UPGRADE_PIP_ART): $(BUILD_DIR)/upgrade/deps.done
mkdir -p $(@D)
rm -f $@
tar czf $@ -C $(BUILD_DIR)/upgrade deps
$(ARTS_DIR)/$(SAVE_UPGRADE_PIP_ART): $(BUILD_DIR)/upgrade/$(SAVE_UPGRADE_PIP_ART)
$(ACTION.COPY)
########################
# COMMON PART
########################
@ -57,6 +76,11 @@ $(BUILD_DIR)/upgrade/common-part.tar: \
tar rf $@ --mode=755 -C $(BUILD_DIR)/upgrade upgrade.sh
tar rf $@ --mode=755 -C $(ARTS_DIR) --xform s:^:upgrade/config/: $(VERSION_YAML_ART_NAME)
ifneq ($(SAVE_UPGRADE_PIP_ART),)
$(BUILD_DIR)/upgrade/common-part.tar: $(ARTS_DIR)/$(SAVE_UPGRADE_PIP_ART)
endif
########################
# OPENSTACK PART
########################