Skip to content

Commit

Permalink
Merge pull request #637 from rebtoor/download_cache_improvement
Browse files Browse the repository at this point in the history
[edpm_download_cache] Download packages and containers images only when service will be deployed on the EDPM node.
  • Loading branch information
openshift-merge-bot[bot] authored May 22, 2024
2 parents 0df979d + 1c7eece commit db8e482
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 9 deletions.
2 changes: 2 additions & 0 deletions roles/edpm_download_cache/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ edpm_download_role_install_requirements: true
edpm_download_cache_packages: true

edpm_download_cache_container_images: true

edpm_download_cache_running_services: "{{ edpm_services_override | default(edpm_services) }}"
6 changes: 6 additions & 0 deletions roles/edpm_download_cache/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ argument_specs:
type: bool
default: true
description: Enable caching of container images
edpm_download_cache_running_services:
type: list
default: edpm_services
description: >
Used to select which list of services are running
on the machine. The list is provided by dataplane-operator.
11 changes: 11 additions & 0 deletions roles/edpm_download_cache/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,16 @@

- name: Converge
hosts: all
vars:
edpm_services:
- bootstrap
- configure-network
- validate-network
- install-os
- ceph-hci-pre
- configure-os
- ssh-known-hosts
- run-os
- reboot-os
roles:
- role: "edpm_download_cache"
7 changes: 0 additions & 7 deletions roles/edpm_download_cache/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@
hosts: all
roles:
- role: ../../../../molecule/common/test_deps
test_deps_extra_packages:
- podman
test_deps_setup_edpm: true
test_deps_setup_stream: true
test_deps_edpm_packages:
- openvswitch
- name: Prepare container
hosts: instance
roles:
- role: osp.edpm.env_data
13 changes: 13 additions & 0 deletions roles/edpm_download_cache/tasks/container_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- download_cache

- name: Download images for edpm_iscsid role
when: '"nova-storage" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_iscsid
tasks_from: download_cache.yml
Expand All @@ -17,6 +18,7 @@
- download_cache

- name: Download images for edpm_ovn role
when: '"ovn" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_ovn
tasks_from: download_cache.yml
Expand All @@ -25,6 +27,7 @@
- download_cache

- name: Download images for edpm_frr role
when: '"frr" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_frr
tasks_from: download_cache.yml
Expand All @@ -33,13 +36,15 @@
- download_cache

- name: Download images for edpm_ovn_bgp_agent role
when: '"ovn-bgp-agent" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_ovn_bgp_agent
tasks_from: download_cache.yml
tags:
- edpm_ovn_bgp_agent

- name: Download images for edpm_neutron_metadata role
when: '"neutron-metadata" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_neutron_metadata
tasks_from: download_cache.yml
Expand All @@ -48,6 +53,7 @@
- download_cache

- name: Download images for edpm_neutron_ovn role
when: '"neutron-ovn" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_neutron_ovn
tasks_from: download_cache.yml
Expand All @@ -56,6 +62,7 @@
- download_cache

- name: Download images for edpm_multipathd role
when: '"nova-storage" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_multipathd
tasks_from: download_cache.yml
Expand All @@ -64,6 +71,7 @@
- download_cache

- name: Download images for edpm_nova role
when: '"nova" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_nova
tasks_from: download_cache.yml
Expand All @@ -72,6 +80,7 @@
- download_cache

- name: Download images for edpm_neutron_sriov role
when: '"neutron-sriov" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_neutron_sriov
tasks_from: download_cache.yml
Expand All @@ -80,11 +89,15 @@
- download_cache

- name: Download images for edpm_neutron_dhcp role
when: '"neutron-dhcp" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_neutron_dhcp
tasks_from: download_cache.yml

- name: Download images for edpm_logrotate_crond role
when: ("install-os" in edpm_download_cache_running_services) or
("configure-os" in edpm_download_cache_running_services) or
("run-os" in edpm_download_cache_running_services)
ansible.builtin.include_role:
name: osp.edpm.edpm_logrotate_crond
tasks_from: download_cache_images.yml
Expand Down
18 changes: 16 additions & 2 deletions roles/edpm_download_cache/tasks/packages.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
---

- name: Download packages for edpm_bootstrap role
when: '"bootstrap" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_bootstrap
tasks_from: download_cache.yml
tags:
- edpm_kernel
- edpm_bootstrap
- download_cache

- name: Download packages for edpm_podman role
when: ("install-os" in edpm_download_cache_running_services) or
("configure-os" in edpm_download_cache_running_services) or
("run-os" in edpm_download_cache_running_services)
ansible.builtin.include_role:
name: osp.edpm.edpm_podman
tasks_from: download_cache.yml
Expand All @@ -17,6 +21,7 @@
- download_cache

- name: Download packages for edpm_tuned role
when: '"bootstrap" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_tuned
tasks_from: download_cache.yml
Expand All @@ -25,6 +30,7 @@
- download_cache

- name: Download packages for edpm_kernel role
when: '"bootstrap" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_kernel
tasks_from: download_cache.yml
Expand All @@ -33,6 +39,7 @@
- download_cache

- name: Download packages for edpm_network_config role
when: '"configure-network" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_network_config
tasks_from: download_cache.yml
Expand All @@ -41,6 +48,9 @@
- download_cache

- name: Download packages for edpm_logrotate_crond role
when: ("install-os" in edpm_download_cache_running_services) or
("configure-os" in edpm_download_cache_running_services) or
("run-os" in edpm_download_cache_running_services)
ansible.builtin.include_role:
name: osp.edpm.edpm_logrotate_crond
tasks_from: download_cache_packages.yml
Expand All @@ -49,14 +59,18 @@
- download_cache

- name: Download packages for edpm_sshd role
when: ("install-os" in edpm_download_cache_running_services) or
("configure-os" in edpm_download_cache_running_services) or
("run-os" in edpm_download_cache_running_services)
ansible.builtin.include_role:
name: osp.edpm.edpm_sshd
tasks_from: download_cache.yml
tags:
- edpm_sshd
- download_cache

- name: Download images for edpm_libvirt role
- name: Download packages for edpm_libvirt role
when: '"libvirt" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_libvirt
tasks_from: download_cache.yml
Expand Down

0 comments on commit db8e482

Please sign in to comment.