1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
|
FROM {{ namespace }}/{{ image_prefix }}nova-base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% block nova_compute_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_package_type == 'rpm' %}
{% set nova_compute_packages = [
'ceph-common',
'cyrus-sasl-md5',
'cyrus-sasl-scram',
'device-mapper-multipath',
'e2fsprogs',
'genisoimage',
'iscsi-initiator-utils',
'ndctl',
'nfs-utils',
'nvme-cli',
'openstack-nova-compute',
'openvswitch',
'parted',
'sysfsutils',
'targetcli',
'xfsprogs'
] %}
{% if distro_python_version.startswith('3') %}
{% set nova_compute_packages = nova_compute_packages + [
'python3-libguestfs',
'python3-oslo-vmware',
'python3-rtslib'
] %}
{% else %}
{% set nova_compute_packages = nova_compute_packages + [
'python-libguestfs',
'python-oslo-vmware',
'python-rtslib'
] %}
{% endif %}
# NOTE(hrw): daxio is part of pmdk which is x86-64 only in CentOS 8
{% if base_arch == 'x86_64' %}
{% set nova_compute_packages = nova_compute_packages + [
'daxio'
] %}
{% endif %}
{{ macros.install_packages(nova_compute_packages | customizable("packages")) }}
{% elif base_package_type == 'deb' %}
# ironic as workaround https://bugs.launchpad.net/packstack/+bug/1430388
{% set nova_compute_packages = [
'ceph-common',
'e2fsprogs',
'genisoimage',
'ironic-common',
'libsasl2-modules-gssapi-mit',
'multipath-tools',
'nfs-common',
'nova-compute',
'openvswitch-switch',
'open-iscsi',
'parted',
'python3-cephfs',
'python3-guestfs',
'python3-ironicclient',
'python3-oslo.vmware',
'python3-rados',
'python3-rbd',
'python3-rtslib-fb',
'sasl2-bin',
'sysfsutils',
'targetcli-fb',
'xfsprogs'
] %}
# FIXME(pkopec): since Ubuntu 19.04 'ndctl' package is available
# for other archs than 'x86_64
# NOTE(hrw): similar situation with 'pmdk-tools'
{% if base_distro == 'debian' or
(base_distro == 'ubuntu' and base_arch == 'x86_64') %}
{% set nova_compute_packages = nova_compute_packages + [
'ndctl',
'pmdk-tools',
] %}
{% endif %}
{{ macros.install_packages(nova_compute_packages | customizable("packages")) }}
RUN rm -f /etc/nova/nova-compute.conf
{% endif %}
{% elif install_type == 'source' %}
{% if base_package_type == 'rpm' %}
{% set nova_compute_packages = [
'ceph-common',
'cyrus-sasl-md5',
'cyrus-sasl-scram',
'device-mapper-multipath',
'dosfstools',
'e2fsprogs',
'genisoimage',
'iscsi-initiator-utils',
'libosinfo',
'ndctl',
'nfs-utils',
'openvswitch',
'parted',
'sysfsutils',
'targetcli',
'xfsprogs'
] %}
{% if distro_python_version.startswith('3') %}
{% set nova_compute_packages = nova_compute_packages + [
'python3-libguestfs',
'python3-libvirt',
'python3-rtslib'
] %}
{% else %}
{% set nova_compute_packages = nova_compute_packages + [
'libvirt-python',
'python-libguestfs',
'python-rtslib'
] %}
{% endif %}
{% if distro_package_manager == 'dnf' %}
{% set nova_compute_packages = nova_compute_packages + [
'qemu-img',
] %}
{% else %}
{% set nova_compute_packages = nova_compute_packages + [
'qemu-img-ev',
] %}
{% endif %}
# NOTE(hrw): daxio is part of pmdk which is x86-64 only in CentOS 8
{% if base_arch == 'x86_64' %}
{% set nova_compute_packages = nova_compute_packages + [
'daxio'
] %}
{% endif %}
{% elif base_package_type == 'deb' %}
{% set nova_compute_packages = [
'ceph-common',
'dosfstools',
'e2fsprogs',
'genisoimage',
'libosinfo-bin',
'libsasl2-modules-gssapi-mit',
'multipath-tools',
'nfs-common',
'open-iscsi',
'parted',
'python3-cephfs',
'python3-guestfs',
'python3-libvirt',
'python3-rados',
'python3-rbd',
'python3-rtslib-fb',
'qemu-utils',
'sasl2-bin',
'sysfsutils',
'targetcli-fb',
'xfsprogs'
] %}
{% if base_arch == "aarch64" %}
{% set nova_compute_packages = nova_compute_packages + [
'qemu-efi'
] %}
{% endif %}
# FIXME(pkopec): since Ubuntu 19.04 'ndctl' package is available
# for other archs than 'x86_64'
# NOTE(hrw): similar situation with 'pmdk-tools'
{% if base_distro == 'debian' or
(base_distro == 'ubuntu' and base_arch == 'x86_64') %}
{% set nova_compute_packages = nova_compute_packages + [
'ndctl',
'pmdk-tools',
] %}
{% endif %}
RUN mkdir -p /etc/ceph
{% endif %}
{{ macros.install_packages(nova_compute_packages | customizable("packages")) }}
{% set nova_compute_pip_packages = [
'oslo-vmware'
]
%}
{% set nova_compute_plugins_pip_packages = [
'/plugins/*'
] %}
ADD plugins-archive /
RUN {{ macros.install_pip(nova_compute_pip_packages | customizable("pip_packages")) }} \
&& if [ "$(ls /plugins)" ]; then \
{{ macros.install_pip(nova_compute_plugins_pip_packages) }}; \
fi
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_nova_extend_start
RUN chmod 755 /usr/local/bin/kolla_nova_extend_start \
&& rm -f /etc/machine-id
{% block nova_compute_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER nova
|