Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024.1: 2023.1 merge #1287

Merged
merged 32 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
61e6336
Fix prometheus_blackbox_exporter_endpoints to allow truthy values
MoteHue Sep 4, 2024
bdb6234
Add bool to rabbitmq endpoint
MoteHue Sep 5, 2024
dc85568
Correct horizon_public_endpoint
MoteHue Sep 5, 2024
97c5743
Merge pull request #1264 from stackhpc/zed-yoga-merge
markgoddard Sep 6, 2024
49a4b06
Add merge.py
markgoddard Sep 6, 2024
95fbf7a
Merge pull request #1267 from stackhpc/merge-py
Alex-Welsh Sep 6, 2024
3a97322
Fix CVE-2024-44082 / OSSA-2024-003
priteau Sep 6, 2024
69012ee
Merge pull request #1268 from stackhpc/ossa-2024-003-antelope
markgoddard Sep 9, 2024
631cb26
Add select
MoteHue Sep 10, 2024
e4039e8
CI: Bump multinode.yml reusable workflow to 1.1.0
markgoddard Sep 10, 2024
ff35522
Merge pull request #1275 from stackhpc/2023.1-mn-sanitise-filenames
markgoddard Sep 10, 2024
0e2ca89
Merge pull request #1254 from stackhpc/fix-kayobe-blackbox-endpoints
Alex-Welsh Sep 10, 2024
8f18a1a
CI: Add 2024.1 to nightly multinode test matrix
markgoddard Sep 10, 2024
c4c531c
Add hook for fixing hostname bug in Multinode
Alex-Welsh Aug 30, 2024
043644b
Reboot hosts after fix-hostname changed
Alex-Welsh Sep 10, 2024
f693a52
Merge pull request #1277 from stackhpc/2023.1-mn-nightly-caracal
markgoddard Sep 11, 2024
b5bdd8a
Merge pull request #1257 from stackhpc/hook-hostname-fix
markgoddard Sep 11, 2024
d48a399
Reboot with bootstrap user in ci-aio env
Alex-Welsh Sep 11, 2024
11f024b
Merge pull request #1280 from stackhpc/caracal-upgrade
Alex-Welsh Sep 11, 2024
60432f6
Reference controller IP for backend TLS certificates
bbezak Sep 12, 2024
e474210
Merge pull request #1283 from stackhpc/vault-backend-network-node
markgoddard Sep 12, 2024
6181e80
kolla-images.py: Add a check-image-map command
markgoddard Sep 12, 2024
6f15763
kolla-images.py: Fix image to container exceptions using check-image-map
markgoddard Sep 12, 2024
1caf4a3
kolla-images.py: Misc fixes
markgoddard Sep 12, 2024
9241b3a
CI: Add check-image-map and check-hierarchy to check-tags workflow
markgoddard Sep 12, 2024
1edb38b
CI: Trigger build-kayobe-image for check-tags job
markgoddard Sep 12, 2024
a4f03d4
kolla-images.py: Add image map exception for neutron_eswitchd
markgoddard Sep 12, 2024
7d98067
Fix growroot when using software raid (#818)
jovial Sep 12, 2024
6bec4ba
Merge pull request #1284 from stackhpc/check-image-map
markgoddard Sep 12, 2024
fa3a4e1
Merge stackhpc/yoga into stackhpc/zed
markgoddard Sep 12, 2024
40afa6d
Merge stackhpc/zed into stackhpc/2023.1
markgoddard Sep 12, 2024
06d6ca3
Merge stackhpc/2023.1 into stackhpc/2024.1
markgoddard Sep 12, 2024
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
9 changes: 7 additions & 2 deletions .github/path-filters.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is a list of path filters for the PR workflow in .github/workflows/stackhpc-pull-request.yml.
aio:
aio: &aio
- '.automation'
- '.automation.conf/config.sh'
- '.automation.conf/tempest/load-lists/default'
Expand All @@ -20,6 +20,11 @@ aio:
- 'kayobe-env'
- 'requirements.txt'
- 'terraform/aio/**'
check-tags:
check-tags: &check-tags
- '.github/workflows/stackhpc-check-tags.yml'
- 'etc/kayobe/kolla-image-tags.yml'
- 'etc/kayobe/pulp.yml'
- 'tools/kolla-images.py'
build-kayobe-image:
- *aio
- *check-tags
3 changes: 2 additions & 1 deletion .github/workflows/multinode-inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class Scenario:
UBUNTU_JAMMY = OSRelease("ubuntu", "jammy", "ubuntu")
# NOTE(upgrade): Add supported releases here.
OPENSTACK_RELEASES = [
OpenStackRelease("2023.1", "zed", [ROCKY_9, UBUNTU_JAMMY])
OpenStackRelease("2024.1", "2023.1", [ROCKY_9, UBUNTU_JAMMY]),
OpenStackRelease("2023.1", "zed", [ROCKY_9, UBUNTU_JAMMY]),
]
NEUTRON_PLUGINS = ["ovs", "ovn"]

Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/stackhpc-check-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ jobs:
run: |
docker image pull $KAYOBE_IMAGE

- name: Check kolla-images.py image map and tag hierarchy
run: |
docker run -t --rm \
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
$KAYOBE_IMAGE \
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/playbook-run.sh \
'$KAYOBE_CONFIG_PATH/ansible/check-kolla-images-py.yml'

- name: Check container image tags
run: |
docker run -t --rm \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stackhpc-multinode-periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
name: Multinode periodic
needs:
- generate-inputs
uses: stackhpc/stackhpc-openstack-gh-workflows/.github/workflows/multinode.yml@1.0.1
uses: stackhpc/stackhpc-openstack-gh-workflows/.github/workflows/multinode.yml@1.1.0
with:
multinode_name: mn-prdc-${{ github.run_id }}
os_distribution: ${{ needs.generate-inputs.outputs.os_distribution }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stackhpc-multinode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ name: Multinode
jobs:
multinode:
name: Multinode
uses: stackhpc/stackhpc-openstack-gh-workflows/.github/workflows/multinode.yml@1.0.1
uses: stackhpc/stackhpc-openstack-gh-workflows/.github/workflows/multinode.yml@1.1.0
with:
multinode_name: ${{ inputs.multinode_name }}
os_distribution: ${{ inputs.os_distribution }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/stackhpc-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
outputs:
aio: ${{ steps.changes.outputs.aio }}
build-kayobe-image: ${{ steps.changes.outputs.build-kayobe-image }}
check-tags: ${{ steps.changes.outputs.check-tags }}
steps:
- name: GitHub Checkout
Expand Down Expand Up @@ -74,7 +75,7 @@ jobs:
- check-changes
uses: ./.github/workflows/stackhpc-build-kayobe-image.yml
with:
if: ${{ needs.check-changes.outputs.aio == 'true' }}
if: ${{ needs.check-changes.outputs.build-kayobe-image == 'true' }}
if: github.repository == 'stackhpc/stackhpc-kayobe-config'

check-tags:
Expand Down
35 changes: 35 additions & 0 deletions etc/kayobe/ansible/check-kolla-images-py.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
- name: Check kolla-images.py image map and tag hierarchy
hosts: localhost
gather_facts: false
tasks:
- name: Create a temporary directory
ansible.builtin.tempfile:
state: directory
suffix: kolla-ansible
register: tempdir_result

- name: Clone Kolla Ansible repository
ansible.builtin.git:
repo: "{{ stackhpc_kolla_ansible_source_url }}"
version: "{{ stackhpc_kolla_ansible_source_version }}"
dest: "{{ tempdir_result.path }}"

- name: Check image mapping
ansible.builtin.command:
cmd: >-
{{ kayobe_config_path }}/../../tools/kolla-images.py
check-image-map
--kolla-ansible-path {{ tempdir_result.path }}

- name: Check tag hierarchy
ansible.builtin.command:
cmd: >-
{{ kayobe_config_path }}/../../tools/kolla-images.py
check-hierarchy
--kolla-ansible-path {{ tempdir_result.path }}

- name: Remove temporary directory
ansible.builtin.file:
path: "{{ tempdir_result.path }}"
state: absent
1 change: 1 addition & 0 deletions etc/kayobe/ansible/check-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- name: Check whether tags exist in Pulp container registry
hosts: localhost
gather_facts: false
tasks:
- name: Query images and tags
command:
Expand Down
7 changes: 7 additions & 0 deletions etc/kayobe/ansible/fix-hostname.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@
cmd: hostnamectl set-hostname "{{ inventory_hostname }}"
when: current_hostname.stdout != inventory_hostname
become: true

- name: Reboot hosts
import_playbook: "{{ playbook_dir | realpath }}/reboot.yml"
vars:
reboot_hosts: fix-hostname
reboot_with_bootstrap_user: true
when: current_hostname.stdout != inventory_hostname
2 changes: 1 addition & 1 deletion etc/kayobe/ansible/growroot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
vars:
pv: "{{ pvs.stdout | from_json }}"
disk_tmp: "{{ pv.report[0].pv[0].pv_name[:-1] }}"
disk: "{{ disk_tmp[:-1] if disk_tmp[-1] == 'p' and disk_tmp[:9] == '/dev/nvme' else disk_tmp }}"
disk: "{{ disk_tmp[:-1] if pv.report[0].pv[0].pv_name | regex_search('[a-z0-9]+[0-9]+p[0-9]+') else disk_tmp }}"
part_num: "{{ pv.report[0].pv[0].pv_name[-1] }}"
become: true
failed_when: "growpart.rc != 0 and 'NOCHANGE' not in growpart.stdout"
Expand Down
2 changes: 1 addition & 1 deletion etc/kayobe/ansible/reboot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Reboot the host
hosts: seed-hypervisor:seed:overcloud:infra-vms
hosts: "{{ reboot_hosts | default('seed-hypervisor:seed:overcloud:infra-vms') }}"
serial: "{{ lookup('env', 'ANSIBLE_SERIAL') | default(1, true) }}"
gather_facts: false
vars:
Expand Down
2 changes: 1 addition & 1 deletion etc/kayobe/ansible/vault-generate-backend-tls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- name: Generate backend API certificates
hosts: controllers:network
vars:
vault_api_addr: "https://{{ internal_net_name | net_ip }}:8200"
vault_api_addr: "https://{{ internal_net_name | net_ip(groups['controllers'][0]) }}:8200"
vault_intermediate_ca_name: "OS-TLS-INT"
tasks:
- name: Set a fact about the virtualenv on the remote system
Expand Down
2 changes: 1 addition & 1 deletion etc/kayobe/environments/ci-multinode/inventory/groups
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
controllers

[fix-hostname:children]
storage
overcloud
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
# prometheus_blackbox_exporter_endpoints_kayobe is another set of default
# endpoints that are templated by Kayobe rather than Kolla Ansible. See
# kolla/globals.yml for more details.
prometheus_blackbox_exporter_endpoints: >-
{{ (prometheus_blackbox_exporter_endpoints_kayobe | default([]) +
prometheus_blackbox_exporter_endpoints_default) |
selectattr('enabled', 'true') |
map(attribute='endpoints') | flatten |
union(prometheus_blackbox_exporter_endpoints_custom) |
unique | select | list }}
prometheus_blackbox_exporter_endpoints: |
{% set endpoints = [] %}
{% for dict_item in (prometheus_blackbox_exporter_endpoints_kayobe | default([]) + prometheus_blackbox_exporter_endpoints_default) %}
{% if dict_item.enabled | bool %}
{% for endpoint in dict_item.endpoints %}
{% set _ = endpoints.append(endpoint) %}
{% endfor %}
{% endif %}
{% endfor %}
{{ (endpoints + prometheus_blackbox_exporter_endpoints_custom) | unique | select | list }}

# A list of custom prometheus Blackbox exporter endpoints. Each element should
# have the following format:
Expand Down Expand Up @@ -125,7 +128,7 @@ prometheus_blackbox_exporter_endpoints_default:
- endpoints:
- "prometheus_alertmanager:http_2xx_alertmanager:{{ prometheus_alertmanager_public_endpoint if enable_prometheus_alertmanager_external else prometheus_alertmanager_internal_endpoint }}"
enabled: "{{ enable_prometheus_alertmanager | bool }}"
- endpoints: "{% set rabbitmq_endpoints = [] %}{% for host in groups.get('rabbitmq', []) %}{{ rabbitmq_endpoints.append('rabbitmq_' + host.replace('-', '') + (':tls_connect:' if rabbitmq_enable_tls else ':tcp_connect:') + ('api' | kolla_address(host) | put_address_in_context('url')) + ':' + hostvars[host]['rabbitmq_port'] ) }}{% endfor %}{{ rabbitmq_endpoints }}"
- endpoints: "{% set rabbitmq_endpoints = [] %}{% for host in groups.get('rabbitmq', []) %}{{ rabbitmq_endpoints.append('rabbitmq_' + host.replace('-', '') + (':tls_connect:' if rabbitmq_enable_tls | bool else ':tcp_connect:') + ('api' | kolla_address(host) | put_address_in_context('url')) + ':' + hostvars[host]['rabbitmq_port'] ) }}{% endfor %}{{ rabbitmq_endpoints }}"
enabled: "{{ enable_rabbitmq | bool }}"
- endpoints: "{% set redis_endpoints = [] %}{% for host in groups.get('redis', []) %}{{ redis_endpoints.append('redis_' + host.replace('-', '') + ':tcp_connect:' + ('api' | kolla_address(host) | put_address_in_context('url')) + ':' + hostvars[host]['redis_port']) }}{% endfor %}{{ redis_endpoints }}"
enabled: "{{ enable_redis | bool }}"
Expand All @@ -146,7 +149,7 @@ heat_cfn_internal_base_endpoint: "{{ heat_cfn_internal_fqdn | kolla_url(internal
heat_cfn_public_base_endpoint: "{{ heat_cfn_external_fqdn | kolla_url(public_protocol, heat_api_cfn_public_port) }}"
heat_internal_base_endpoint: "{{ heat_internal_fqdn | kolla_url(internal_protocol, heat_api_port) }}"
heat_public_base_endpoint: "{{ heat_external_fqdn | kolla_url(public_protocol, heat_api_public_port) }}"
horizon_public_endpoint: "{{ horizon_external_fqdn | kolla_url(public_protocol, horizon_listen_port) }}"
horizon_public_endpoint: "{{ horizon_external_fqdn | kolla_url(public_protocol, horizon_tls_port if kolla_enable_tls_external | bool else horizon_port) }}"
ironic_inspector_internal_endpoint: "{{ ironic_inspector_internal_fqdn | kolla_url(internal_protocol, ironic_inspector_port) }}"
ironic_inspector_public_endpoint: "{{ ironic_inspector_external_fqdn | kolla_url(public_protocol, ironic_inspector_public_port) }}"
magnum_internal_base_endpoint: "{{ magnum_internal_fqdn | kolla_url(internal_protocol, magnum_api_port) }}"
Expand Down
12 changes: 12 additions & 0 deletions releasenotes/notes/fix-cve-2024-44082-122ef225f674d864.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
security:
- |
Fixes `CVE-2024-44082
<https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-44082>`_ with updated
container images for Ironic services. Note that Ironic Python Agent images
also need to be updated to fully fix this vulnerability. If this is not
possible, a new configuration option
``[conductor]conductor_always_validates_images`` is available. See the
`OSSA-2024-003 description
<https://security.openstack.org/ossa/OSSA-2024-003.html>`_ for more
details.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
Fixes a regression when using ``growroot.yml`` and software raid where the
playbook would fail to identify the correct disk.
68 changes: 65 additions & 3 deletions tools/kolla-images.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,20 @@

# Maps a Kolla image to a list of containers that use the image.
IMAGE_TO_CONTAINERS_EXCEPTIONS: Dict[str, List[str]] = {
"dnsmasq": [
"ironic_dnsmasq",
],
"haproxy": [
"glance_tls_proxy",
"haproxy",
"neutron_tls_proxy",
],
"neutron-eswitchd": [
"mariadb-server": [
"mariadb",
"mariabackup",
],
"neutron-mlnx-agent": [
"neutron_eswitchd",
"neutron_mlnx_agent",
],
"neutron-metadata-agent": [
Expand All @@ -54,6 +63,15 @@
"nova_super_conductor",
"nova_conductor",
],
"openvswitch-db-server": [
"openvswitch_db",
],
"ovn-nb-db-server": [
"ovn_nb_db",
],
"ovn-sb-db-server": [
"ovn_sb_db",
],
"prometheus-v2-server": [
"prometheus_server",
],
Expand Down Expand Up @@ -91,6 +109,9 @@ def parse_args() -> argparse.Namespace:
parser.add_argument("--base-distros", default=",".join(SUPPORTED_BASE_DISTROS), choices=SUPPORTED_BASE_DISTROS)
subparsers = parser.add_subparsers(dest="command", required=True)

subparser = subparsers.add_parser("check-image-map", help="Check image mapping against kolla-ansible")
subparser.add_argument("--kolla-ansible-path", required=True, help="Path to kolla-ansible repostory checked out to correct branch")

subparser = subparsers.add_parser("check-hierarchy", help="Check tag variable hierarchy against kolla-ansible")
subparser.add_argument("--kolla-ansible-path", required=True, help="Path to kolla-ansible repostory checked out to correct branch")

Expand All @@ -109,7 +130,7 @@ def parse_args() -> argparse.Namespace:
return parser.parse_args()


def get_abs_path(relative_path: str) -> str:
def get_abs_path(relative_path: str) -> pathlib.Path:
"""Return the absolute path of a file in SKC."""
script_path = pathlib.Path(inspect.getfile(inspect.currentframe()))
return script_path.parent.parent / relative_path
Expand Down Expand Up @@ -272,6 +293,45 @@ def check_tags(base_distros: List[str], kolla_image_tags: KollaImageTags, regist
sys.exit(1)


def check_image_map(kolla_ansible_path: str):
"""Check the image mapping against Kolla Ansible variables.

The *_image variables in Kolla Ansible define the mapping between
containers and images. Ensure that the mapping defined in this script
matches the one in Kolla Ansible.
"""
supported_images = read_images("etc/kayobe/pulp.yml")
assert supported_images
# Build a map from container to image name.
cmd = """git grep -h '^[a-z0-9_]*_image:' ansible/roles/*/defaults/main.yml"""
image_map_str = subprocess.check_output(cmd, shell=True, cwd=os.path.realpath(kolla_ansible_path))
image_map = yaml.safe_load(image_map_str)
image_var_re = re.compile(r"^([a-z0-9_]+)_image$")
image_map = {
image_var_re.match(image_var).group(1): image.split("/")[-1]
for image_var, image in image_map.items()
}
# Filter out unsupported images.
image_map = {
container: image
for container, image in image_map.items()
if image in supported_images
}
assert image_map
errors = []
# Check that our mapping is correct.
for container, image in image_map.items():
containers = get_containers(image)
if container not in containers:
errors.append((container, image))
if errors:
print("Errors:")
for tag_var, image in errors:
print(f"Expected {tag_var} container to use {image} image")
if errors:
sys.exit(1)


def check_hierarchy(kolla_ansible_path: str):
"""Check the tag variable hierarchy against Kolla Ansible variables."""
cmd = """git grep -h '^[a-z0-9_]*_tag:' ansible/roles/*/defaults/main.yml"""
Expand Down Expand Up @@ -347,7 +407,9 @@ def main():

validate(kolla_image_tags)

if args.command == "check-hierarchy":
if args.command == "check-image-map":
check_image_map(args.kolla_ansible_path)
elif args.command == "check-hierarchy":
check_hierarchy(args.kolla_ansible_path)
elif args.command == "check-tags":
check_tags(base_distros, kolla_image_tags, args.registry, args.namespace)
Expand Down
Loading
Loading