Skip to content

Commit 0d9acf6

Browse files
authored
Merge pull request #141 from stackhpc/upstream/victoria-2022-06-13
Synchronise victoria with upstream
2 parents f9cb6ca + ad9137c commit 0d9acf6

File tree

15 files changed

+104
-39
lines changed

15 files changed

+104
-39
lines changed

docker/base/Dockerfile.j2

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ COPY apt_preferences /etc/apt/preferences.d/kolla-custom
351351
{# 901F9177AB97ACBE -- Treasure Data, Inc (Treasure Agent Official Signing key) <[email protected]> #}
352352
{# A20F259AEB9C94BB -- Sensuapp (Freight) <[email protected]> #}
353353
{# F1656F24C74CD1D8 -- MariaDB Signing Key <[email protected]> #}
354-
{# F77F1EDA57EBB1CC -- Launchpad RabbitMQ Erlang PPA key #}
355-
{# F6609E60DC62814E -- PackageCloud RabbitMQ repository key #}
354+
{# E495BB49CC4BBE5B -- Cloudsmith RabbitMQ Erlang repository key #}
355+
{# 9F4587F226208342 -- Cloudsmith RabbitMQ repository key #}
356356
{% set base_apt_keys = [
357357
'391A9AA2147192839E9DB0315EDB1B62EC4926EA',
358358
'46095ACC8548582C1A2699A9D27D666CD88E42B4',
@@ -362,8 +362,8 @@ COPY apt_preferences /etc/apt/preferences.d/kolla-custom
362362
'901F9177AB97ACBE',
363363
'A20F259AEB9C94BB',
364364
'F1656F24C74CD1D8',
365-
'F77F1EDA57EBB1CC',
366-
'F6609E60DC62814E',
365+
'E495BB49CC4BBE5B',
366+
'9F4587F226208342',
367367
] %}
368368
{% set base_remote_apt_keys = [
369369
'https://packages.grafana.com/gpg.key',
@@ -373,8 +373,8 @@ COPY apt_preferences /etc/apt/preferences.d/kolla-custom
373373
{% set base_apt_keys = [
374374
'46095ACC8548582C1A2699A9D27D666CD88E42B4',
375375
'F1656F24C74CD1D8',
376-
'F77F1EDA57EBB1CC',
377-
'F6609E60DC62814E',
376+
'E495BB49CC4BBE5B',
377+
'9F4587F226208342',
378378
] %}
379379
{% set base_remote_apt_keys = [
380380
'https://download.docker.com/linux/debian/gpg',

docker/base/healthcheck_curl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
: ${HEALTHCHECK_CURL_OUTPUT:='/dev/null'}
66

77
export NSS_SDB_USE_CACHE=no
8-
curl -g -k -q -s -S --fail -o "${HEALTHCHECK_CURL_OUTPUT}" \
8+
curl -q -g -k -s -S --fail -o "${HEALTHCHECK_CURL_OUTPUT}" \
99
--max-time "${HEALTHCHECK_CURL_MAX_TIME}" \
1010
--user-agent "${HEALTHCHECK_CURL_USER_AGENT}" \
1111
--write-out "${HEALTHCHECK_CURL_WRITE_OUT}" \

docker/elasticsearch/elasticsearch/Dockerfile.j2

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
1212
{{ macros.enable_extra_repos(['elasticsearch']) }}
1313

1414
{% if base_package_type == 'rpm' %}
15+
16+
# NOTE(hrw): post-install script of elasticsearch fails when trying to
17+
# install elasticsearch and java together.
18+
{{ macros.install_packages(['java-11-openjdk-headless']) }}
19+
1520
{% set elasticsearch_packages = [
16-
'java-11-openjdk-headless',
1721
'elasticsearch-oss',
1822
] %}
1923

docker/macros.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
{% macro install_pip(packages, constraints = true) %}
3636
{%- if packages is sequence and packages|length > 0 -%}
37-
python{{ distro_python_version }} -m pip --no-cache-dir install --upgrade{{ ' ' }}
37+
SETUPTOOLS_USE_DISTUTILS=stdlib python{{ distro_python_version }} -m pip --no-cache-dir install --upgrade{{ ' ' }}
3838
{%- if constraints %}-c /requirements/upper-constraints.txt {% endif -%}
3939
{{ packages | join(' ') }}
4040
{%- else -%}

docker/masakari/masakari-monitors/Dockerfile.j2

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,20 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
1919
{% if base_package_type == 'rpm' %}
2020

2121
{% set masakari_monitors_packages = [
22-
'libvirt-devel',
22+
'cyrus-sasl-md5',
23+
'cyrus-sasl-scram',
24+
'python3-libvirt',
2325
'pacemaker-cli',
2426
'tcpdump',
2527
] %}
2628

2729
{% elif base_package_type == 'deb' %}
2830

2931
{% set masakari_monitors_packages = [
30-
'libvirt-dev',
32+
'libsasl2-modules-gssapi-mit',
33+
'python3-libvirt',
3134
'pacemaker-cli-utils',
35+
'sasl2-bin',
3236
'tcpdump',
3337
] %}
3438

@@ -42,8 +46,10 @@ ADD masakari-monitors-archive /masakari-monitors-source
4246
'/masakari-monitors'
4347
] %}
4448

49+
# NOTE(hrw): distros may provide other version of libvirt
4550
RUN ln -s masakari-monitors-source/* masakari-monitors \
46-
{% if distro_package_manager == 'dnf' %}&& sed -i -e 's/libvirt-python===.*/libvirt-python===6.10.0/' /requirements/upper-constraints.txt {% endif %}\
51+
&& sed -i -e "/^libvirt-python/d" /requirements/upper-constraints.txt \
52+
&& sed -i -e "/^libvirt-python/d" /masakari-monitors/requirements.txt \
4753
&& {{ macros.install_pip(masakari_monitors_pip_packages | customizable("pip_packages")) }} \
4854
&& mkdir -p /etc/masakari-monitors \
4955
&& chown -R masakari: /etc/masakari-monitors

kolla/common/utils.py

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,33 @@ def make_a_logger(conf=None, image_name=None):
2121
log = logging.getLogger(".".join([__name__, image_name]))
2222
else:
2323
log = logging.getLogger(__name__)
24+
25+
if conf is not None and conf.debug:
26+
loglevel = logging.DEBUG
27+
else:
28+
loglevel = logging.INFO
29+
2430
if not log.handlers:
25-
if conf is None or not conf.logs_dir or not image_name:
26-
handler = logging.StreamHandler(sys.stderr)
27-
log.propagate = False
31+
stream_handler = logging.StreamHandler(sys.stderr)
32+
stream_handler.setFormatter(logging.Formatter(logging.BASIC_FORMAT))
33+
# NOTE(hrw): quiet mode matters only on console
34+
if conf is not None and conf.quiet:
35+
stream_handler.setLevel(logging.CRITICAL)
2836
else:
37+
stream_handler.setLevel(loglevel)
38+
log.addHandler(stream_handler)
39+
log.propagate = False
40+
41+
if conf is not None and conf.logs_dir and image_name:
2942
filename = os.path.join(conf.logs_dir, "%s.log" % image_name)
3043
handler = logging.FileHandler(filename, delay=True)
31-
handler.setFormatter(logging.Formatter(logging.BASIC_FORMAT))
32-
log.addHandler(handler)
33-
if conf is not None and conf.debug:
34-
log.setLevel(logging.DEBUG)
35-
elif conf is not None and conf.quiet and image_name:
36-
log.setLevel(logging.CRITICAL)
37-
else:
38-
log.setLevel(logging.INFO)
44+
# NOTE(hrw): logfile will be INFO or DEBUG
45+
handler.setLevel(loglevel)
46+
handler.setFormatter(logging.Formatter(logging.BASIC_FORMAT))
47+
log.addHandler(handler)
48+
49+
# NOTE(hrw): needs to be high, handlers have own levels
50+
log.setLevel(logging.DEBUG)
3951
return log
4052

4153

kolla/image/build.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,15 @@ def followups(self):
405405
def process_source(self, image, source):
406406
dest_archive = os.path.join(image.path, source['name'] + '-archive')
407407

408+
# NOTE(mgoddard): Change ownership of files to root:root. This
409+
# avoids an issue introduced by the fix for git CVE-2022-24765,
410+
# which breaks PBR when the source checkout is not owned by the
411+
# user installing it. LP#1969096
412+
def reset_userinfo(tarinfo):
413+
tarinfo.uid = tarinfo.gid = 0
414+
tarinfo.uname = tarinfo.gname = "root"
415+
return tarinfo
416+
408417
if source.get('type') == 'url':
409418
self.logger.debug("Getting archive from %s", source['source'])
410419
try:
@@ -458,7 +467,8 @@ def process_source(self, image, source):
458467
if os.path.isdir(source['source']):
459468
with tarfile.open(dest_archive, 'w') as tar:
460469
tar.add(source['source'],
461-
arcname=os.path.basename(source['source']))
470+
arcname=os.path.basename(source['source']),
471+
filter=reset_userinfo)
462472
else:
463473
shutil.copyfile(source['source'], dest_archive)
464474

kolla/template/filters.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from jinja2 import contextfilter
15+
# NOTE: jinja2 3.1.0 dropped contextfilter in favour of pass_context.
16+
try:
17+
from jinja2 import pass_context
18+
except ImportError:
19+
from jinja2 import contextfilter as pass_context
20+
1621
from jinja2 import Undefined
1722

1823

19-
@contextfilter
24+
@pass_context
2025
def customizable(context, val_list, call_type):
2126
# NOTE(mgoddard): Don't try to customise undefined values. There are cases
2227
# where this might happen, for example using a generic template overrides

kolla/template/methods.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
import os
1616
import yaml
1717

18-
from jinja2 import contextfunction
18+
# NOTE: jinja2 3.1.0 dropped contextfunction in favour of pass_context.
19+
try:
20+
from jinja2 import pass_context
21+
except ImportError:
22+
from jinja2 import contextfunction as pass_context
1923

2024

2125
def debian_package_install(packages, clean_package_cache=True):
@@ -71,7 +75,7 @@ def debian_package_install(packages, clean_package_cache=True):
7175
return ' && '.join(cmds)
7276

7377

74-
@contextfunction
78+
@pass_context
7579
def handle_repos(context, reponames, mode):
7680
"""NOTE(hrw): we need to handle CentOS, Debian and Ubuntu with one macro.
7781

kolla/template/repos.yaml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,53 +47,51 @@ rhel:
4747
opstools: "centos-opstools"
4848
rabbitmq: "centos-rabbitmq-38"
4949

50-
# NOTE(mnasiadka): Erlang repo - Debian Buster/Bullseye needs to use bionic as per RabbitMQ docs
5150
debian:
52-
5351
elasticsearch: "deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main"
54-
erlang: "deb http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu bionic main"
52+
erlang: "deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/debian buster main"
5553
grafana: "deb https://packages.grafana.com/oss/deb stable main"
5654
influxdb: "deb https://repos.influxdata.com/debian buster stable"
5755
logstash: "deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main"
5856
kibana: "deb [arch=amd64] https://artifacts.elastic.co/packages/oss-7.x/apt stable main"
5957
mariadb: "deb http://downloads.mariadb.com/MariaDB/mariadb-10.3/repo/debian buster main"
60-
rabbitmq: "deb https://packagecloud.io/rabbitmq/rabbitmq-server/debian/ buster main"
58+
rabbitmq: "deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/debian buster main"
6159
td-agent: "deb http://packages.treasuredata.com/4/debian/buster buster contrib"
6260

6361
debian-aarch64:
6462
elasticsearch: "deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main"
65-
erlang: "deb http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu bionic main"
63+
erlang: "deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/debian buster main"
6664
grafana: "deb https://packages.grafana.com/oss/deb stable main"
6765
influxdb: "deb https://repos.influxdata.com/debian buster stable"
6866
logstash: "deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main"
6967
kibana: "deb [arch=amd64] https://artifacts.elastic.co/packages/oss-7.x/apt stable main"
7068
libvirt: "deb https://obs.linaro.org/repos/home:/marcin.juszkiewicz/debian-buster ./"
7169
mariadb: "deb http://downloads.mariadb.com/MariaDB/mariadb-10.3/repo/debian buster main"
72-
rabbitmq: "deb https://packagecloud.io/rabbitmq/rabbitmq-server/debian/ buster main"
70+
rabbitmq: "deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/debian buster main"
7371
td-agent: "deb http://packages.treasuredata.com/4/debian/buster buster contrib"
7472

7573
ubuntu:
7674
elasticsearch: "deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main"
77-
erlang: "deb http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu focal main"
75+
erlang: "deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/ubuntu focal main"
7876
grafana: "deb https://packages.grafana.com/oss/deb stable main"
7977
influxdb: "deb https://repos.influxdata.com/ubuntu focal stable"
8078
logstash: "deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main"
8179
kibana: "deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main"
8280
mariadb: "deb http://downloads.mariadb.com/MariaDB/mariadb-10.3/repo/ubuntu focal main"
8381
qdrouterd: "deb http://ppa.launchpad.net/qpid/released/ubuntu/ focal main"
84-
rabbitmq: "deb https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ focal main"
82+
rabbitmq: "deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/ubuntu focal main"
8583
td-agent: "deb http://packages.treasuredata.com/4/ubuntu/focal/ focal contrib"
8684

8785
ubuntu-aarch64:
8886
elasticsearch: "deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main"
89-
erlang: "deb http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu focal main"
87+
erlang: "deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/ubuntu focal main"
9088
grafana: "deb https://packages.grafana.com/oss/deb stable main"
9189
influxdb: "deb https://repos.influxdata.com/ubuntu focal stable"
9290
logstash: "deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main"
9391
mariadb: "deb http://downloads.mariadb.com/MariaDB/mariadb-10.3/repo/ubuntu bionic main"
94-
rabbitmq: "deb https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ focal main"
92+
rabbitmq: "deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/ubuntu focal main"
9593
td-agent: "deb http://packages.treasuredata.com/4/ubuntu/focal/ focal contrib"
9694

9795
ubuntu-ppc64le:
9896
mariadb: "deb http://downloads.mariadb.com/MariaDB/mariadb-10.3/repo/ubuntu focal main"
99-
rabbitmq: "deb https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ focal main"
97+
rabbitmq: "deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/ubuntu focal main"

0 commit comments

Comments
 (0)