cfg01, mas01: Switch to Ubuntu Bionic
[fuel.git] / mcp / patches / docker / 0003-OPNFV-package-installation-Ubuntu-user.patch
1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2019 Mirantis Inc., Enea AB and others.
3 :
4 : All rights reserved. This program and the accompanying materials
5 : are made available under the terms of the Apache License, Version 2.0
6 : which accompanies this distribution, and is available at
7 : http://www.apache.org/licenses/LICENSE-2.0
8 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
9 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
10 Date: Wed, 22 Aug 2018 01:35:06 +0200
11 Subject: [PATCH] OPNFV package installation, Ubuntu user
12
13 * Install OpenSSH server (and client), so other OPNFV projects can
14   easily connect to the Salt master node;
15 * Install 'salt-formula-gnocchi' distro package (empty git formula
16   workaround);
17 * While at it, create 'ubuntu' user so other OPNFV projects don't
18   have to switch to 'root' login;
19 * Preinstall `salt_minion_dependency_packages` and
20   `salt_minion_reclass_dependencies`;
21 * Pin dockermake to v0.8 to allow using python3.5 for virtualenv,
22   since python 3.6 is not easily available for Ubuntu Xenial
23   jump/build hosts.
24 * Pin jinja2 to 2.11.0 to bypass [1].
25
26 [1] https://github.com/saltstack/salt/issues/46594
27
28 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
29 ---
30  DockerMake.yml | 39 ++++++++++++++++++++++++++++++++++++++-
31  Pipfile        |  4 ++--
32  2 files changed, 40 insertions(+), 3 deletions(-)
33
34 diff --git a/DockerMake.yml b/DockerMake.yml
35 index 2c75586..f30024c 100644
36 --- a/DockerMake.yml
37 +++ b/DockerMake.yml
38 @@ -29,6 +29,7 @@ common-cleanup:
39
40  common:
41    build: |
42 +    ARG CACHE_INVALIDATE="0"
43      RUN echo "Layer with common packages" \
44        && eval ${LAYER_PKGUPDT} \
45        && apt-get upgrade -qy \
46 @@ -94,7 +95,7 @@ salt-formulas:
47    build: |
48      ARG SALT_FORMULA_VERSION="master"
49      ENV SALT_FORMULA_VERSION $SALT_FORMULA_VERSION
50 -    ARG SALT_FORMULA_SOURCES="https://github.com/salt-formulas https://github.com/saltstack-formulas"
51 +    ARG SALT_FORMULA_SOURCES="https://github.com/salt-formulas"
52      ENV SALT_FORMULA_SOURCES $SALT_FORMULA_SOURCES
53      ARG SALT_FORMULAS_BASE="/srv/salt/formula"
54      ENV SALT_FORMULAS_BASE $SALT_FORMULAS_BASE
55 @@ -108,6 +109,42 @@ salt-formulas:
56        && bash -c 'source /srv/salt/formula-fetch.sh && setupPyEnv && fetchAll' \
57        && eval ${LAYER_CLEANUP}
58
59 +opnfv:
60 +  build: |
61 +    # Some formulas have empty git repos, use the package version
62 +    ARG SALT_FORMULA_VERSION="nightly"
63 +    ENV SALT_FORMULA_VERSION $SALT_FORMULA_VERSION
64 +    ARG SALT_FORMULA_LIST="salt-formula-gnocchi"
65 +    ENV SALT_FORMULA_LIST $SALT_FORMULA_LIST
66 +    ENV APT_REPOSITORY "deb [arch=amd64] http://apt.mirantis.com/xenial ${SALT_FORMULA_VERSION} salt"
67 +    ENV APT_REPOSITORY_GPG "http://apt.mirantis.com/public.gpg"
68 +    RUN echo "Layer extra salt-formulas packages" \
69 +      && echo "$APT_REPOSITORY" | tee /etc/apt/sources.list.d/salt-formulas.list >/dev/null \
70 +      && curl -sL $APT_REPOSITORY_GPG | $SUDO apt-key add - \
71 +      && eval ${LAYER_PKGUPDT} \
72 +      && ${LAYER_INSTALL} ${SALT_FORMULA_LIST} -y --fix-missing -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
73 +      && eval ${LAYER_CLEANUP}
74 +    RUN echo "Layer with OPNFV packages" \
75 +      && eval ${LAYER_PKGUPDT} \
76 +      && ${LAYER_INSTALL} \
77 +           gawk \
78 +           inetutils-ping \
79 +           kmod \
80 +           net-tools \
81 +           openssh-server \
82 +           python-futures \
83 +           python-m2crypto \
84 +           python-msgpack \
85 +           python-netaddr \
86 +           python-oauth \
87 +           python-psutil \
88 +           python-yaml \
89 +      && useradd -m ubuntu \
90 +      && echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/ubuntu \
91 +      && python -m pip install -U jinja2==2.11.0 \
92 +      && eval ${LAYER_CLEANUP}
93 +
94 +
95  wheel:
96    requires:
97      - base
98 diff --git a/Pipfile b/Pipfile
99 index d3e8d66..340e125 100644
100 --- a/Pipfile
101 +++ b/Pipfile
102 @@ -7,8 +7,8 @@ name = "pypi"
103
104  [packages]
105  pygithub = "*"
106 -docker-make = {git = "https://github.com/avirshup/DockerMake"}
107 -dockermake = {git = "https://github.com/avirshup/DockerMake"}
108 +docker-make = {git = "https://github.com/avirshup/DockerMake", ref = "aeac230fd5ab468d806bf42b120aa97f91eb40a2"}
109 +dockermake = {git = "https://github.com/avirshup/DockerMake", ref = "aeac230fd5ab468d806bf42b120aa97f91eb40a2"}
110
111  [requires]
112  python_version = "3.6"