1 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2 Date: Sun, 9 Apr 2017 14:10:21 +0200
3 Subject: [PATCH] fuel-menu: Align defaults w/ OPNFV bootstrap cfg
5 Instead of overwriting fuel_bootstrap_cli.yaml during post-install,
6 with a static config which we need to manually sync in OPNFV after
7 each upstream change, make the whole thing dynamic by syncing (via
8 patch) fuel-menu's default settings with OPNFV bootstrap.
10 This allows us to drop the static fuel_bootstrap_cli.yaml.
14 Change-Id: I132f2a272c764ad0fc84b3e0e0e1222b1fab1cd2
15 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
17 .../f_bootstrap/post-scripts/03_install_repo.sh | 5 --
18 build/f_isoroot/f_repobuild/Makefile | 3 +-
19 build/f_isoroot/f_repobuild/config.mk | 2 +-
20 .../f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml | 74 ----------------------
21 build/f_isoroot/f_repobuild/opnfv_mirror_ubuntu.py | 7 +-
22 ...s-OPNFV-bootstrap-Default-to-local-mirror.patch | 66 +++++++++++++++++++
23 6 files changed, 73 insertions(+), 84 deletions(-)
24 delete mode 100644 build/f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml
25 create mode 100644 build/f_repos/patch/fuel-menu/0001-settings-OPNFV-bootstrap-Default-to-local-mirror.patch
27 diff --git a/build/f_isoroot/f_bootstrap/post-scripts/03_install_repo.sh b/build/f_isoroot/f_bootstrap/post-scripts/03_install_repo.sh
28 index be17e7e..431577c 100755
29 --- a/build/f_isoroot/f_bootstrap/post-scripts/03_install_repo.sh
30 +++ b/build/f_isoroot/f_bootstrap/post-scripts/03_install_repo.sh
31 @@ -26,9 +26,4 @@ if [ $? -ne 0 ]; then
32 echo "Error removing /opt/opnfv/nailgun directory!"
35 -mv /opt/opnfv/fuel_bootstrap_cli.yaml /etc/fuel-bootstrap-cli/fuel_bootstrap_cli.yaml
36 -if [ $? -ne 0 ]; then
37 - echo "Error moving bootstrap image configuration!"
40 echo "Done installing pre-build repo"
41 diff --git a/build/f_isoroot/f_repobuild/Makefile b/build/f_isoroot/f_repobuild/Makefile
42 index 891712b..c61d1ad 100644
43 --- a/build/f_isoroot/f_repobuild/Makefile
44 +++ b/build/f_isoroot/f_repobuild/Makefile
45 @@ -27,6 +27,8 @@ nailgun:
46 rm -Rf nailgun packetary opnfv_config && mkdir opnfv_config
47 # We will analyze fuel-web's fixture files for package lists
48 ln -sf ${F_SUBMOD_DIR}/fuel-web fuel-web
49 + # Same for fuel-agent's bootstrap package list
50 + ln -sf ${F_SUBMOD_DIR}/fuel-agent fuel-agent
51 git clone --quiet $(PACKETARY_REPO)
52 if [ -n $(PACKETARY_COMMIT) ]; then \
53 git -C packetary checkout $(PACKETARY_COMMIT); \
54 @@ -48,7 +50,6 @@ release:nailgun
55 @rm -Rf ../release/opnfv/nailgun
56 @mkdir -p ../release/opnfv
57 @cp -Rp nailgun ../release/opnfv/nailgun
58 - @cp fuel_bootstrap_cli.yaml ../release/opnfv/
60 ############################################################################
61 # Cache operations - only used when building through ci/build.sh
62 diff --git a/build/f_isoroot/f_repobuild/config.mk b/build/f_isoroot/f_repobuild/config.mk
63 index 986ea9e..68101d6 100644
64 --- a/build/f_isoroot/f_repobuild/config.mk
65 +++ b/build/f_isoroot/f_repobuild/config.mk
66 @@ -19,5 +19,5 @@ export MIRROR_UBUNTU_ROOT_arm64=ubuntu-ports
68 # Merge all local mirror repo components/section into single "main"
69 # NOTE: When changing this, make sure to also update all consumer config, like:
70 -# - fuel_bootstrap_cli.yaml
71 +# - fuel-menu/fuelmenu/settings.yaml
72 export MIRROR_UBUNTU_MERGE=true
73 diff --git a/build/f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml b/build/f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml
74 deleted file mode 100644
75 index 81ca6eb..0000000
76 --- a/build/f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml
79 -##############################################################################
80 -# Copyright (c) 2015,2016 Ericsson AB and others.
81 -# mskalski@mirantis.com
82 -# All rights reserved. This program and the accompanying materials
83 -# are made available under the terms of the Apache License, Version 2.0
84 -# which accompanies this distribution, and is available at
85 -# http://www.apache.org/licenses/LICENSE-2.0
86 -##############################################################################
88 - root_ssh_authorized_file: /root/.ssh/id_rsa.pub
89 - extend_kopts: "biosdevname=0 net.ifnames=1"
90 - ubuntu_release: xenial
92 - - /usr/share/fuel_bootstrap_cli/files/xenial
94 - kernel_flavor: linux-image-generic-lts-xenial
101 - - linux-headers-generic
103 - - live-boot-initramfs-tools
108 - - multipath-tools-boot
122 - # NOTE(el): Packages required for new generation
123 - # network checker to be run without an access
130 - bootstrap_images_dir: /var/www/nailgun/bootstraps
131 - active_bootstrap_symlink: /var/www/nailgun/bootstraps/active_bootstrap
138 - uri: "http://127.0.0.1:8080/mirrors/ubuntu"
143 - section: "main restricted"
144 - uri: "http://127.0.0.1:8080/ubuntu/x86_64"
148 - skip_default_img_build: false
149 - direct_repo_addresses:
151 - # User can provide default hashed root password for bootstrap image
152 - # hashed_root_password: "$6$IInX3Cqo$5xytL1VZbZTusOewFnG6couuF0Ia61yS3rbC6P5YbZP2TYclwHqMq9e3Tg8rvQxhxSlBXP1DZhdUamxdOBXK0."
153 diff --git a/build/f_isoroot/f_repobuild/opnfv_mirror_ubuntu.py b/build/f_isoroot/f_repobuild/opnfv_mirror_ubuntu.py
154 index 1a603ee..7c38363 100755
155 --- a/build/f_isoroot/f_repobuild/opnfv_mirror_ubuntu.py
156 +++ b/build/f_isoroot/f_repobuild/opnfv_mirror_ubuntu.py
159 ##############################################################################
160 # Mirror build steps (for EACH architecture in UBUNTU_ARCH):
161 -# 1. Collect bootstrap package deps from <fuel_bootstrap_cli.yaml>;
162 +# 1. Collect bootstrap package deps from fuel-agent's <settings.yaml.sample>;
163 # 2. Collect all fixture release packages from fuel-web's <openstack.yaml>;
164 # 3. Parse new "opnfv_config.yaml" list of packages (from old fuel-mirror);
165 # 4. Inherit enviroment variable(s) for mirror URLs, paths etc.
166 @@ -156,7 +156,8 @@ MIRROR_UBUNTU_PATH = get_env('MIRROR_UBUNTU_OPNFV_PATH')
167 MIRROR_UBUNTU_TMP_PATH = '{0}.tmp'.format(MIRROR_UBUNTU_PATH)
168 MIRROR_UBUNTU_MERGE = get_env('MIRROR_UBUNTU_MERGE')
169 CFG_MM_UBUNTU = '{0}/ubuntu_mirror_local.yaml'.format(CFG_D)
170 -FUEL_BOOTSTRAP_CLI_FILE = open('fuel_bootstrap_cli.yaml').read()
171 +FUEL_BOOTSTRAP_CLI_FILE = open('fuel-agent/contrib/fuel_bootstrap/'
172 + 'fuel_bootstrap_cli/fuel_bootstrap/settings.yaml.sample').read()
173 FUEL_BOOTSTRAP_CLI = yaml.load(FUEL_BOOTSTRAP_CLI_FILE)
174 FIXTURE_FILE = open('fuel-web/nailgun/nailgun/fixtures/openstack.yaml').read()
175 FIXTURE = yaml.load(FIXTURE_FILE)
176 @@ -215,7 +216,7 @@ for arch in UBUNTU_ARCH.split(' '):
177 write_cfg_file(CFG_MM_UBUNTU, group_main_ubuntu[0])
179 # Collect package dependencies from:
180 - ## 1. fuel_bootstrap_cli.yaml (bootstrap image additional packages)
181 + ## 1. fuel_bootstrap_cli (bootstrap image additional packages)
182 legacy_unresolved = legacy_diff(None, FUEL_BOOTSTRAP_CLI['packages'] + [
183 FUEL_BOOTSTRAP_CLI['kernel_flavor'],
184 FUEL_BOOTSTRAP_CLI['kernel_flavor'].replace('image', 'headers')],
185 diff --git a/build/f_repos/patch/fuel-menu/0001-settings-OPNFV-bootstrap-Default-to-local-mirror.patch b/build/f_repos/patch/fuel-menu/0001-settings-OPNFV-bootstrap-Default-to-local-mirror.patch
187 index 0000000..456eea7
189 +++ b/build/f_repos/patch/fuel-menu/0001-settings-OPNFV-bootstrap-Default-to-local-mirror.patch
191 +From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
192 +Date: Sun, 9 Apr 2017 13:49:28 +0200
193 +Subject: [PATCH] settings: OPNFV bootstrap: Default to local mirror
195 +JIRA: https://jira.opnfv.org/browse/FUEL-266
197 +Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
199 + fuelmenu/settings.yaml | 36 +++---------------------------------
200 + 1 file changed, 3 insertions(+), 33 deletions(-)
202 +diff --git a/fuelmenu/settings.yaml b/fuelmenu/settings.yaml
203 +index e93309a..aaf07cd 100644
204 +--- a/fuelmenu/settings.yaml
205 ++++ b/fuelmenu/settings.yaml
206 +@@ -13,47 +13,17 @@ BOOTSTRAP:
211 +- section: "main universe multiverse"
212 +- uri: "http://archive.ubuntu.com/ubuntu"
213 ++ - name: "ubuntu-local"
215 ++ uri: "http://127.0.0.1:8080/mirrors/ubuntu"
217 + suite: "${codename}"
219 +- - name: "ubuntu-updates"
220 +- section: "main universe multiverse"
221 +- uri: "http://archive.ubuntu.com/ubuntu"
223 +- suite: "${codename}-updates"
225 +- - name: "ubuntu-security"
226 +- section: "main universe multiverse"
227 +- uri: "http://archive.ubuntu.com/ubuntu"
229 +- suite: "${codename}-security"
232 + section: "main restricted"
233 + uri: "http://127.0.0.1:8080/ubuntu/x86_64"
235 + suite: "mos${mos_version}"
237 +- - name: "mos-updates"
238 +- section: "main restricted"
239 +- uri: "http://mirror.fuel-infra.org/mos-repos/ubuntu/${mos_version}"
241 +- suite: "mos${mos_version}-updates"
243 +- - name: "mos-security"
244 +- section: "main restricted"
245 +- uri: "http://mirror.fuel-infra.org/mos-repos/ubuntu/${mos_version}"
247 +- suite: "mos${mos_version}-security"
249 +- - name: "mos-holdback"
250 +- section: "main restricted"
251 +- uri: "http://mirror.fuel-infra.org/mos-repos/ubuntu/${mos_version}"
253 +- suite: "mos${mos_version}-holdback"