Skip to content

Commit fafb034

Browse files
authored
Merge pull request #409 from stackhpc/upstream/master-2025-05-12
Synchronise master with upstream
2 parents a5c330c + a01e339 commit fafb034

File tree

20 files changed

+324
-15
lines changed

20 files changed

+324
-15
lines changed

docker/barbican/barbican-base/Dockerfile.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
77

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

10-
{{ macros.configure_user(name='barbican', groups='nfast') }}
10+
{{ macros.configure_user(name='barbican', groups='nfast,hsmusers') }}
1111

1212
{{ macros.install_packages(barbican_base_packages | customizable("packages")) }}
1313

docker/base/mariadb.repo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[mariadb]
22
name = MariaDB Server
3-
baseurl = https://dlm.mariadb.com/repo/mariadb-server/10.11/yum/rhel/$releasever/$basearch
3+
baseurl = https://dlm.mariadb.com/repo/mariadb-server/10.11.11/yum/rhel/$releasever/$basearch
44
gpgcheck = 1
55
enabled = 0
66
module_hotfixes = 1

docker/bifrost/bifrost-base/Dockerfile.j2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ RUN mkdir -p /requirements \
4848
&& python3 -m venv --system-site-packages {{ venv_path }} \
4949
&& KOLLA_DISTRO_PYTHON_VERSION=$(/usr/bin/python3 -c "import sys; print('{}.{}'.format(sys.version_info.major, sys.version_info.minor))") \
5050
&& cd {{ venv_path }}/lib \
51-
&& ln -s python${KOLLA_DISTRO_PYTHON_VERSION} {{ venv_path }}/lib/python3
51+
&& rm -f python3 \
52+
&& ln -s python${KOLLA_DISTRO_PYTHON_VERSION} python3
5253

5354
RUN ln -s bifrost-base-source/* bifrost \
5455
&& {{ macros.install_pip(['pip', 'wheel', 'setuptools']) }} \

docker/letsencrypt/letsencrypt-lego/letsencrypt-certificates.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function obtain_or_renew_certificate {
2323
local eab="${8}"
2424
local hmac="${9}"
2525
local key_id="${10}"
26+
local letsencrypt_key_type="${11:-}"
2627

2728
certificate_domain_opts=$(echo ${certificate_fqdns} | sed -r -e 's/^/,/g' -e 's/,/--domains=/g' -e 's/--/ --/g')
2829
certificate_fqdn=$(echo ${certificate_fqdns} | awk -F ',' '{print $1}')
@@ -69,6 +70,7 @@ function obtain_or_renew_certificate {
6970

7071
log_info "[${certificate_fqdn} - cron] Obtaining certificate for domains ${certificate_fqdns}."
7172
mapfile -t cmd_output < <(/opt/lego --email="${mail}" \
73+
$( [ -n "${letsencrypt_key_type}" ] && echo "--key-type ${letsencrypt_key_type}" ) \
7274
${certificate_domain_opts} \
7375
--server "${acme_url}" \
7476
--path "/etc/letsencrypt/lego/${certificate_type}/" \
@@ -118,7 +120,7 @@ KEY_ID="NONE"
118120
LOG_FILE="/var/log/kolla/letsencrypt/lesencrypt-lego.log"
119121

120122

121-
VALID_ARGS=$(getopt -o ief:p:d:m:a:v:h: --long internal,external,fqdns:,port:,days:,mail:,acme:,vips:,haproxies-ssh:,eab,kid:,hmac: -- "$@")
123+
VALID_ARGS=$(getopt -o ief:p:d:m:a:v:h:k: --long internal,external,fqdns:,port:,days:,mail:,acme:,vips:,haproxies-ssh:,eab,kid:,hmac:,key-type: -- "$@")
122124
if [[ $? -ne 0 ]]; then
123125
exit 1;
124126
fi
@@ -176,6 +178,10 @@ while [ : ]; do
176178
KEY_ID="${2}"
177179
shift 2
178180
;;
181+
-k | --key-type)
182+
LETSENCRYPT_KEY_TYPE="${2}"
183+
shift 2
184+
;;
179185
--) shift;
180186
break
181187
;;
@@ -203,12 +209,12 @@ if [ "${INTERNAL_SET}" = "true" ] || [ "${EXTERNAL_SET}" = "true" ]; then
203209
log_info "[${FQDN} - cron] This Letsencrypt-lego host is active..."
204210
if [ "${LETSENCRYPT_INTERNAL_FQDNS}" != "" ]; then
205211
log_info "[${FQDN} - cron] Processing domains ${LETSENCRYPT_INTERNAL_FQDNS}"
206-
obtain_or_renew_certificate ${LETSENCRYPT_INTERNAL_FQDNS} internal ${PORT} ${DAYS} ${ACME} ${MAIL} ${LETSENCRYPT_SSH_PORT} ${EXTERNAL_ACCOUNT_BINDING} ${HMAC} ${KEY_ID}
212+
obtain_or_renew_certificate ${LETSENCRYPT_INTERNAL_FQDNS} internal ${PORT} ${DAYS} ${ACME} ${MAIL} ${LETSENCRYPT_SSH_PORT} ${EXTERNAL_ACCOUNT_BINDING} ${HMAC} ${KEY_ID} ${LETSENCRYPT_KEY_TYPE}
207213
fi
208214

209215
if [ "${LETSENCRYPT_EXTERNAL_FQDNS}" != "" ]; then
210216
log_info "[${FQDN} - cron] Processing domains ${LETSENCRYPT_EXTERNAL_FQDNS}"
211-
obtain_or_renew_certificate ${LETSENCRYPT_EXTERNAL_FQDNS} external ${PORT} ${DAYS} ${ACME} ${MAIL} ${LETSENCRYPT_SSH_PORT} ${EXTERNAL_ACCOUNT_BINDING} ${HMAC} ${KEY_ID}
217+
obtain_or_renew_certificate ${LETSENCRYPT_EXTERNAL_FQDNS} external ${PORT} ${DAYS} ${ACME} ${MAIL} ${LETSENCRYPT_SSH_PORT} ${EXTERNAL_ACCOUNT_BINDING} ${HMAC} ${KEY_ID} ${LETSENCRYPT_KEY_TYPE}
212218
fi
213219
else
214220
log_info "[${FQDN} - cron] This Letsencrypt-lego host is passive, nothing to do..."

docker/neutron/neutron-base/Dockerfile.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ ADD plugins-archive /
7070

7171
COPY neutron_sudoers /etc/sudoers.d/kolla_neutron_sudoers
7272
COPY extend_start.sh /usr/local/bin/kolla_extend_start
73+
RUN mkdir -p /usr/local/lib/neutron-wrappers /usr/local/etc/neutron-wrappers
74+
COPY dnsmasq haproxy keepalived neutron-keepalived-state-change radvd copy-wrappers delete-wrappers /usr/local/lib/neutron-wrappers/
75+
RUN chmod +x /usr/local/lib/neutron-wrappers/copy-wrappers \
76+
&& chmod +x /usr/local/lib/neutron-wrappers/delete-wrappers
7377

7478
RUN ln -s neutron-base-source/* neutron \
7579
&& {{ macros.install_pip(neutron_base_pip_packages | customizable("pip_packages")) }} \
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
for binary in dnsmasq haproxy keepalived neutron-keepalived-state-change radvd; do
3+
cp /usr/local/lib/neutron-wrappers/${binary} /usr/local/bin/${binary}
4+
chmod +x /usr/local/bin/${binary}
5+
done
6+
7+
echo "KOLLA_IMAGE=${KOLLA_IMAGE}" > /usr/local/etc/neutron-wrappers/config
8+
echo "KOLLA_NAME=${KOLLA_NAME}" >> /usr/local/etc/neutron-wrappers/config
9+
echo "KOLLA_SERVICE_NAME=${KOLLA_SERVICE_NAME}" >> /usr/local/etc/neutron-wrappers/config
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
for binary in dnsmasq haproxy keepalived neutron-keepalived-state-change radvd; do
3+
rm -f /usr/local/bin/${binary}
4+
done
5+
6+
rm -f /usr/local/etc/neutron-wrappers/config
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
source /usr/local/etc/neutron-wrappers/config
4+
5+
ARGS="$@"
6+
7+
# Extract the network namespace UUID from the command line args provided by
8+
# neutron. Typically of the form (with dnsmasq as an example):
9+
#
10+
# dnsmasq --no-hosts --no-resolv --except-interface=lo \
11+
# --pid-file=/var/lib/neutron/dhcp/317716b8-919a-4a6f-8db1-78128ec3b100/pid \
12+
# --dhcp-hostsfile=/var/lib/neutron/dhcp/317716b8-919a-4a6f-8db1-78128ec3b100/host ...
13+
NETNS=$(ip netns identify)
14+
NAME=${KOLLA_NAME}_dnsmasq_${NETNS}
15+
16+
if [[ -S "/var/run/docker.sock" ]]; then
17+
CLI="docker"
18+
CMD="ip netns exec ${NETNS} /usr/sbin/dnsmasq -k"
19+
elif [[ -S "/run/podman/podman.sock" ]]; then
20+
CLI="nsenter --net=/run/netns/${NETNS} --preserve-credentials -m -t1 podman"
21+
CMD="/usr/sbin/dnsmasq -k"
22+
else
23+
echo "Could not detect a supported container runtime, exiting."
24+
exit 1
25+
fi
26+
27+
LIST=$($CLI ps -a --filter name=${SERVICE}_dnsmasq_ --format '{{.ID}}:{{.Names}}:{{.Status}}' | awk '{print $1}')
28+
29+
# If the NAME is already taken by a container, give it an unique name
30+
printf "%s\n" "${LIST}" | grep -q "${NAME}$" && NAME="${NAME}_$(date +%Y-%m-%d-%H%M%S-%N)"
31+
32+
echo "Starting a new child container ${NAME} using image ${KOLLA_IMAGE}"
33+
$CLI run --rm --detach \
34+
-v /etc/kolla/${KOLLA_SERVICE_NAME}:/etc/neutron:ro \
35+
-v /run/netns:/run/netns:shared \
36+
-v neutron_metadata_socket:/var/lib/neutron/kolla/ \
37+
-v kolla_logs:/var/log/kolla \
38+
--net host \
39+
--pid host \
40+
--cgroupns host \
41+
--privileged \
42+
-u root \
43+
--name $NAME \
44+
${KOLLA_IMAGE} \
45+
$CMD $ARGS
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
source /usr/local/etc/neutron-wrappers/config
4+
5+
ARGS="$@"
6+
7+
# Extract the network namespace UUID from the command line args provided by
8+
# neutron. Typically of the form (with dnsmasq as an example):
9+
#
10+
# dnsmasq --no-hosts --no-resolv --except-interface=lo \
11+
# --pid-file=/var/lib/neutron/dhcp/317716b8-919a-4a6f-8db1-78128ec3b100/pid \
12+
# --dhcp-hostsfile=/var/lib/neutron/dhcp/317716b8-919a-4a6f-8db1-78128ec3b100/host ...
13+
NETNS=$(ip netns identify)
14+
NAME=${KOLLA_NAME}_haproxy_${NETNS}
15+
HAPROXY_CMD='$(if [ -f /usr/sbin/haproxy-systemd-wrapper ]; then echo "/usr/sbin/haproxy -Ds"; else echo "/usr/sbin/haproxy -Ws"; fi)'
16+
if [[ -S "/var/run/docker.sock" ]]; then
17+
CLI="docker"
18+
CMD="ip netns exec ${NETNS} "'$HAPROXY'
19+
elif [[ -S "/run/podman/podman.sock" ]]; then
20+
CLI="nsenter --net=/run/netns/${NETNS} --preserve-credentials -m -t 1 podman"
21+
CMD='$HAPROXY'
22+
else
23+
echo "Could not detect a supported container runtime, exiting."
24+
exit 1
25+
fi
26+
27+
LIST=$($CLI ps -a --filter name=${KOLLA_NAME}_haproxy_ --format '{{.ID}}:{{.Names}}:{{.Status}}' | awk '{print $1}')
28+
29+
# If the NAME is already taken by a container, give it an unique name
30+
printf "%s\n" "${LIST}" | grep -q "${NAME}$" && NAME="${NAME}_$(date +%Y-%m-%d-%H%M%S-%N)"
31+
32+
echo "Starting a new child container ${NAME} using image ${KOLLA_IMAGE}"
33+
$CLI run --rm --detach \
34+
-v /etc/kolla/${KOLLA_SERVICE_NAME}:/etc/neutron:ro \
35+
-v /run/netns:/run/netns:shared \
36+
-v neutron_metadata_socket:/var/lib/neutron/kolla \
37+
-v kolla_logs:/var/log/kolla \
38+
--net host \
39+
--pid host \
40+
--cgroupns host \
41+
--privileged \
42+
-u root \
43+
--name $NAME \
44+
${KOLLA_IMAGE} \
45+
/bin/bash -c "HAPROXY=\"$HAPROXY_CMD\"; exec $CMD $ARGS"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
source /usr/local/etc/neutron-wrappers/config
4+
5+
ARGS="$@"
6+
7+
# Extract the network namespace UUID from the command line args provided by
8+
# neutron. Typically of the form (with dnsmasq as an example):
9+
#
10+
# dnsmasq --no-hosts --no-resolv --except-interface=lo \
11+
# --pid-file=/var/lib/neutron/dhcp/317716b8-919a-4a6f-8db1-78128ec3b100/pid \
12+
# --dhcp-hostsfile=/var/lib/neutron/dhcp/317716b8-919a-4a6f-8db1-78128ec3b100/host ...
13+
NETNS=$(ip netns identify)
14+
NAME=${KOLLA_NAME}_keepalived_${NETNS}
15+
16+
if [[ -S "/var/run/docker.sock" ]]; then
17+
CLI="docker"
18+
CMD="ip netns exec ${NETNS} /usr/sbin/keepalived -n -l -D"
19+
elif [[ -S "/run/podman/podman.sock" ]]; then
20+
CLI="nsenter --net=/run/netns/${NETNS} --preserve-credentials -m -t 1 podman"
21+
CMD='/usr/sbin/keepalived -n -l -D'
22+
else
23+
echo "Could not detect a supported container runtime, exiting."
24+
exit 1
25+
fi
26+
27+
LIST=$($CLI ps -a --filter name=${KOLLA_SERVICE}_keepalived_ --format '{{.ID}}:{{.Names}}:{{.Status}}' | awk '{print $1}')
28+
29+
# If the NAME is already taken by a container, give it an unique name
30+
printf "%s\n" "${LIST}" | grep -q "${NAME}$" && NAME="${NAME}_$(date +%Y-%m-%d-%H%M%S-%N)"
31+
32+
echo "Starting a new child container ${NAME} using image ${KOLLA_IMAGE}"
33+
$CLI run --detach \
34+
-v /etc/kolla/${KOLLA_SERVICE_NAME}:/etc/neutron:ro \
35+
-v /lib/modules:/lib/modules:ro \
36+
-v /sbin/modprobe:/sbin/modprobe:ro \
37+
-v /run/netns:/run/netns:shared \
38+
-v neutron_metadata_socket:/var/lib/neutron/kolla/ \
39+
-v kolla_logs:/var/log/kolla \
40+
--net host \
41+
--pid host \
42+
--cgroupns host \
43+
--privileged \
44+
-u root \
45+
--name $NAME \
46+
${KOLLA_IMAGE} \
47+
$CMD $ARGS

0 commit comments

Comments
 (0)