From a3d31a425e0bcfd040746ee21063e108e4487e07 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Sun, 26 Jan 2020 16:58:13 +0100 Subject: cfg01, mas01: Switch to Ubuntu Bionic Pin salt-formula-nfs to a commit before 'mount.opts' was introduced. Adapt salt-formula-maas bits for MaaS 2.4 (shipped by default in Bionic) compatibility. Change-Id: I42f436203d3fbdb777d6b3eff9ac185240088742 Signed-off-by: Alexandru Avadanii --- .gitmodules | 4 +++ ci/build.sh | 4 +-- ...03-OPNFV-package-installation-Ubuntu-user.patch | 12 ++++++--- .../0005-Add-saltminion-maas-build-target.patch | 22 ++++++++-------- ...syncdb-migrate-for-MaaS-2.4-compatibility.patch | 30 ++++++++++++++++++++++ .../cluster/all-mcp-arch-common/infra/maas.yml.j2 | 4 +++ mcp/salt-formulas/salt-formula-nfs | 1 + 7 files changed, 61 insertions(+), 16 deletions(-) create mode 100644 mcp/patches/salt-formula-maas/0007-region-s-syncdb-migrate-for-MaaS-2.4-compatibility.patch create mode 160000 mcp/salt-formulas/salt-formula-nfs diff --git a/.gitmodules b/.gitmodules index dbad89fc8..c628f7794 100644 --- a/.gitmodules +++ b/.gitmodules @@ -90,3 +90,7 @@ path = mcp/salt-formulas/salt-formula-rabbitmq url = https://gerrit.mcp.mirantis.com/salt-formulas/rabbitmq branch = master +[submodule "salt-formula-nfs"] + path = mcp/salt-formulas/salt-formula-nfs + url = https://github.com/salt-formulas/salt-formula-nfs + branch = master diff --git a/ci/build.sh b/ci/build.sh index 6119472ec..b24ac5b4e 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -78,7 +78,7 @@ env PIPENV_HIDE_EMOJIS=1 python3 -m pipenv run \ invoke build saltmaster-reclass \ --require 'salt salt-formulas opnfv reclass tini-saltmaster' \ --dist=ubuntu \ - --dist-rel=xenial \ + --dist-rel=bionic \ --formula-rev=nightly \ --opnfv-tag="${DOCKER_TAG}" \ --salt="${SALT_VERSION}" \ @@ -90,7 +90,7 @@ env PIPENV_HIDE_EMOJIS=1 python3 -m pipenv run \ invoke build saltminion-maas \ --require 'maas' \ --dist=ubuntu \ - --dist-rel=xenial \ + --dist-rel=bionic \ --opnfv-tag="${DOCKER_TAG}" \ --salt="${SALT_VERSION}" \ ${DOCKER_PUSH} diff --git a/mcp/patches/docker/0003-OPNFV-package-installation-Ubuntu-user.patch b/mcp/patches/docker/0003-OPNFV-package-installation-Ubuntu-user.patch index 75da21633..27df86e8d 100644 --- a/mcp/patches/docker/0003-OPNFV-package-installation-Ubuntu-user.patch +++ b/mcp/patches/docker/0003-OPNFV-package-installation-Ubuntu-user.patch @@ -21,15 +21,18 @@ Subject: [PATCH] OPNFV package installation, Ubuntu user * Pin dockermake to v0.8 to allow using python3.5 for virtualenv, since python 3.6 is not easily available for Ubuntu Xenial jump/build hosts. +* Pin jinja2 to 2.11.0 to bypass [1]. + +[1] https://github.com/saltstack/salt/issues/46594 Signed-off-by: Alexandru Avadanii --- - DockerMake.yml | 38 +++++++++++++++++++++++++++++++++++++- + DockerMake.yml | 39 ++++++++++++++++++++++++++++++++++++++- Pipfile | 4 ++-- - 2 files changed, 39 insertions(+), 3 deletions(-) + 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/DockerMake.yml b/DockerMake.yml -index 2c75586..9ab7195 100644 +index 2c75586..f30024c 100644 --- a/DockerMake.yml +++ b/DockerMake.yml @@ -29,6 +29,7 @@ common-cleanup: @@ -49,7 +52,7 @@ index 2c75586..9ab7195 100644 ENV SALT_FORMULA_SOURCES $SALT_FORMULA_SOURCES ARG SALT_FORMULAS_BASE="/srv/salt/formula" ENV SALT_FORMULAS_BASE $SALT_FORMULAS_BASE -@@ -108,6 +109,41 @@ salt-formulas: +@@ -108,6 +109,42 @@ salt-formulas: && bash -c 'source /srv/salt/formula-fetch.sh && setupPyEnv && fetchAll' \ && eval ${LAYER_CLEANUP} @@ -85,6 +88,7 @@ index 2c75586..9ab7195 100644 + python-yaml \ + && useradd -m ubuntu \ + && echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/ubuntu \ ++ && python -m pip install -U jinja2==2.11.0 \ + && eval ${LAYER_CLEANUP} + + diff --git a/mcp/patches/docker/0005-Add-saltminion-maas-build-target.patch b/mcp/patches/docker/0005-Add-saltminion-maas-build-target.patch index 2fb4cf523..82ce1ee82 100644 --- a/mcp/patches/docker/0005-Add-saltminion-maas-build-target.patch +++ b/mcp/patches/docker/0005-Add-saltminion-maas-build-target.patch @@ -11,15 +11,15 @@ Date: Wed, 30 Jan 2019 17:21:03 +0100 Subject: [PATCH] Add saltminion-maas build target --- - DockerMake.yml | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ - invoke.yml | 5 +++++ - 2 files changed, 66 insertions(+) + DockerMake.yml | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++ + invoke.yml | 5 ++++ + 2 files changed, 68 insertions(+) diff --git a/DockerMake.yml b/DockerMake.yml -index 9ab7195..2c0b8ac 100644 +index f30024c..ca91539 100644 --- a/DockerMake.yml +++ b/DockerMake.yml -@@ -50,6 +50,67 @@ common: +@@ -50,6 +50,69 @@ common: && eval ${LAYER_CLEANUP} @@ -33,6 +33,9 @@ index 9ab7195..2c0b8ac 100644 + ARG SALT_BOOTSTRAP_OPTS="-PdX ${SALT_VERSION}" + ENV SALT_BOOTSTRAP_OPTS $SALT_BOOTSTRAP_OPTS + RUN echo "Layer with MaaS, salt-minion packages" \ ++ && eval ${LAYER_PKGUPDT} \ ++ && apt-get upgrade -qy \ ++ && ${LAYER_INSTALL} maas-common systemd \ + && find /etc/systemd/system \ + /lib/systemd/system \ + -path '*.wants/*' \ @@ -41,10 +44,6 @@ index 9ab7195..2c0b8ac 100644 + -not -name '*systemd-user-sessions*' \ + -exec rm \{} \; \ + && systemctl set-default multi-user.target \ -+ && eval ${LAYER_PKGUPDT} \ -+ && curl -qL https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh | $SUDO sh -s -- -A cfg01 ${SALT_BOOTSTRAP_OPTS} \ -+ && apt-get upgrade -qy \ -+ && ${LAYER_INSTALL} maas-common \ + && ${LAYER_INSTALL} \ + at \ + avahi-utils \ @@ -65,6 +64,7 @@ index 9ab7195..2c0b8ac 100644 + python-msgpack \ + python-netaddr \ + python-oauth \ ++ python-pip \ + python-psutil \ + python-yaml \ + sysfsutils \ @@ -80,8 +80,10 @@ index 9ab7195..2c0b8ac 100644 + && mv /var/lib/maas /var/lib/postgresql /var/lib/opnfv/ \ + && mv /etc/maas /etc/ssh /var/lib/opnfv/etc/ \ + && mv /var/lib/opnfv/maas-region-controller.postinst /var/lib/dpkg/info/ \ ++ && python -m pip install -U jinja2==2.11.0 \ ++ && curl -qL https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh | $SUDO sh -s -- -A cfg01 ${SALT_BOOTSTRAP_OPTS} \ + && eval ${LAYER_CLEANUP} -+ ENTRYPOINT ["/bin/bash", "-c", "/entrypoint.sh && exec /sbin/init"] ++ ENTRYPOINT ["/bin/bash", "-c", "/entrypoint.sh && exec /lib/systemd/systemd"] + + salt: diff --git a/mcp/patches/salt-formula-maas/0007-region-s-syncdb-migrate-for-MaaS-2.4-compatibility.patch b/mcp/patches/salt-formula-maas/0007-region-s-syncdb-migrate-for-MaaS-2.4-compatibility.patch new file mode 100644 index 000000000..f0a70ffc4 --- /dev/null +++ b/mcp/patches/salt-formula-maas/0007-region-s-syncdb-migrate-for-MaaS-2.4-compatibility.patch @@ -0,0 +1,30 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: Copyright (c) 2019 Mirantis Inc., Enea AB and others. +: +: 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 +: http://www.apache.org/licenses/LICENSE-2.0 +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +From: Alexandru Avadanii +Date: Mon, 27 Jan 2020 17:10:04 +0100 +Subject: [PATCH] region: s/syncdb/migrate/ for MaaS 2.4 compatibility + +Signed-off-by: Alexandru Avadanii +--- + maas/region.sls | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/maas/region.sls b/maas/region.sls +index ca876ee..31e9906 100644 +--- a/maas/region.sls ++++ b/maas/region.sls +@@ -186,7 +186,7 @@ maas_region_services: + maas_region_syncdb: + cmd.run: + - names: +- - maas-region syncdb --noinput ++ - maas-region migrate --noinput + - require: + - file: /etc/maas/regiond.conf + {%- if grains['saltversioninfo'][0] >= 2017 and grains['saltversioninfo'][1] >= 7 %} diff --git a/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/maas.yml.j2 b/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/maas.yml.j2 index 9b799edf0..f98040b93 100644 --- a/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/maas.yml.j2 +++ b/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/maas.yml.j2 @@ -25,6 +25,9 @@ parameters: opnfv_maas_timeout_deploying: {{ nm.maas_timeout_deploying }} maas: region: + services: + - maas-regiond + - bind9 {%- if '-ovs-' in conf.MCP_DEPLOY_SCENARIO or '-fdio-' in conf.MCP_DEPLOY_SCENARIO %} tags: aarch64_hugepages_1g: @@ -32,6 +35,7 @@ parameters: definition: '//capability[@id="asimd"]|//capability[@id="cp15_barrier"]' kernel_opts: 'default_hugepagesz=1G hugepagesz=1G' {%- endif %} + enable_iframe: False timeout: # Set maas.wait_for_ timeouts to ~2.5x of MaaS timeout ready: {{ nm.maas_timeout_comissioning * 150 }} diff --git a/mcp/salt-formulas/salt-formula-nfs b/mcp/salt-formulas/salt-formula-nfs new file mode 160000 index 000000000..5872d161e --- /dev/null +++ b/mcp/salt-formulas/salt-formula-nfs @@ -0,0 +1 @@ +Subproject commit 5872d161e3ee149335932bfa364a437fdd367afa -- cgit 1.2.3-korg