75da21633d89b1f167850023ccdc14ef21468def
[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
25 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
26 ---
27  DockerMake.yml | 38 +++++++++++++++++++++++++++++++++++++-
28  Pipfile        |  4 ++--
29  2 files changed, 39 insertions(+), 3 deletions(-)
30
31 diff --git a/DockerMake.yml b/DockerMake.yml
32 index 2c75586..9ab7195 100644
33 --- a/DockerMake.yml
34 +++ b/DockerMake.yml
35 @@ -29,6 +29,7 @@ common-cleanup:
36
37  common:
38    build: |
39 +    ARG CACHE_INVALIDATE="0"
40      RUN echo "Layer with common packages" \
41        && eval ${LAYER_PKGUPDT} \
42        && apt-get upgrade -qy \
43 @@ -94,7 +95,7 @@ salt-formulas:
44    build: |
45      ARG SALT_FORMULA_VERSION="master"
46      ENV SALT_FORMULA_VERSION $SALT_FORMULA_VERSION
47 -    ARG SALT_FORMULA_SOURCES="https://github.com/salt-formulas https://github.com/saltstack-formulas"
48 +    ARG SALT_FORMULA_SOURCES="https://github.com/salt-formulas"
49      ENV SALT_FORMULA_SOURCES $SALT_FORMULA_SOURCES
50      ARG SALT_FORMULAS_BASE="/srv/salt/formula"
51      ENV SALT_FORMULAS_BASE $SALT_FORMULAS_BASE
52 @@ -108,6 +109,41 @@ salt-formulas:
53        && bash -c 'source /srv/salt/formula-fetch.sh && setupPyEnv && fetchAll' \
54        && eval ${LAYER_CLEANUP}
55
56 +opnfv:
57 +  build: |
58 +    # Some formulas have empty git repos, use the package version
59 +    ARG SALT_FORMULA_VERSION="nightly"
60 +    ENV SALT_FORMULA_VERSION $SALT_FORMULA_VERSION
61 +    ARG SALT_FORMULA_LIST="salt-formula-gnocchi"
62 +    ENV SALT_FORMULA_LIST $SALT_FORMULA_LIST
63 +    ENV APT_REPOSITORY "deb [arch=amd64] http://apt.mirantis.com/xenial ${SALT_FORMULA_VERSION} salt"
64 +    ENV APT_REPOSITORY_GPG "http://apt.mirantis.com/public.gpg"
65 +    RUN echo "Layer extra salt-formulas packages" \
66 +      && echo "$APT_REPOSITORY" | tee /etc/apt/sources.list.d/salt-formulas.list >/dev/null \
67 +      && curl -sL $APT_REPOSITORY_GPG | $SUDO apt-key add - \
68 +      && eval ${LAYER_PKGUPDT} \
69 +      && ${LAYER_INSTALL} ${SALT_FORMULA_LIST} -y --fix-missing -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
70 +      && eval ${LAYER_CLEANUP}
71 +    RUN echo "Layer with OPNFV packages" \
72 +      && eval ${LAYER_PKGUPDT} \
73 +      && ${LAYER_INSTALL} \
74 +           gawk \
75 +           inetutils-ping \
76 +           kmod \
77 +           net-tools \
78 +           openssh-server \
79 +           python-futures \
80 +           python-m2crypto \
81 +           python-msgpack \
82 +           python-netaddr \
83 +           python-oauth \
84 +           python-psutil \
85 +           python-yaml \
86 +      && useradd -m ubuntu \
87 +      && echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/ubuntu \
88 +      && eval ${LAYER_CLEANUP}
89 +
90 +
91  wheel:
92    requires:
93      - base
94 diff --git a/Pipfile b/Pipfile
95 index d3e8d66..340e125 100644
96 --- a/Pipfile
97 +++ b/Pipfile
98 @@ -7,8 +7,8 @@ name = "pypi"
99
100  [packages]
101  pygithub = "*"
102 -docker-make = {git = "https://github.com/avirshup/DockerMake"}
103 -dockermake = {git = "https://github.com/avirshup/DockerMake"}
104 +docker-make = {git = "https://github.com/avirshup/DockerMake", ref = "aeac230fd5ab468d806bf42b120aa97f91eb40a2"}
105 +dockermake = {git = "https://github.com/avirshup/DockerMake", ref = "aeac230fd5ab468d806bf42b120aa97f91eb40a2"}
106
107  [requires]
108  python_version = "3.6"