Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docker/valkey/valkey-base/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}

{% block valkey_base_header %}{% endblock %}

{% import "macros.j2" as macros with context %}

{{ macros.configure_user(name='valkey', homedir='/run/valkey') }}

COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 644 /usr/local/bin/kolla_extend_start

{{ macros.kolla_patch_sources() }}

{% block valkey_base_footer %}{% endblock %}
9 changes: 9 additions & 0 deletions docker/valkey/valkey-base/extend_start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

if [[ ! -d "/var/log/kolla/valkey" ]]; then
mkdir -p /var/log/kolla/valkey
fi

if [[ $(stat -c %a /var/log/kolla/valkey) != "755" ]]; then
chmod 755 /var/log/kolla/valkey
fi
26 changes: 26 additions & 0 deletions docker/valkey/valkey-sentinel/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM {{ namespace }}/{{ image_prefix }}valkey-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}

{% block valkey_sentinel_header %}{% endblock %}

{% import "macros.j2" as macros with context %}

{% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['epel']) }}
{% set valkey_sentinel_packages = ['valkey'] %}
{% elif base_package_type == 'deb' %}
{% set valkey_sentinel_packages = ['valkey-sentinel'] %}
{% endif %}
{{ macros.install_packages(valkey_sentinel_packages | customizable("packages")) }}

COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 644 /usr/local/bin/kolla_extend_start

{{ macros.kolla_patch_sources() }}

{% block valkey_sentinel_footer %}{% endblock %}
{% block footer %}{% endblock %}

USER valkey
32 changes: 32 additions & 0 deletions docker/valkey/valkey-sentinel/extend_start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

if [[ ! -d "/var/log/kolla/valkey" ]]; then
mkdir -p /var/log/kolla/valkey
fi

if [[ $(stat -c %a /var/log/kolla/valkey) != "755" ]]; then
chmod 755 /var/log/kolla/valkey
fi

# The CONFIG REWRITE command rewrites the valkey.conf
# file the server was started with, applying the minimal
# changes needed to make it reflect the configuration
# currently used by the server, which may be different
# compared to the original one because of the use of
# the CONFIG SET command.
#
# https://valkey.io/commands/config-rewrite/
#
# Because of above behaviour it's needed to
# hack kolla's CMD.
#
# Without this hack
# /usr/local/bin/kolla_set_configs --check
# is always reporting changed.
#
# Therefore valkey-sentinel is always restarted
# even if configuration is not changed from
# kolla-ansible side.
if [ ! -z "${VALKEY_CONF}" ] && [ ! -z ${VALKEY_GEN_CONF} ]; then
cp ${VALKEY_CONF} ${VALKEY_GEN_CONF}
fi
23 changes: 23 additions & 0 deletions docker/valkey/valkey-server/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM {{ namespace }}/{{ image_prefix }}valkey-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}

{% block valkey_server_header %}{% endblock %}

{% import "macros.j2" as macros with context %}

{% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['epel']) }}
{% set valkey_server_packages = ['valkey'] %}
{% elif base_package_type == 'deb' %}
{% set valkey_server_packages = ['valkey'] %}
{% endif %}
{{ macros.install_packages(valkey_server_packages | customizable("packages")) }}

{{ macros.kolla_patch_sources() }}

{% block valkey_server_footer %}{% endblock %}
{% block footer %}{% endblock %}

USER valkey
6 changes: 5 additions & 1 deletion kolla/common/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,5 +345,9 @@
'hsmusers-user': {
'uid': 42493, # This is not used, but the group ID is required.
'gid': 42493,
}
},
'valkey-user': {
'uid': 42494,
'gid': 42494,
},
}
8 changes: 8 additions & 0 deletions kolla/image/unbuildable.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
"tgtd", # Not supported on CentOS
},

'centos+stream9': {
"valkey-base" # Not supported on Stream 9
},

'centos+stream10': {
"collectd", # No opstools repo for EL10
"redis-base", # No redis repo for EL10
Expand All @@ -47,6 +51,10 @@
"tgtd", # Not supported on CentOS
},

'rocky+9': {
"valkey-base" # Not supported on Rocky 9
},

'rocky+10': {
"redis-base", # No Redis in EL10
"telegraf" # Missing opstools repo
Expand Down