aboutsummaryrefslogtreecommitdiffstats
path: root/build/f_isoroot/f_repobuild/Makefile
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2016-07-06 17:03:49 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-01-30 17:40:18 +0100
commit3518e4b1a55724766e91c58f06d536a9047b8a70 (patch)
tree7c9c08a4af5eecf95a115915f6142f47713ace78 /build/f_isoroot/f_repobuild/Makefile
parent7a4538e62aa98b42d26177e81f8d43c891fbe0d2 (diff)
f_repobuild: Use packetary to build partial mirror
Packetary [1] will replace fuel-mirror in upstream Fuel. fuel-mirror is using packetary under the hood already, so the transition should not be too hard. Adapt OPNFV Ubuntu partial mirror build: - obsolete opnfv-config.yaml (packetary uses CLI args for this); - new opnfv_config.yaml will hold old ubuntu.yaml data, split at build runtime into: * mos_<arch>_mirror.yaml - MOS mirror cfg, only for deps analysis; * ubuntu_<arch>_mirror.yaml - Ubuntu mirror cfg, for pkgs download; * ubuntu_<arch>_packages.yaml - Ubuntu packages to download; While the consumers of our mirror still use `debootstrap`, which only supports the "main" repo component, make sure the "main" package set is complete, in the scope of: * ubuntu_<arch>_mirror_main.yaml - Ubuntu [main only] mirror; * ubuntu_<arch>_packages_main.yaml - Ubuntu packages for [main]; New workflow (executed for EACH architecture): 1. Collect bootstrap package deps from <fuel_bootstrap_cli.yaml>; 2. Collect all fixture release pkgs from fuel-web's <openstack.yaml>; 3. Add OPNFV extra pkg deps from "opnfv_config.yaml" (based on old fuel-mirror) Currently, this is based on old fuel-mirror's <fuel-mirror/contrib/fuel_mirror/data/ubuntu.yaml>, holding a hardcoded list of package deps; plus eventual extra OPNFV packages, like additional kernels, bootloaders etc. Since we now inspect MOS repos for deps with packetary, this old list should be easy to throw away as soon as we confirm each item is directly required by another, already existing package in the mirror. For now, keep the old list as safety net for missing deps. NOTE: Dependencies up to and including this group should also be satisfiable from Ubuntu "main" repo component only. 4. Append plugin dependencies to the package list; 5. Run `packetary unresolved` for MOS repos, gathering MOS deps that should be fetched from Ubuntu. The new packages will be appended to the predefined list from old "ubuntu.yaml"; 6. Run `packetary clone` to download all required pkgs for the partial Ubuntu mirror. 7. IF repo component merging is disabled, run `packetary clone` only on Ubuntu[main] repo components to download any (still) missing dependencies for `debootstrap`, which only looks at this component, and not the whole mirror. 8. IF repo component merging is enabled, run first `dpkg-scanpackages` to filter out old duplicate versions of packages, then run `packetary create` to merge all repo comps into a single "main". v1 -> v2: - multiarch support (activated via UBUNTU_ARCH envvar); - fixed debootstrap missing deps in "main" component of Ubuntu mirror; - factored out some hardcodes into variables/functions; - add .gitignore file; - move generated config files to "opnfv_config" subdir; - add arm64 Ubuntu repo URL (ports.ubuntu.com is separated from the main Ubuntu mirror, archive.ubuntu.com, which only holds x86 pkgs); v3 -> v4: - introduce env var "MIRROR_UBUNTU_MERGE" to control local mirror repo-component merging into a single "main"; - enable mirror repo-component merging by default, edit fuel_bootstrap_cli.yaml accordingly; v4 -> v6: - edit dea_base to use only main mirror; - fix duplicated logs; - remove `-q` flag for `create`; v6 -> v7: - rebase for Newton fuel_bootstrap_cli.yaml (s/trusty/xenial/); - include OPNFV plugin deps in local Ubuntu mirror; - add `vgabios` dependency, required for arm64 guest firmware; - remove all fuel-mirror references; - merge old fuel-mirror pkglist to OPNFV pkglist; - update packetary commit to include upstream bugfixes [2, 3]; v7 -> v11: - re-enable f_repobuild after Newton rebase; - fix leftover "trusty" ref to "xenial"; - force f_repobuild rebuild to bypass cache (by editing Makefile); - extend f_repobuild .cacheid to include scripts and OPNFV config; v11 -> v12: - fix install/install.sh old refs to "trusty"; - fix out of date select_ubuntu_repo.s refs to "trusty"; v12 -> v16: - fix leftover mos9.0 / fuel-mirror references; - fix most issues reported by `pylint opnfv_mirror_ubuntu.py`; v16 -> v18: - Sync fuel_bootstrap_cli.yaml with settings.yaml.sample from 10.0: [4] Stub pass for "Get root password for build image from settings" [5] Sync pkg list with "Switch to Ubuntu Xenial" [6] "Add puppet and daemonize to default packages list" [7] "Delete kernel debug related parameter for performance" [8] "Add to bootstrap image dependencies for network checker" - Remove obsolete Trusty kernel images from pkg lists; - Don't break when plugins set is empty; - Fix missing "vim" package, which was resolved using secondary provider packages like GUI-enabled vim flavors; The proposed fix is quite sensitive, also cutting the final mirror size in half (!), and allowing us to remove a previous hacky workaround (re-running packetary only for main). - Remove "main"-only packetary run (hacky), since the new fix for "vim" also takes care of packetary solving dependencies from "universe". - Add OPNFV blacklisting to workaround "upstart" package being installed, together with "systemd" (having them both installed confuses puppet); - Currently in testing in Armband as part of [9]: * bootstrap and target image building works from offline mirror; * systemd is used instead of upstart; * full deploy is not yet confirmed, due to some AArch64 specifics we are in the process of fixing; NOTE: Without filtering out old package verisons using `dpkg-scanpackages`, bootstrap build cannot solve all deps. FIXME: Repo component merging is sort of slow, since packetary insists on copying the source files to the destination dir even if they are pointing to the same repo. FIXME: Packetary `create` uses a different directory scheme for the created mirror than the upstream Ubuntu, e.g.: [p] mirrors/ubuntu/pool/main/l/lvm2_2.02.98-6ubuntu2_amd64.deb [U] mirrors/ubuntu/pool/main/l/lvm2/lvm2_2.02.98-6ubuntu2_amd64.deb This disencourages creating the "merged" mirror in the same location as the source partial mirror. [1] https://wiki.openstack.org/wiki/Packetary [2] https://review.openstack.org/#/c/392936/ [3] https://review.openstack.org/#/c/392937/ [4] https://review.openstack.org/#/c/277353/ [5] https://review.openstack.org/#/c/345516/ [6] https://review.openstack.org/#/c/344909/ [7] https://review.openstack.org/#/c/400165/ [8] https://review.openstack.org/#/c/415912/ [9] https://gerrit.opnfv.org/gerrit/#/c/26157/ [10] https://review.openstack.org/#/c/420815 JIRA: FUEL-218 JIRA: FUEL-223 JIRA: ARMBAND-169 JIRA: ARMBAND-185 Change-Id: If2ee86f348b7683c83bfaf686baba4f1b8f555f0 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'build/f_isoroot/f_repobuild/Makefile')
-rw-r--r--build/f_isoroot/f_repobuild/Makefile43
1 files changed, 21 insertions, 22 deletions
diff --git a/build/f_isoroot/f_repobuild/Makefile b/build/f_isoroot/f_repobuild/Makefile
index 8beb8824f..891712b9a 100644
--- a/build/f_isoroot/f_repobuild/Makefile
+++ b/build/f_isoroot/f_repobuild/Makefile
@@ -1,7 +1,8 @@
##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
+# Copyright (c) 2015,2016 Ericsson AB, Enea AB and others.
# stefan.k.berg@ericsson.com
# jonas.bjurel@ericsson.com
+# Alexandru.Avadanii@enea.com
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
@@ -10,41 +11,37 @@
SHELL := /bin/bash
TOP := $(shell pwd)
-TMP_ROOT_DIR := $(shell echo "$(MIRROR_UBUNTU_ROOT)" | cut -d "/" -f2)
include ../../config.mk
+include config.mk
export MOS_VERSION
-export OPENSTACK_VERSION
+export MIRROR_UBUNTU_OPNFV_PATH:=$(TOP)/nailgun/mirrors/ubuntu
.PHONY: all
all: nailgun
nailgun:
- sudo apt-get install -y git libxml2-dev libxslt-dev python-dev python-pip libz-dev libyaml-dev createrepo python-yaml
- rm -Rf nailgun
- sudo mkdir -p /var/www/nailgun
- ln -sf ${F_SUBMOD_DIR}/fuel-mirror fuel-mirror
- sudo pip install -U -r ./fuel-mirror/requirements.txt
- sudo pip install ./fuel-mirror
- sudo pip install ./fuel-mirror/contrib/fuel_mirror
- ./opnfv_mirror_conf.py
- sudo fuel-mirror --debug --config ./opnfv-config.yaml create --group ubuntu --pattern=ubuntu
- sudo chmod -R 755 /var/www/nailgun
- cp -Rp /var/www/nailgun .
- # In the end we want to have ubuntu repository in mirrors/ubuntu directory
- -if [ "$(MIRROR_UBUNTU_ROOT)" != "/ubuntu/" ]; then \
- mkdir -p nailgun/mirrors/ubuntu;\
- mv nailgun/mirrors$(MIRROR_UBUNTU_ROOT)* nailgun/mirrors/ubuntu;\
- [ "$(MIRROR_UBUNTU_ROOT)" != "/" ] && rm -rf nailgun/mirrors/$(TMP_ROOT_DIR);\
+ sudo apt-get install -y createrepo git libxml2-dev libxslt1-dev \
+ python-dev zlib1g-dev
+ rm -Rf nailgun packetary opnfv_config && mkdir opnfv_config
+ # We will analyze fuel-web's fixture files for package lists
+ ln -sf ${F_SUBMOD_DIR}/fuel-web fuel-web
+ git clone --quiet $(PACKETARY_REPO)
+ if [ -n $(PACKETARY_COMMIT) ]; then \
+ git -C packetary checkout $(PACKETARY_COMMIT); \
fi
+ sudo pip install -U -r ./packetary/requirements.txt
+ sudo pip install -U ./packetary
+ # Handle config and mirror build in one place
+ ./opnfv_mirror_ubuntu.py
# Store artifact in cache straight away if caching is enabled
# (no .cacheid will be present unless this is a cached build)
test -f .cacheid && $(MAKE) -f Makefile put-cache || exit 0
.PHONY: clean
clean:
- @rm -rf ../release/opnfv/nailgun nailgun fuel-mirror opnfv-config.yaml ubuntu.yaml
+ @rm -rf ../release/opnfv/nailgun nailgun packetary fuel-web opnfv_config
.PHONY: release
release:nailgun
@@ -59,10 +56,12 @@ release:nailgun
# Create a unique hash to be used for getting and putting cache, based on:
# - Year and week (causing the cache to be rebuilt weekly)
-# - The contents of this Makefile
+# - The contents of this Makefile + all sh,mk,py,yaml files in CWD
+# - repo packages fingerprint
+# - repo arch list
.cacheid:
date +"Repocache %G%V" > .cachedata
- sha1sum Makefile >> .cachedata
+ sha1sum Makefile *.{sh,mk,py,yaml} >> .cachedata
$(CACHETOOL) packages >> .cachedata
echo -n $(UBUNTU_ARCH) | sha1sum | awk {'print $$1'} >> .cachedata
cat .cachedata | $(CACHETOOL) getid > .cacheid