Skip to content

Commit

Permalink
[WIP] Prepare crc job for architecture repo
Browse files Browse the repository at this point in the history
  • Loading branch information
cescgina committed May 31, 2024
1 parent 533ee13 commit fd154d9
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 17 deletions.
98 changes: 98 additions & 0 deletions ci/playbooks/run-architecture-crc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
# Usage and expected parameters
# $ ansible-playbook run-architecture.yml \
# -e cifmw_architecture_repo=$HOME/architecture \
# -e cifmw_architecture_scenario=hci \
# -e cifmw_networking_mapper_networking_env_def_path=$HOME/net-env.yml
# [any other parameter/files your VA/DT might need]
#
# cifmw_architecture_repo: location of the architecture repository.
# cifmw_architecture_scenario: the scenario you want to test.
# cifmw_networking_mapper_networking_env_def_path: path to the
# networking-mapper environment definition file.
#
# Special parameters set in the playbook (you can override them)
# cifmw_basedir: defaults to ~/ci-framework-data
# cifmw_zuul_target_host: target host. Defaults to localhost

- name: Test architecture automations
hosts: "{{ cifmw_zuul_target_host | default('controller') }}"
gather_facts: true
vars:
_homedir: "{{ ansible_user_dir | default(lookup('env', 'HOME')) }}"
cifmw_basedir: >-
{{
(_homedir,
'ci-framework-data') |
path_join
}}
cifmw_path: >-
{{
['~/bin',
ansible_env.PATH] | join(':')
}}
pre_tasks:
# This allows to create a custom scenario file that would
# just override some parts of an existing one.
# For example, you create a DT based on the va-hci.yml.
# You will then just add
# `cifmw_parent_scenario: scenarios/reproducers/va-hci.yml`
# in the file, and override/extend the scenario to match your
# needs.
# The parameter also supports a list of files if needed.
#
# File path are relative to the root of the ci-framework repository.
- name: Inherit from parent parameter file if instructed
vars:
_file_list: >-
{% if cifmw_parent_scenario is defined and
cifmw_parent_scenario is string -%}
{{ [cifmw_parent_scenario] }}
{% elif cifmw_parent_scenario is defined and
cifmw_parent_scenario is not string and
cifmw_parent_scenario is iterable -%}
{{ cifmw_parent_scenario }}
{% else %}
{{ [] }}
{% endif %}
when:
- item is exists
ansible.builtin.include_vars:
file: "{{ item }}"
loop: "{{ _file_list }}"

- name: Assert we have the bare minimum to run
ansible.builtin.assert:
quiet: true
that:
- cifmw_architecture_repo is defined
- cifmw_architecture_scenario is defined
- cifmw_networking_mapper_networking_env_def_path is defined

- name: Deploy basic dependencies
ansible.builtin.import_role:
name: 'ci_setup'

- name: Create needed directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: "0755"
loop:
- "{{ cifmw_basedir }}/logs"
- "{{ cifmw_basedir }}/artifacts"
tasks:
- name: Load networking mapper environment
ansible.builtin.import_role:
name: "networking_mapper"
tasks_from: "load_env_definition.yml"

- name: Run reproducer to deploy VA
ansible.builtin.import_playbook: >-
{{
[
ansible_user_dir,
zuul.projects['github.com/openstack-k8s-operators/ci-framework'].src_dir,
'reproducer.yml'
] | ansible.builtin.path_join
}}
17 changes: 17 additions & 0 deletions scenarios/reproducers/va-hci-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
cifmw_architecture_scenario: hci

# Automation section. Most of those parameters will be passed to the
# controller-0 as-is and be consumed by the `deploy-va.sh` script.
# Please note, all paths are on the controller-0, meaning managed by the
# Framework. Please do not edit them!
_arch_repo: "/home/zuul/src/github.com/openstack-k8s-operators/architecture"
cifmw_ceph_client_vars: /tmp/ceph_client.yml
cifmw_ceph_client_values_post_ceph_path_src: >-
{{ _arch_repo }}/examples/va/hci/values.yaml
cifmw_ceph_client_values_post_ceph_path_dst: >-
{{ cifmw_ceph_client_values_post_ceph_path_src }}
cifmw_ceph_client_service_values_post_ceph_path_src: >-
{{ _arch_repo }}/examples/va/hci/service-values.yaml
cifmw_ceph_client_service_values_post_ceph_path_dst: >-
{{ cifmw_ceph_client_service_values_post_ceph_path_src }}
8 changes: 8 additions & 0 deletions scenarios/reproducers/va-hci-reduced.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
cifmw_parent_scenario: "scenarios/reproducers/va-hci-base.yml"

# Test Ceph file and object storage (block is enabled by default)
cifmw_ceph_daemons_layout:
rgw_enabled: true
dashboard_enabled: false
cephfs_enabled: true
18 changes: 1 addition & 17 deletions scenarios/reproducers/va-hci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
---
cifmw_architecture_scenario: hci

# Automation section. Most of those parameters will be passed to the
# controller-0 as-is and be consumed by the `deploy-va.sh` script.
# Please note, all paths are on the controller-0, meaning managed by the
# Framework. Please do not edit them!
_arch_repo: "/home/zuul/src/github.com/openstack-k8s-operators/architecture"
cifmw_ceph_client_vars: /tmp/ceph_client.yml
cifmw_ceph_client_values_post_ceph_path_src: >-
{{ _arch_repo }}/examples/va/hci/values.yaml
cifmw_ceph_client_values_post_ceph_path_dst: >-
{{ cifmw_ceph_client_values_post_ceph_path_src }}
cifmw_ceph_client_service_values_post_ceph_path_src: >-
{{ _arch_repo }}/examples/va/hci/service-values.yaml
cifmw_ceph_client_service_values_post_ceph_path_dst: >-
{{ cifmw_ceph_client_service_values_post_ceph_path_src }}
cifmw_parent_scenario: "scenarios/reproducers/va-hci-base.yml"
# HERE if you want to overload kustomization, you can uncomment this parameter
# and push the data structure you want to apply.
# cifmw_architecture_user_kustomize:
Expand Down
24 changes: 24 additions & 0 deletions zuul.d/architecture-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,27 @@
- zuul.d/architecture-jobs.yaml
- ^roles/ci_gen_kustomize_values/(?!meta|README).*
- ^roles/kustomize_deploy/(?!meta|README).*

- job:
name: cifmw-architecture-crc-base
parent: cifmw-architecture-validate-base
nodeset: centos-9-medium-3x-centos-9-crc-extracted-2-30-0-xxl
vars:
cifmw_libvirt_manager_pub_net: public
cifmw_use_devscripts: false
cifmw_use_uefi: true
cifmw_root_partition_id: 4
cifmw_libvirt_manager_compute_amount: 3
cifmw_libvirt_manager_compute_cpus: 4
cifmw_openshift_setup_skip_internal_registry_tls_verify: true
cifmw_deploy_architecture: true
run:
- ci/playbooks/run-architecture-crc.yml

- job:
name: cifmw-architecture-crc-hci
parent: cifmw-architecture-crc-base
vars:
cifmw_architecture_scenario: va-hci-reduced
files:
- ci/playbooks/run-architecture-crc.yml
1 change: 1 addition & 0 deletions zuul.d/projects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
github-check:
jobs:
- noop
- cifmw-architecture-crc-hci
- cifmw-pod-ansible-test
- cifmw-pod-k8s-snippets-source
- cifmw-pod-pre-commit
Expand Down

0 comments on commit fd154d9

Please sign in to comment.